Click here to Skip to main content
13,148,214 members (50,515 online)
Rate this:
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 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 20:28pm

1 solution

Rate this: bad
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.
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)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web04 | 2.8.170924.2 | Last Updated 31 Dec 2012
Copyright © CodeProject, 1999-2017
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