I got error invalid column 'A1009'


string v11;
chk1 = "select Sno from Student where SID = "+ @smemno.Text.ToString();

SqlCommand ck1 = new SqlCommand(chk1, cn);
v11 = (string)ck1.ExecuteScalar();

what should i do please help me....

Most likely SID is a string so you need to change your code to

ch1 = "select Sno from Student where SID = '" + @smemno.Text + "'";

Notice the single tick marks ('). And there is no need to call ToString() on a text field.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.