0

i am currently working on a survey project and the answer should be something like that
Poor,Average,Good,Very Good,Excellent
and their value will be 1 2 3 4 5.
but i can't bind them into my database,
the questions show using datalist, and i got no idea how to fix this..
please help me...:S


thanks & regards
WS

3
Contributors
3
Replies
4
Views
6 Years
Discussion Span
Last Post by __avd
0

Please Give some more details about ur Question

i got 3 datasource in my page
which is sdsQuestion,sdsSupplier and sdsAnswer
my question will be a single question for many suppliers,
sdsQuestion and sdsSupplier is to display data from my mysql database.
and the radiobuttonlist above 1,2,3,4,5(values)
i need someway to insert selectvalue into my sdsAnswer

0

>i need someway to insert selectvalue into my sdsAnswer

I presume that table sdsAnswer has three columns - answer_id, answer_date, and user_answer.

Code should be.

string sql="insert into sdsAnswer values (?answer_id,?answer_date,?user_answer)";
 MySqlConnection conn=new MySqlConnection("your_connection_string");
 MySqlCommand cmd = new MySqlCommand(query, conn);
 cmd.Parameters.Add("?answer_id",TextBox1.Text);
 cmd.Parameters.Add("?answer_date",DateTime.Now);
 cmd.Parameters.Add("?user_answer",RadioButtonList1.SelectedValue);
 conn.Open();
 cmd.ExecuteNonQuery();
 conn.Close();
This topic has been dead for over six months. 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.