Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
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 30-Dec-12 21:28pm

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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.
  Permalink  
Comments
Atul Rokade at 31-Dec-12 11:06am
   
thnx tejas bro for reply but if u dont mind can u explain me coding wise ..thanx
Tejas Vaishnav at 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)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 504
1 Maciej Los 349
2 Kornfeld Eliyahu Peter 325
3 DamithSL 196
4 OriginalGriff 188
0 OriginalGriff 6,303
1 DamithSL 4,764
2 Maciej Los 4,306
3 Kornfeld Eliyahu Peter 3,914
4 Sergey Alexandrovich Kryukov 3,538


Advertise | Privacy | Mobile
Web02 | 2.8.141220.1 | Last Updated 31 Dec 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100