Click here to Skip to main content
15,891,033 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
I have done school management system project ,in this system student has to pay his fee in three terms .he had to pay his first term fees ,and he will come to pay his second term now if i select id from combo box it should display like this
"the first term fee has to be paid by ...."
how to do this(windows forms applications in c#.net,sql server2008r2 and it is desktop application )
i was try the following code but it display error
SQL
if ("select term_number from term_fee_details where admin_no='" + comboBox2.Text + "' and term_number='first term'")
                    {                        MessageBox.Show("First term fee has paid");                   }


thank you
Posted
Updated 31-Oct-14 1:23am
v3
Comments
Nathan Minier 30-Oct-14 7:38am    
Web Forms, MVC, something else...?
Member 11065510 30-Oct-14 7:39am    
web forms
ZurdoDev 30-Oct-14 7:50am    
Do you have a question?
BillWoodruff 30-Oct-14 8:29am    
It looks like you are trying to figure out how to access a database when a certain ID is selected in a ComboBox. Is that what you are trying to do ?
Member 11065510 31-Oct-14 6:27am    
no....but i dont know how to describe my requirement it too long

1 solution

sir, sorry to be rude but what kind of if condition is that? just a string? and we cant help you till you decide in which platform you are building your software. i request you re-frame your question to be able to get answered.
 
Share this answer
 
Comments
Member 11065510 31-Oct-14 7:25am    
SqlCommand firstterm = new SqlCommand("select termnumber from term_fee_details where termnumber='first term' and admin_no=('" + comboBox2.Text + "')");
if (firstterm.ExecuteNonQuery()== true)
{
MessageBox.Show("first term paid");
}
i was use this code also but it display error

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900