•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the C# section within the Software Development category of DaniWeb, a massive community of 426,894 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,370 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our C# advertiser: Programming Forums
Views: 6992 | Replies: 0
![]() |
•
•
Join Date: Sep 2004
Posts: 6
Reputation:
Rep Power: 0
Solved Threads: 0
Hi folks, I am building my update statement and was wondering if someone can help me with
what is between the *****************. So I can execute my update statement.
I would appreciate it. Any other information required please don't hesitate to send
me email.
private void DataGridUserManagementID_Update(object source,
System.Web.UI.WebControls.DataGridCommandEventArgs e)
{
string strUserID;
string strStoreID, strStore;
string strAccessLevelID, strAccessLevel;
string strUserName, strFullName;
string strReportToID, strReportTo;
// Declare Textboxes
// Gets the value of the key field of the row being updated
strUserID = ((Label)e.Item.FindControl("lblUserID")).Text;
strStoreID = ((DropDownList)(e.Item.FindControl("editStores"))).SelectedItem.Value;
strStore = ((DropDownList)(e.Item.FindControl("editStores"))).SelectedItem.Text;
strAccessLevelID = ((DropDownList)(e.Item.FindControl("editAccessLevels"))).SelectedItem.Value;
strAccessLevel = ((DropDownList)(e.Item.FindControl("editAccessLevels"))).SelectedItem.Text;
strReportToID = ((DropDownList)(e.Item.FindControl("editReportTo"))).SelectedItem.Value;
strReportTo = ((DropDownList)(e.Item.FindControl("editReportTo"))).SelectedItem.Text;
strUserName = ((TextBox)e.Item.FindControl("editUserName")).Text;
strFullName = ((TextBox)e.Item.FindControl("editFullName")).Text;
**************************
string commandString = "Update tbl_Users Set UserName = strUserName
FullName = strFullName
StoreID = strStoreID
AccessLevelID = strAccessLevelID
ReportToID= strReportToID
(where UserID = strUserID)";
ExecuteSQLStatement(commandString);
// Deselect Current Row for Editing
**************************
DataGridUserManagementID.EditItemIndex = -1;
BindData();
}
what is between the *****************. So I can execute my update statement.
I would appreciate it. Any other information required please don't hesitate to send
me email.
private void DataGridUserManagementID_Update(object source,
System.Web.UI.WebControls.DataGridCommandEventArgs e)
{
string strUserID;
string strStoreID, strStore;
string strAccessLevelID, strAccessLevel;
string strUserName, strFullName;
string strReportToID, strReportTo;
// Declare Textboxes
// Gets the value of the key field of the row being updated
strUserID = ((Label)e.Item.FindControl("lblUserID")).Text;
strStoreID = ((DropDownList)(e.Item.FindControl("editStores"))).SelectedItem.Value;
strStore = ((DropDownList)(e.Item.FindControl("editStores"))).SelectedItem.Text;
strAccessLevelID = ((DropDownList)(e.Item.FindControl("editAccessLevels"))).SelectedItem.Value;
strAccessLevel = ((DropDownList)(e.Item.FindControl("editAccessLevels"))).SelectedItem.Text;
strReportToID = ((DropDownList)(e.Item.FindControl("editReportTo"))).SelectedItem.Value;
strReportTo = ((DropDownList)(e.Item.FindControl("editReportTo"))).SelectedItem.Text;
strUserName = ((TextBox)e.Item.FindControl("editUserName")).Text;
strFullName = ((TextBox)e.Item.FindControl("editFullName")).Text;
**************************
string commandString = "Update tbl_Users Set UserName = strUserName
FullName = strFullName
StoreID = strStoreID
AccessLevelID = strAccessLevelID
ReportToID= strReportToID
(where UserID = strUserID)";
ExecuteSQLStatement(commandString);
// Deselect Current Row for Editing
**************************
DataGridUserManagementID.EditItemIndex = -1;
BindData();
}
![]() |
•
•
•
•
•
•
•
•
DaniWeb C# Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Similar Threads
- MultiLine TextBoxes in GridView edit mode (ASP.NET)
- 'Database is not in insert or edit mode' (Pascal and Delphi)
- Update statement (MySQL)
- Datagrid is not working that well in edit mode (ASP.NET)
- The Datagrid: How does one fill text boxes in edit mode with their original content? (ASP.NET)
- DataGrid: Edit mode, the index of a dropdownlist does not start at the right Value (ASP.NET)
Other Threads in the C# Forum
- Previous Thread: Help With Datagrid RE: Creating and Saving DropDownList ReportsToID
- Next Thread: How do I save an index to a particular index of a dropdownlist in a datagrid.


Linear Mode