将nvarchar值转换为数据类型int

时间:2015-08-25 04:17:24

标签: c# sql-server winforms

这里有什么错误?我收到了一个错误。但是lblStage获得了舞台价值。但错误来了。

try
{
    SqlCommand cmd = new SqlCommand("Select distinct (stage) from tblStatus where EstimateID=@EstimateID", con);
    cmd.Parameters.AddWithValue("EstimateID", listEstimateID.Text);
    lblStage.Text = cmd.ExecuteScalar().ToString();
}
catch (Exception exc)
{
    MessageBox.Show(exc.Message);
}

0 个答案:

没有答案