public static string sqlquary;
sqlquary = "Select * from Student_Fee_Payment_Detail where";
if (radioButton1.Checked == true)
{
sqlquary = sqlquary + "class";
}
MessageBox.Show(sqlquary);
how can i do under if statement. that it show effict.
Loading

Sam HobbsPosted Mar 3, 2010, 1:06 PM
sqlquary = string.Concat(sqlquary, "class");
You could use instead:
sqlquary += "class";
Vikas AhlawatPosted Mar 2, 2010, 9:10 PM
The problem in my project i m using checkbox and radiobutton both and in code i m using radiobutton which is not selected so it is giving this answer.
i always see checkbox.
So it is solved.
Thanks again.
Raaj KumarPosted Mar 2, 2010, 9:45 AM
Regards,
raaj
Vikas AhlawatPosted Mar 2, 2010, 9:23 AM
when i try in new window application then it is working.
Raaj KumarPosted Mar 2, 2010, 9:00 AM
I have tested this in windows forms application. I am attaching the sample code please check it.
Regards,
raaj
Vikas AhlawatPosted Mar 2, 2010, 8:19 AM
string sqlquary;
sqlquary = "Select * from Student_Fee_Payment_Detail where";
if (radioButton1.Checked == true)
{
sqlquary = string.Concat(sqlquary, "class");
}
MessageBox.Show(sqlquary);
this is not working for me.
messagebox only showing Select * from Student_Fee_Payment_Detail where
Raaj KumarPosted Mar 2, 2010, 8:01 AM
Try this,
sqlquary = "Select * from Student_Fee_Payment_Detail where";
if (RadioButton1.Checked == true)
{
sqlquary = string.Concat(sqlquary, "class");
}
This works for me.
Regards,
raaj
Vikas AhlawatPosted Mar 2, 2010, 7:03 AM
i know s=string.Concat(sqlquary, "class"); and &
my problem is that if i con... string under if statement then it give no result, and if i do same outside the if statement that it working.
kiran kumarPosted Mar 2, 2010, 7:00 AM
string s = "";
s=string.Concat(sqlquary, "class");
mark the answer if it helps you
vijay antonyPosted Mar 2, 2010, 6:58 AM
{
sqlquary = sqlquary & "class";
}
regards
vijay