Results 1 to 3 of 3

Thread: Primary key

  1. #1

    Thread Starter
    Member
    Join Date
    Oct 2009
    Posts
    58

    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

  2. #2
    INXSIVE Bruce Fox's Avatar
    Join Date
    Sep 2001
    Location
    Melbourne, Australia
    Posts
    7,429

    Re: Primary key

    Normally, that would be done at the DataBase (when it was built).

  3. #3

    Thread Starter
    Member
    Join Date
    Oct 2009
    Posts
    58

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width