EDN Admin
Well-known member
Hello friends,
I want to update my dataset to the database and my code is as follows.
<span style="font-family:arial,sans-serif; font-size:13px; line-height:normal Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As<br style="font-family:arial,sans-serif; font-size:13px; line-height:normal
<span style="font-family:arial,sans-serif; font-size:13px; line-height:normal System.EventArgs) Handles btnSave.Click<br style="font-family:arial,sans-serif; font-size:13px; line-height:normal
<span style="font-family:arial,sans-serif; font-size:13px; line-height:normal <br style="font-family:arial,sans-serif; font-size:13px; line-height:normal
<span style="font-family:arial,sans-serif; font-size:13px; line-height:normal Control Validation<br style="font-family:arial,sans-serif; font-size:13px; line-height:normal
<span style="font-family:arial,sans-serif; font-size:13px; line-height:normal <br style="font-family:arial,sans-serif; font-size:13px; line-height:normal
<span style="font-family:arial,sans-serif; font-size:13px; line-height:normal changeState(True)<br style="font-family:arial,sans-serif; font-size:13px; line-height:normal
<span style="font-family:arial,sans-serif; font-size:13px; line-height:normal inputEnabled(False)<br style="font-family:arial,sans-serif; font-size:13px; line-height:normal
<br style="font-family:arial,sans-serif; font-size:13px; line-height:normal
<span style="font-family:arial,sans-serif; font-size:13px; line-height:normal Dim dr As DataRow<br style="font-family:arial,sans-serif; font-size:13px; line-height:normal
<br style="font-family:arial,sans-serif; font-size:13px; line-height:normal
<span style="font-family:arial,sans-serif; font-size:13px; line-height:normal dr = ds.Tables(0).NewRow()<br style="font-family:arial,sans-serif; font-size:13px; line-height:normal
<span style="font-family:arial,sans-serif; font-size:13px; line-height:normal dr(0) = txtRollNo.Text<br style="font-family:arial,sans-serif; font-size:13px; line-height:normal
<span style="font-family:arial,sans-serif; font-size:13px; line-height:normal dr(1) = txtName.Text<br style="font-family:arial,sans-serif; font-size:13px; line-height:normal
<span style="font-family:arial,sans-serif; font-size:13px; line-height:normal dr(2) = txtClass.Text<br style="font-family:arial,sans-serif; font-size:13px; line-height:normal
<br style="font-family:arial,sans-serif; font-size:13px; line-height:normal
<span style="font-family:arial,sans-serif; font-size:13px; line-height:normal ds.Tables(0).Rows.Add(dr)<br style="font-family:arial,sans-serif; font-size:13px; line-height:normal
<br style="font-family:arial,sans-serif; font-size:13px; line-height:normal
<span style="font-family:arial,sans-serif; font-size:13px; line-height:normal cmd.Prepare()<br style="font-family:arial,sans-serif; font-size:13px; line-height:normal
<br style="font-family:arial,sans-serif; font-size:13px; line-height:normal
<span style="font-family:arial,sans-serif; font-size:13px; line-height:normal build = New SqlCommandBuilder(ada)<br style="font-family:arial,sans-serif; font-size:13px; line-height:normal
<br style="font-family:arial,sans-serif; font-size:13px; line-height:normal
<span style="font-family:arial,sans-serif; font-size:13px; line-height:normal If ada.Update(ds) > 1 Then Error cuses line<br style="font-family:arial,sans-serif; font-size:13px; line-height:normal
<span style="font-family:arial,sans-serif; font-size:13px; line-height:normal MessageBox.Show("Record Inserted")<br style="font-family:arial,sans-serif; font-size:13px; line-height:normal
<span style="font-family:arial,sans-serif; font-size:13px; line-height:normal End If<br style="font-family:arial,sans-serif; font-size:13px; line-height:normal
<br style="font-family:arial,sans-serif; font-size:13px; line-height:normal
<span style="font-family:arial,sans-serif; font-size:13px; line-height:normal End Sub
<span style="font-family:arial,sans-serif; font-size:13px; line-height:normal But this code showing following error :
<span style="font-family:arial,sans-serif; font-size:13px; line-height:normal
Dynamic SQL generation is not supported against a SelectCommand that does not return any base table information.<span style="font-family:arial,sans-serif; font-size:13px; line-height:normal <br/>
View the full article
I want to update my dataset to the database and my code is as follows.
<span style="font-family:arial,sans-serif; font-size:13px; line-height:normal Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As<br style="font-family:arial,sans-serif; font-size:13px; line-height:normal
<span style="font-family:arial,sans-serif; font-size:13px; line-height:normal System.EventArgs) Handles btnSave.Click<br style="font-family:arial,sans-serif; font-size:13px; line-height:normal
<span style="font-family:arial,sans-serif; font-size:13px; line-height:normal <br style="font-family:arial,sans-serif; font-size:13px; line-height:normal
<span style="font-family:arial,sans-serif; font-size:13px; line-height:normal Control Validation<br style="font-family:arial,sans-serif; font-size:13px; line-height:normal
<span style="font-family:arial,sans-serif; font-size:13px; line-height:normal <br style="font-family:arial,sans-serif; font-size:13px; line-height:normal
<span style="font-family:arial,sans-serif; font-size:13px; line-height:normal changeState(True)<br style="font-family:arial,sans-serif; font-size:13px; line-height:normal
<span style="font-family:arial,sans-serif; font-size:13px; line-height:normal inputEnabled(False)<br style="font-family:arial,sans-serif; font-size:13px; line-height:normal
<br style="font-family:arial,sans-serif; font-size:13px; line-height:normal
<span style="font-family:arial,sans-serif; font-size:13px; line-height:normal Dim dr As DataRow<br style="font-family:arial,sans-serif; font-size:13px; line-height:normal
<br style="font-family:arial,sans-serif; font-size:13px; line-height:normal
<span style="font-family:arial,sans-serif; font-size:13px; line-height:normal dr = ds.Tables(0).NewRow()<br style="font-family:arial,sans-serif; font-size:13px; line-height:normal
<span style="font-family:arial,sans-serif; font-size:13px; line-height:normal dr(0) = txtRollNo.Text<br style="font-family:arial,sans-serif; font-size:13px; line-height:normal
<span style="font-family:arial,sans-serif; font-size:13px; line-height:normal dr(1) = txtName.Text<br style="font-family:arial,sans-serif; font-size:13px; line-height:normal
<span style="font-family:arial,sans-serif; font-size:13px; line-height:normal dr(2) = txtClass.Text<br style="font-family:arial,sans-serif; font-size:13px; line-height:normal
<br style="font-family:arial,sans-serif; font-size:13px; line-height:normal
<span style="font-family:arial,sans-serif; font-size:13px; line-height:normal ds.Tables(0).Rows.Add(dr)<br style="font-family:arial,sans-serif; font-size:13px; line-height:normal
<br style="font-family:arial,sans-serif; font-size:13px; line-height:normal
<span style="font-family:arial,sans-serif; font-size:13px; line-height:normal cmd.Prepare()<br style="font-family:arial,sans-serif; font-size:13px; line-height:normal
<br style="font-family:arial,sans-serif; font-size:13px; line-height:normal
<span style="font-family:arial,sans-serif; font-size:13px; line-height:normal build = New SqlCommandBuilder(ada)<br style="font-family:arial,sans-serif; font-size:13px; line-height:normal
<br style="font-family:arial,sans-serif; font-size:13px; line-height:normal
<span style="font-family:arial,sans-serif; font-size:13px; line-height:normal If ada.Update(ds) > 1 Then Error cuses line<br style="font-family:arial,sans-serif; font-size:13px; line-height:normal
<span style="font-family:arial,sans-serif; font-size:13px; line-height:normal MessageBox.Show("Record Inserted")<br style="font-family:arial,sans-serif; font-size:13px; line-height:normal
<span style="font-family:arial,sans-serif; font-size:13px; line-height:normal End If<br style="font-family:arial,sans-serif; font-size:13px; line-height:normal
<br style="font-family:arial,sans-serif; font-size:13px; line-height:normal
<span style="font-family:arial,sans-serif; font-size:13px; line-height:normal End Sub
<span style="font-family:arial,sans-serif; font-size:13px; line-height:normal But this code showing following error :
<span style="font-family:arial,sans-serif; font-size:13px; line-height:normal
Dynamic SQL generation is not supported against a SelectCommand that does not return any base table information.<span style="font-family:arial,sans-serif; font-size:13px; line-height:normal <br/>
View the full article