คือว่าผมต้องการนำ data จาก Datagridview ไปใส่ใน sql server ซึ่งผม code ดังนี้
Code (VB.NET)
Dim connectionString As String = "Data Source=kitiwat\SQLEXPRESS;Initial Catalog=mydatabase;Persist Security Info=True;User ID=sa;Password=1234"
Dim sql As String = "SELECT * FROM ReAs"
Dim connection As New SqlConnection(connectionString)
Dim dataadapter As New SqlDataAdapter(sql, connection)
Dim ds As New DataSet()
connection.Open()
dataadapter.Fill(ds, "ReAs")
connection.Close()
DataGridView1.DataSource = ds
DataGridView1.DataMember = ("ReAs")
Dim iRowsInserted As Int32 = DataGridView1.Update(ds, sql)
MessageBox.Show("Data Saved")
แต่มันขึ้น error ว่า
Error 2 Too many arguments to 'Public Sub Update()'.