Private Sub frmCust_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
dbSource = "Data Source=xx-B4C521B850\SQLEXPRESS;Initial Catalog=TT;Integrated Security=True"
con.ConnectionString = dbSource
con.Open()
da.Dispose()
sql = "Select * from Cust"
da = New SqlClient.SqlDataAdapter(sql, con)
da.Fill(ds, "Cust")
da.Update(ds, "Cust")
con.Close()
MaxRows = ds.Tables("Cust").Rows.Count
inc = -1
End Sub
if after executing upper code the maxrows value is 10 after executing following code it becomes 21 how!!!!!!!!
Private Sub btnAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAdd.Click
con.Open()
sql = "INSERT INTO Cust (Cust_Fn,Cust_Ln,Cust_Address,Cust_Mob,Cust_Land,Cust_CLand) VALUES ('" & txtFn.Text & "','" & txtLn.Text & "','" & txtAddress.Text & "','" & txtMob.Text & "','" & txtLand.Text & "','" & chkLCo.CheckState & "')"
cmd = New SqlClient.SqlCommand(sql, con)
cmd.ExecuteNonQuery()
da.Update(ds, "Cust")
MsgBox("New Record added to the Database")
da.Fill(ds, "Cust")
con.Close()
MaxRows1 = ds.Tables("Cust").Rows.Count
inc = -1
End If
End Sub
PLS HELP