-
Primary key
Dear Experts
How to apply primary key on sno column in the following dataset
Code:
dim sql = "select * from employees"
Dim da As new SqlClient.SqlDataAdapter (sql,con)
'ds.Clear()
da.Fill(ds, "employees")
TextBox1.DataBindings.Add("text", ds.Tables("employees"), "sno")
TextBox2.DataBindings.Add("text", ds.Tables("employees"), "Name")
TextBox3.DataBindings.Add("text", ds.Tables("employees"), "City")
TextBox4.DataBindings.Add("text", ds.Tables("employees"), "Phone")
Please help
-
Re: Primary key
Normally, that would be done at the DataBase (when it was built).
-
Re: Primary key
Table employees has primary key on sno column, but when i use these codes it says there is no primary key.
Code:
Me.ds.Tables("employees").Rows.Find(Me.TextBox1.Text)
Me.BindingContext(ds.Tables("employees")).Position += 1