2
Answers

View data selected in textboxes

Marvin kakuru

Marvin kakuru

13y
1.6k
1
Hi all i am trying view various rows in a database table on various textboxes. below is the code im using

SqlConnection
string
SqlCommand
cn.Open();

string
textBox3.Text = s1.ToString();

textBox4.Text = s1.ToString();
textbox3 to view day and textbox4 to view date
any help will be highly apprieciated.
thanks


s1 = cmd.ExecuteScalar().ToString();
cmd = new SqlCommand(sql, cn);
sql = ("select day,date from Herdregistar where UIC like '%" + textBox1.Text + "%'");
cn = new SqlConnection("Data Source=KATOTO-PC;Initial Catalog =thyfarm;User ID=sa;Password=Kyozi");
Answers (2)