0

hi,
I have a one que...
I have a login page and where i m making dropdown for the qualification(B.E.,mca,bca,B.Tech,M.tech,others)Collections in list..

Here for others value..
I have textbox1 so any pne can enter other value that is not in the dropdown...so in that case how i can pass insert query..if any one wants to enter C.A. in textbox...
Plz help
.....How i apply the query with condtion...

4
Contributors
3
Replies
4
Views
7 Years
Discussion Span
Last Post by crishjeny
0

Hello Pooja, Please show some effort or work.

Give me your pseudo code.

Please read the rules about homework.

0

Yes I am agree with finito. regarding your question, it's not that's much difficult. you can create your Insert statement dynamically by checking condition. For example you have two fields name and qualification(nullable) in your table. So your code may looks like

string strSQL = "";
strSQL = "Insert Into yourtable Values('" + txtName.Text + "',";
If (dropdown1.SelectedItem.Value.Equals("value of your Other option in dropdown"))
{
strSQL += "'" + txtOther.Text + "')";
}
else
{
strSQL += "'" + dropdown1.SelectedItem.Value.ToString() + "')";
}
then pass this strSQL to your command object and execute the query.

Hope it will help you :-)

hi,
I have a one que...
I have a login page and where i m making dropdown for the qualification(B.E.,mca,bca,B.Tech,M.tech,others)Collections in list..

Here for others value..
I have textbox1 so any pne can enter other value that is not in the dropdown...so in that case how i can pass insert query..if any one wants to enter C.A. in textbox...
Plz help
.....How i apply the query with condtion...

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.