关于数据读取的问题
SqlCommand cmd = new SqlCommand("select top 1 * from " + gs + " where 歌名 '" + gm + "'" , str);SqlDataReader sdr = null;
sdr = cmd.ExecuteReader();
if (sdr != null)
{if (sdr.Read())
{
gstextBox3.Text = sdr["格式"].ToString();
fgtextBox4.Text = sdr["风格"].ToString();
dztextBox5.Text = sdr["地址"].ToString();
bztextBox6.Text = sdr["备注"].ToString();
}}
我想问一下这样能将数据读到指定地方吗?我调试是出错了