-----------------------------------------------------------

New Message on BDOTNET

-----------------------------------------------------------
From: Akshit56491
Message 3 in Discussion

Hi,  I have some sample code of update method of the datagrid where u read the values 
from grid and put them in the dataset. Regards,Akshitprotected void 
DataGrid1_Update(Object sender, DataGridCommandEventArgs e)  {                // Gets 
the value of the key field of the row being updated     string key = 
DataGrid1.DataKeys[e.Item.ItemIndex].ToString();   // Finds the row in the dataset 
table that matches the          // one the user updated in the grid. This example uses 
a        // special Find method defined for the typed dataset, which     // returns a 
reference to the row.      DataRow dr= dataSet11.authors.FindByau_id(key); // Update 
the dataSet. Skip non data columns in data grid.      // Note use of generic index, 
not column names.         try     {                                               for 
(int i=NUM_LINK_COLUMNS; i<numCols; i++) //skip non data columns            {          
             String colvalue =((TextBox)e.Item.Cells[i].Controls[0]).Text;             
      dr[i-NUM_LINK_COLUMNS]= colvalue;               }               
sqlDataAdapter1.Update(dataSet11);              DataGrid1.EditItemIndex = -1; // leave 
user on edit if update fails     }       catch (Exception exc)   {               
debug= exc.Message;     }       // Refresh the grid     
ResetPageIndex(DataGrid1,view);         DataGrid1.DataBind();   textBoxMessage.Text= 
debug; } 

-----------------------------------------------------------

To stop getting this e-mail, or change how often it arrives, go to your E-mail 
Settings.
http://groups.msn.com/BDotNet/_emailsettings.msnw

Need help? If you've forgotten your password, please go to Passport Member Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help

For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact

If you do not want to receive future e-mail from this MSN group, or if you received 
this message by mistake, please click the "Remove" link below. On the pre-addressed 
e-mail message that opens, simply click "Send". Your e-mail address will be deleted 
from this group's mailing list.
mailto:[EMAIL PROTECTED]

Reply via email to