User Name Password Register
DaniWeb IT Discussion Community
All
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
Reply
Join Date: Sep 2004
Posts: 6
Reputation: macsgirl is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
macsgirl macsgirl is offline Offline
Newbie Poster

Solution Update statement in edit mode of datareader

  #1  
Sep 18th, 2004
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();

}
AddThis Social Bookmark Button
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb C# Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the C# Forum

All times are GMT -4. The time now is 10:50 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC