How To Update A Column In A DataGrid Using C#.NET? I am getting InvalidCastException as (Specified cast is not valid) while updating 2nd column in a datagrid? Id,firstname,lastname are the three columns of my datagrid respectively. I wanted to edit the second column(lastname) and update it. I did the following code in DataGrid's updatecommand(),but failed to update ! Int varid=(int)DataGrid1.DataKeys[e.Item.ItemIndex]; TextBox lnm=(TextBox)e.Item.Cells[2].Controls[0]; string str=lnm.Text ; SqlCommand cmd=new SqlCommand("update customer set lastname='" + str + "' where id=" + varid + "",con); cmd.ExecuteNonQuery(); DataGrid1.EditItemIndex=- 1; DataGrid1.DataBind();
2 16275Post New Mind Tree ADO.NET Interview Questions
Define Job control?
Is not null mysql?
Define consumer textile?
Explain stress testing, load testing and volume testing?
Hi Friends... I faced an question in Tcs.But i unable to answer. find the question below.. A root filesytem"c0t0d0s0" caries 100 gb data. in this filesystem. i am having 3 files named a,b,c it caries 20 gb data each. I need to take backup only 3 files a,b,c. How i can take. Note you need to take only 3 files to an single tape having capacity 80 gb. Whats the commad used?
What are the different SQL Server Versions you have worked on?
What Is The Smallest Unit Of Execution In .net?
What is Apache Spark Streaming?
How to pass the data between view controllers?
How do you reset iis?
why we use dmr model in cognos report studio ? give me difference between dmr model and relational model.
How can you control the amount of free space in your index pages?
Explain about vb script?
What is operator overloading in python?
Explain for xml explicit mode?