Hi Friends,
After making the ADO.Net connection, when i am trying to fetch the s_name value based on the input from textbox using below query. I am getting object reference null error. Can anybody identify what actually is the flaw in the below code
string @searchValue = txtStudentName.Text;
string sql = "SELECT * FROM Student_Detail where s_name=@searchValue";
No record is coming in sql object.
SqlCommand cmd = new SqlCommand(sql, connection);

Ravi PatelRank #439 · 5.7K reputationPosted Nov 3, 2015, 5:41 AM EST
Upendra Pratap ShahiRank #329 · 7.5K reputationPosted Nov 3, 2015, 6:40 AM EST
Krishna Rajput SinghRank #605 · 4K reputationPosted Nov 3, 2015, 6:41 AM EST
Sumit Dwivedi8 reputationPosted Nov 3, 2015, 11:56 PM EST
Rojalin SahooRank #2,919 · 493 reputationPosted Nov 15, 2015, 7:07 PM EST