Click here to Skip to main content
15,916,180 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Print dialog without postback Pin
Vasudevan Deepak Kumar6-Mar-07 9:18
Vasudevan Deepak Kumar6-Mar-07 9:18 
QuestionURGENT need help Pin
Ahmed EL Gendy6-Mar-07 3:38
Ahmed EL Gendy6-Mar-07 3:38 
AnswerRe: URGENT need help Pin
badgrs6-Mar-07 4:08
badgrs6-Mar-07 4:08 
AnswerRe: URGENT need help Pin
szukuro6-Mar-07 5:11
szukuro6-Mar-07 5:11 
AnswerRe: URGENT need help Pin
Vasudevan Deepak Kumar6-Mar-07 9:19
Vasudevan Deepak Kumar6-Mar-07 9:19 
Questionselected dates Pin
Oga M6-Mar-07 3:09
Oga M6-Mar-07 3:09 
AnswerRe: selected dates Pin
Sylvester george6-Mar-07 3:19
Sylvester george6-Mar-07 3:19 
QuestionEditing Datagrid Pin
Member 38935606-Mar-07 2:58
Member 38935606-Mar-07 2:58 
Hey there,
I am trying to edit a datagrid. Whenever I click the edit button the grid enters edit mode. But when I change the text in the textbox and click the update(link button) the textbox always goes back to the previous text that was in it.
How do I extract the text from the textbox in the datagrid without losing my change.
below is my code for the update process:

public void Update_dgMilage(object sender, DataGridCommandEventArgs e)
{
TextBox StartMiles = new TextBox();
TextBox EndMiles = new TextBox();
TextBox PersonalMiles = new TextBox();
TextBox BusinessMiles = new TextBox();
TextBox TotalMiles = new TextBox();

StartMiles = (TextBox)e.Item.Cells[3].FindControl("txtStartMiles");
EndMiles = (TextBox)e.Item.Cells[4].FindControl("txtEndMiles");
PersonalMiles = (TextBox)e.Item.Cells[6].FindControl("txtPersonalMiles");
BusinessMiles = (TextBox)e.Item.Cells[7].FindControl("txtBusinessMiles");
TotalMiles = (TextBox)e.Item.Cells[8].FindControl("txtTotalMiles");


string connectionString = ConfigurationSettings.AppSettings["connectionString1"];
OracleConnection con = new OracleConnection(connectionString);
con.Open();

string SQLText = @"update appl_support.HSC_LEASED_CAR_MILES set RPE_MILE_START = '" + StartMiles.Text.ToString() + "', RPE_MILE_END = '" + EndMiles.Text.ToString() + "', PERSONAL_MILES = '" + PersonalMiles.Text.ToString() + "', BUSINESS_MILES = '" + BusinessMiles.Text.ToString() + "', TOTAL_MILES = '" + TotalMiles.Text.ToString() + "' where LCM_PKEY = '" + e.Item.Cells[1].Text.ToString() + "'"; //e.Item.Cells[1].Text.ToString()

// assign query and execute
OracleCommand cmd = new OracleCommand(SQLText,con);

cmd.ExecuteNonQuery();

con.Close();
con.Dispose();

//gets datagrid out of edit mode

dgMilage.EditItemIndex = -1;

getLeaseMilage();

}

Please Help anyone
AnswerRe: Editing Datagrid Pin
badgrs6-Mar-07 4:05
badgrs6-Mar-07 4:05 
AnswerRe: Editing Datagrid Pin
Vasudevan Deepak Kumar6-Mar-07 9:20
Vasudevan Deepak Kumar6-Mar-07 9:20 
QuestionCreate table Pin
leon266-Mar-07 2:43
leon266-Mar-07 2:43 
AnswerRe: Create table Pin
Vasudevan Deepak Kumar6-Mar-07 9:22
Vasudevan Deepak Kumar6-Mar-07 9:22 
QuestionCapturing the events of File Download Dialog Box Pin
Jijesh.V.R6-Mar-07 2:36
Jijesh.V.R6-Mar-07 2:36 
AnswerRe: Capturing the events of File Download Dialog Box Pin
badgrs6-Mar-07 4:07
badgrs6-Mar-07 4:07 
AnswerRe: Capturing the events of File Download Dialog Box Pin
Vasudevan Deepak Kumar6-Mar-07 9:22
Vasudevan Deepak Kumar6-Mar-07 9:22 
QuestionCrystal Report do show output when it is placed on IIS Pin
mohd imran abdul aziz6-Mar-07 1:36
mohd imran abdul aziz6-Mar-07 1:36 
AnswerRe: Crystal Report do show output when it is placed on IIS Pin
Sylvester george6-Mar-07 2:02
Sylvester george6-Mar-07 2:02 
GeneralRe: Crystal Report do show output when it is placed on IIS Pin
mohd imran abdul aziz6-Mar-07 2:16
mohd imran abdul aziz6-Mar-07 2:16 
GeneralRe: Crystal Report do show output when it is placed on IIS Pin
Sylvester george6-Mar-07 2:19
Sylvester george6-Mar-07 2:19 
AnswerRe: Crystal Report do show output when it is placed on IIS Pin
Vasudevan Deepak Kumar6-Mar-07 9:23
Vasudevan Deepak Kumar6-Mar-07 9:23 
GeneralRe: Crystal Report do show output when it is placed on IIS Pin
mohd imran abdul aziz6-Mar-07 16:34
mohd imran abdul aziz6-Mar-07 16:34 
QuestionNeed to keep track of SENT emails Pin
Atul Kharecha6-Mar-07 1:05
Atul Kharecha6-Mar-07 1:05 
AnswerRe: Need to keep track of SENT emails Pin
Eduard Keilholz6-Mar-07 1:57
Eduard Keilholz6-Mar-07 1:57 
QuestionMenu bars in asp.net........... Pin
Member 38798816-Mar-07 0:44
Member 38798816-Mar-07 0:44 
AnswerRe: Menu bars in asp.net........... Pin
Sandeep Akhare6-Mar-07 0:49
Sandeep Akhare6-Mar-07 0:49 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.