Click here to Skip to main content
15,892,809 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
iam writing
Auto Saving DataGridView Rows to a SQL Server Database[^] ia writing this code in my ado.net form but it give me error on sda.Update(lastdatarow); this line that is The best overloaded method match for 'System.Data.Common.DbDataAdapter.Update(System.Data.DataRow[])' has some invalid arguments and cannot convert from 'System.Data.DataRow' to 'System.Data.DataRow[]' how can i solve this actually im binding two tables in one datagridview
Posted

1 solution

As your error says your are trying to pass only one row, but that method you called
"System.Data.Common.DbDataAdapter.Update" is accepting data row array as its parameter value. so first of all try to pass array of data row. then try to debug your code line by line and find out any other issue is there or not.

if you want to update only one row then create array with only one element. or you want to update multiple row then add as much row as you want to update in that data row array and pass it to your method.
 
Share this answer
 
Comments
Atul Rokade 31-Dec-12 11:06am    
thnx tejas bro for reply but if u dont mind can u explain me coding wise ..thanx
Tejas Vaishnav 1-Jan-13 3:01am    
Please put your bit of code, so i can modify that.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900