Click here to Skip to main content
15,909,518 members

Comments by Member 10609511 (Top 27 by date)

Member 10609511 5-Mar-14 7:50am View    
Thank you this worked!! :)
Member 10609511 5-Mar-14 7:44am View    
I am getting no error in the C# code it runs properly without error and when I debug it the updated values from the textboxes are carried into the parameters it just isn't saving to the databsase
Member 10609511 26-Feb-14 15:55pm View    
Still no luck - when I used your c# code I got an error on:

comm1.ExecuteNonQuery();
-could not find the stored procedure

So I commented out this line of code and ran it again but still doesn't seem to save the updated textboxes from the webform in place of the original values....
Member 10609511 26-Feb-14 15:32pm View    
I have a solution that I have got working by incorporating this code with mine:

LinkButton l = e.CommandSource as LinkButton;
if(l != null)
{
GridViewRow selectedRow = l.NamingContainer as GridViewRow ;
if(selectedRow != null)
{
int intRowIndex = Convert.ToInt32(selectedRow.RowIndex);
}
}
Member 10609511 26-Feb-14 14:43pm View    
There Seems to be error in your code somewhere, the line:

string RowId = e.CommandArgument.["RowIndex"].ToString();

Gives the error: Identifier expected

Here is what I have in the asp code for gridview:

<itemtemplate>
<asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="false" CommandName="view" CommandArgument = ''<%#((GridViewRow)Container).RowIndex%>' + ';' + '<%#Eval("FileName")%>''>ViewFile


I found this elsewhere but not sure how to implement
ImageButton b = (ImageButton)sender;
GridViewRow row = (GridViewRow)b.NamingContainer;
if (row != null)
{
//Get the Row Index
int rowIndex = row.RowIndex;
//Get the DataKey value
string key = GridView1.DataKeys[rowIndex].Value.ToString();
//Get the Row value of BoundField
string rowValue = row.Cell[0].Text;


}