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

Recommended Answers

All 3 Replies

Please Give some more details about ur Question

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

>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();
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.