Click here to Skip to main content
15,918,108 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Sitemap problem...... Pin
Ramesh Swaminathan25-Apr-09 17:52
Ramesh Swaminathan25-Apr-09 17:52 
Questionhow to get a runtime connection to a grid Pin
ami_singh24-Apr-09 23:16
ami_singh24-Apr-09 23:16 
AnswerRe: ami i have answer to your question Pin
prakash_chhipa24-Apr-09 23:36
prakash_chhipa24-Apr-09 23:36 
QuestionNot getting values in cells of a DataGrid UpdateCommand (C#) Pin
princy1024-Apr-09 22:49
princy1024-Apr-09 22:49 
AnswerRe: Not getting values in cells of a DataGrid UpdateCommand (C#) Pin
Ramesh Swaminathan25-Apr-09 18:02
Ramesh Swaminathan25-Apr-09 18:02 
Questionproblem in editing in gridview Pin
prateekfgiet24-Apr-09 21:30
prateekfgiet24-Apr-09 21:30 
AnswerRe: problem in editing in gridview Pin
Ramesh Swaminathan25-Apr-09 18:13
Ramesh Swaminathan25-Apr-09 18:13 
AnswerRe: problem in editing in gridview Pin
Kaushal Arora26-Apr-09 19:29
Kaushal Arora26-Apr-09 19:29 
Hi,
What i think the problem is in the place where you refer to your control using Cells[index].Controls[1] and there would have been only one control and that too at position [0] not [1]. So try using the code like this as you do know the name of the control which you want to fetch using the code for updation purpose.


protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
//fetch datakey/primarykey for identifyning the row
string materialrecipt_no = Convert.ToString(GridView1.DataKeys[e.RowIndex].Value);
TextBox materialrecip_date = (TextBox)GridView1.Rows[e.RowIndex].FindControl("ControlName");
TextBox pqty = ((TextBox)GridView1.Rows[e.RowIndex].FindControl("ControlName"));
TextBox enterby = ((TextBox)GridView1.Rows[e.RowIndex].FindControl("ControlName"));
TextBox ptype = ((TextBox)GridView1.Rows[e.RowIndex].FindControl("ControlName"));
TextBox remark = ((TextBox)GridView1.Rows[e.RowIndex].FindControl("ControlName"));
SqlCommand com = new SqlCommand("update material_incoming set materialrecip_date='" + materialrecip_date.Text + "',pqty='" + pqty.Text + "',enterby='" + enterby.Text + "',ptype='" + ptype.Text + "',remark='" + remark.Text + "' where materialrecipt_no=" + materialrecipt_no + "", conn);
conn.Open();
cmd.ExecuteNonQuery();
conn.Close();
GridView1.EditIndex = -1;
//to go back to the previous position
// fetch and rebind the data.
BindGrid();


}

Please mark as answer if problem gets resolved.

Regards,
Kaushal Arora
Questionautomatic software update Pin
sarav8824-Apr-09 21:22
sarav8824-Apr-09 21:22 
AnswerRe: automatic software update Pin
Christian Graus25-Apr-09 11:25
protectorChristian Graus25-Apr-09 11:25 
QuestionProblem in Using Array. Please check my code Pin
Jagz W24-Apr-09 21:04
professionalJagz W24-Apr-09 21:04 
AnswerRe: Problem in Using Array. Please check my code Pin
Ramesh Swaminathan25-Apr-09 18:21
Ramesh Swaminathan25-Apr-09 18:21 
QuestionURL Encoding & Decoding ? Pin
Subin Alex24-Apr-09 20:30
Subin Alex24-Apr-09 20:30 
AnswerRe: URL Encoding & Decoding ? Pin
ami_singh24-Apr-09 23:18
ami_singh24-Apr-09 23:18 
GeneralRe: URL Encoding & Decoding ? Pin
Subin Alex25-Apr-09 1:58
Subin Alex25-Apr-09 1:58 
AnswerRe: URL Encoding & Decoding ? Pin
Ramesh Swaminathan25-Apr-09 18:42
Ramesh Swaminathan25-Apr-09 18:42 
Questionurl rewritting Pin
Anand Babu24-Apr-09 19:57
Anand Babu24-Apr-09 19:57 
AnswerRe: url rewritting Pin
Christian Graus24-Apr-09 20:10
protectorChristian Graus24-Apr-09 20:10 
QuestionAllotting Folders for storing images in asp.net2.0? Pin
Subin Alex24-Apr-09 19:44
Subin Alex24-Apr-09 19:44 
AnswerRe: Allotting Folders for storing images in asp.net2.0? Pin
Christian Graus24-Apr-09 20:11
protectorChristian Graus24-Apr-09 20:11 
GeneralRe: Allotting Folders for storing images in asp.net2.0? Pin
Subin Alex24-Apr-09 20:19
Subin Alex24-Apr-09 20:19 
QuestionLinq to sql problem Pin
ais0724-Apr-09 19:42
ais0724-Apr-09 19:42 
AnswerRe: Linq to sql problem Pin
SayreCC24-Apr-09 20:08
SayreCC24-Apr-09 20:08 
Questionchanging password Pin
Renasa24-Apr-09 19:29
Renasa24-Apr-09 19:29 
AnswerRe: changing password Pin
Christian Graus24-Apr-09 20:16
protectorChristian Graus24-Apr-09 20:16 

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.