SqlCommand cmd=new SqlCommand("select votetitle from[表名] where ID="+ID,conn)
string title=Convert.Tostring(cmd.ExecuteScalar())
Label1.Text=title
ExecuteScalar返回第一个单元格值
[color=red]如果用select count(*) from[表名][/color]
string title=Convert.Tostring(cmd.ExecuteScalar())
Label1.Text=title
ExecuteScalar返回第一个单元格值
[color=red]如果用select count(*) from[表名][/color]