public string GetProductType(string connectionString, string barCode)
{
string productType;
SqlConnection conn = new SqlConnection(connectionString);
conn.Open();
//MessageBox.Show("连接成功");
string sqlCmd = "select 产品型号 from ProName where 壳体编号 = '"+ barCode + "'";
SqlCommand command = new SqlCommand(sqlCmd, conn);
SqlDataReader read = command.ExecuteReader();
if (read.Read())
{
productType = read["产品型号"].ToString();
conn.Close();
return productType;
}
}