ExecuteScalar 返回值的处理

 //ExecuteScalar 返回值的处理
            object o= SqlHelper.ExecuteScalar("server=.;Database=Northwind;uid=sa;pwd=sa", CommandType.Text, "select *from test1 where a=2");
            string s = "";
            if (o != null)
                s = o.ToString();
            else
                s=(string)o;
            MessageBox.Show(s);

你可能感兴趣的:(execute)