Below code is working fine. but when i enter the next value it was showing the previous value only. Please help me in this regard.
Code:
Try
con.Open()
param.ParameterName = "@uname"
param.Value = TextBox2.Text
cmd = New SqlCommand("select * from customer where custname=@uname", con)
cmd.Parameters.AddWithValue("@uname", TextBox2.Text)
da = New SqlDataAdapter(cmd)
da.Fill(ds)
TextBox1.Text = ds.Tables(0).Rows(0).Item(0)
TextBox2.Text = ds.Tables(0).Rows(0).Item(1)
TextBox4.Text = ds.Tables(0).Rows(0).Item(3)
TextBox5.Text = ds.Tables(0).Rows(0).Item(5)
DateTimePicker1.Value = ds.Tables(0).Rows(0).Item(4)
TextBox3.Text = ds.Tables(0).Rows(0).Item(2)
Catch ex As Exception
MsgBox(ex.Message.ToString)
End Try
con.Close()
Comment