S
starforce
Unregistered / Unconfirmed
GUEST, unregistred user!
代码如下:
string connString=ConfigurationSettings.AppSettings["ConnectionString"];
OleDbConnection conn = new OleDbConnection(connString);
string str1="SELECT * FROM books WHERE 图书编号=@tsbh";
OleDbCommand myCommand=new OleDbCommand(str1,conn);
myCommand.CommandType=CommandType.StoredProcedure;
OleDbParameter param=new OleDbParameter("@tsbh",OleDbType.Numeric,10);
OleDbDataAdapter dataAdapter = new OleDbDataAdapter (sqlstr,conn);
myCommand.Parameters.Add(param);
param.Direction=ParameterDirection.Input;
param.Value=Int32.Parse(this.TextBox6.Text);
DataSet dr=new DataSet();
dataAdapter.Fill(dr);
conn.Open();
this.DataGrid1.DataSource=dr;
this.DataGrid1.DataBind();
conn.Close();
运行出错,请教高手!!!
string connString=ConfigurationSettings.AppSettings["ConnectionString"];
OleDbConnection conn = new OleDbConnection(connString);
string str1="SELECT * FROM books WHERE 图书编号=@tsbh";
OleDbCommand myCommand=new OleDbCommand(str1,conn);
myCommand.CommandType=CommandType.StoredProcedure;
OleDbParameter param=new OleDbParameter("@tsbh",OleDbType.Numeric,10);
OleDbDataAdapter dataAdapter = new OleDbDataAdapter (sqlstr,conn);
myCommand.Parameters.Add(param);
param.Direction=ParameterDirection.Input;
param.Value=Int32.Parse(this.TextBox6.Text);
DataSet dr=new DataSet();
dataAdapter.Fill(dr);
conn.Open();
this.DataGrid1.DataSource=dr;
this.DataGrid1.DataBind();
conn.Close();
运行出错,请教高手!!!