如题~谢谢了~~~~
2 回答

富国沪深
TA贡献1790条经验 获得超9个赞
string sql = "select * from tablename where id = @id";
SqlConnection connection = new SqlConnection("数据库连接字符串");
SqlDataAdapter da = new SqlDataAdapter(sql, connection);
da.SelectCommand.Parameters.AddWithValue("@id", 1);
DataSet ds = new DataSet();
da.Fill(ds);
if (ds.Tables[0].Rows.Count > 0)
{
object[] array = ds.Tables[0].Rows[0].ItemArray;
}
- 2 回答
- 0 关注
- 678 浏览
添加回答
举报
0/150
提交
取消