如題~謝謝了~~~~
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 關注
- 701 瀏覽
添加回答
舉報
0/150
提交
取消