Gridview rowupdating code in c
For demonstration I have created a database (named Database.mdf) in which we have a table named tbl_Employee.So I am having an issue with doing an update in a Gridview during an On Row Updating event.Entry, (SELECT avg(rating) FROM tb_comments WHERE " _ & "tb_comments.entry=tb_entity.id) as Rating, tb_kind. Info " _ & "FROM tb_entity INNER JOIN tb_hijack ON tb_= tb_hijack. Kind = tb_" _ & "WHERE tb_entity.entry='" & strline.Replace("'", "''") & "'" Else SQL = SQL & " OR tb_entity.entry='" & strline.What I am trying to do is set the Update Command in an Sql Data Source then update using that command.The event is firing okay, but when the event is done it appears that the row never updates. I didn't post the script because it kind of contains sensative information, I just wrote a poorly thought out example.Replace("'", "''") & "'" End If End If Also if i use that, then upon loading of the page, it executes the SELECT command w/c gets all the data from the sql db. user either input strings or upload a text file with strings to parse. page would read the strings from either text box or text file then do a SELECT FROM from the sql db what i would like is upon loading, it wouldn't query the sql db.
I need to get the control (dropdownlist and textbox) on these columns so that I could get their values to update SQL DB. Whois FROM tb_entity INNER JOIN tb_comments ON tb_= tb_comments. I think you're referring to Item template here.
I'm programmatically querying the db and i'm not using the smart tag of the gridview. Yes, i could see the controls in item template, but not in edititemtemplate.
Is there any way to get controls of the edit template? Here's my source code: " Select Command="SELECT tb_entity. that's why i don't know how to go about it.
This post has been edited by jpcsmit: 20 January 2010 - PM @eclipsed4utoo: Then you have not truly delved into Grid Views, grasshopper.
Using Template Fields in the Grid View Control Yes there is, but that's a Bound Field, which means the user can't change the value in the Grid View.
Search for gridview rowupdating code in c:
For the user to be able to check the checkbox, it needs to be a Template Field.