日期:2014-05-18 浏览次数:21123 次
SqlDataReader dataReader = datacommand.ExecuteReader();
string productId = null;
string unitprice = null;
string quantity = null;
if (dataReader.Read())
{
productId = dataReader.GetString(1);
unitprice = dataReader.GetDecimal(2).ToString();
quantity = dataReader.GetInt16(3).ToString();
}
else
{
MessageBox.Show("找不到任何记录", "出错啦");
textBox1.Text = "";
}
textBox2.Text = productId;
textBox3.Text = unitprice;
textBox4.Text = quantity;