关于sql语句的参数问题
我用的是VS2005:设置参数的时候出错(菜鸟啊),SqlDbType这个东东在那个名称空间里呀?是在System.Data.SqlClient;这个空间里吗?
using System;
using System.Collections.Generic;
using System.Text;
using System.Data.SqlClient;
namespace _5NIITSN3期末项目{
class DataBaseConnection
{
string sqlString;
DataBaseConnection(string sqlString,string types,string data,string keys,string grade )
{
SqlConnection conn = new SqlConnection( "server=.;database=play;user=sa;pwd=13303335812 ");
this.sqlString = sqlString;
SqlCommand comm = new SqlCommand(this.sqlString, conn);
comm.sParameters.Add(new SqlParameter( "@type ", SqlDbType.NChar, 10));
comm.Parameters.Add(new SqlParameter( "@datas ", SqlDbType.NChar, 10));
comm.select ////就是这里出错,那个SqlDbType,提示当前上下文中不存在SqlDbType
}
}
}
------解决方案--------------------using System.Data;