I am developing windows application.
I want to find records which has a particular number which is entered in textbox.
and result is displayed in datagrid.
If the entered number didnt find in database it must be displayed msg.
i tried it like as below but not working.
qlConnection conn = new SqlConnection();
conn.ConnectionString = "Server=EBSERVER;UID=sa;Database=Airport-Clearance;";
//SqlConnection sqlconn = objcs.GetConnection();
//MessageBox.Show("Connected");
//sqlconn.Open();
//Do what ever
SqlDataAdapter filling = new SqlDataAdapter("select * from Airport where awb='" + txtawb.Text ,conn);
DataSet displaying = new DataSet();
conn.Open();
filling.Fill(displaying);
dataGrid1.DataSource = displaying.DefaultViewManager;
conn.Close();
Waiting for reply.
Warmest regards,
ASIF
can you explain what "not working" is? Does it throw any errors? or does it not return anything?
What is the datatype of your "awb" column in the airport table?
No comments:
Post a Comment