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


vijay antony43 reputationPosted Mar 2, 2010, 1:58 AM EST
{
sqlquary = sqlquary & "class";
}
regards
vijay
kiran kumarRank #3,110 · 461 reputationPosted Mar 2, 2010, 2:00 AM EST
string s = "";
s=string.Concat(sqlquary, "class");
mark the answer if it helps you
Vikas AhlawatRank #2,648 · 525 reputationPosted Mar 2, 2010, 2:03 AM EST
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.
Raaj KumarRank #7,836 · 233 reputationPosted Mar 2, 2010, 3:01 AM EST
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 AhlawatRank #2,648 · 525 reputationPosted Mar 2, 2010, 3:19 AM EST
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 KumarRank #7,836 · 233 reputationPosted Mar 2, 2010, 4:00 AM EST
I have tested this in windows forms application. I am attaching the sample code please check it.
Regards,
raaj
Vikas AhlawatRank #2,648 · 525 reputationPosted Mar 2, 2010, 4:23 AM EST
when i try in new window application then it is working.
Raaj KumarRank #7,836 · 233 reputationPosted Mar 2, 2010, 4:45 AM EST
Regards,
raaj
Vikas AhlawatRank #2,648 · 525 reputationPosted Mar 2, 2010, 4:10 PM EST
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.
Sam HobbsRank #107 · 20.5K reputationPosted Mar 3, 2010, 8:06 AM EST
sqlquary = string.Concat(sqlquary, "class");
You could use instead:
sqlquary += "class";