asp.net访问 oracle数据库,代码如下:
string sqlStr = "select distinct ZKDM,CJSJ,YL,SSLL,LJLL from SZS_SS_ZSJ where zkdm = @jh";
OleDbConnection myConn = GetConnection();
myConn.Open();
OleDbCommand myCmd = new OleDbCommand(sqlStr, myConn);
myCmd.Parameters.AddWithValue("@jh",this.ddlJh.SelectedValue.ToString());
OleDbDataAdapter myDa = new OleDbDataAdapter(myCmd);
DataSet myDs = new DataSet();
myDa.Fill(myDs);
GridView1.DataSource = myDs;
GridView1.DataBind();
myDa.Dispose();
myDs.Dispose();
myConn.Close();
使用Parameters.AddWithValue传递参数,为什么不成功?