Please I have a project and on one form is the database search parameters where SELECT username, password etc from databasename where value1= '"+text.text+"' etc and I need to pass the results into other text boxes in another form, how can I do this
This is the search form design:
This is the form where i what to display the result of search form:
This is the code i used in form 1
con.Open();
cmd = new SqlCommand("SELECT surname, firstname, Sex, phone, address, dob, nameofdoctor, doctorsreport, diagnosis, drugsprescribed FROM dbo.patient WHERE cardnumber='" + textBox1.Text + "' and dateofadmission='" + dateTimePicker1.Text + "' and dateofdischarge='" + dateTimePicker1.Text + "'", con);
sda = new SqlDataAdapter(cmd);
cmd.ExecuteNonQuery();
DataTable ds = new DataTable();
sda.Fill(ds);
Records rec = new Records(value, value1, value2, value3, value4, value5, value6, value7, value8, value9);
rec.ShowDialog();