int no = FormView1.PageIndex;
Run Code Online (Sandbox Code Playgroud)
查询: -
SqlCommand cmd = new SqlCommand("select Answer from Questions where QuestionNo = @no", cn);
Run Code Online (Sandbox Code Playgroud)
你必须添加一个参数:
int no = FormView1.PageIndex;
SqlCommand cmd =
new SqlCommand("select Answer from Questions where QuestionNo = @no", cn);
// Set the parameter up before executing the command
cmd.Parameters.Add("@no", SqlDbType.Int);
cmd.Parameters["@no"].Value = no;
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2747 次 |
| 最近记录: |