private string loadNumData()
{
conDB conDB01 = new conDB();
string conStr = conDB01.getConStr();
SqlConnection conn = new SqlConnection(conStr);
conn.Open();
SqlCommand cmd = new SqlCommand("dbo.SP_getNumImdata", conn);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add("@inDept", SqlDbType.VarChar).Value = lb_dept.Text;
cmd.Parameters.Add("@inUnit", SqlDbType.NVarChar).Value = lb_unit.Text;
SqlDataAdapter myAdapter = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
myAdapter.Fill(ds, "numData");
conn.Close();
if (ds.Tables["numData"].Rows.Count < 1)
{
return "No data";
}
else
{
return ds.Tables["numData"].Rows[0]["num"].ToString(); // ข้อมูลจาก store
}
}
ไม่มีความคิดเห็น:
แสดงความคิดเห็น