cmd.CommandType = CommandType.TableDirect ;
cmd.CommandType = CommandType.StoredProcedure ;
Unspecified error Invalid operation
try { OleDbCommand cmd = new OleDbCommand("byjobtitle", cnn); cmd.CommandType = CommandType.TableDirect ; OleDbParameter prm = new OleDbParameter("@jobtitle", OleDbType.VarChar, 20); prm.Direction = ParameterDirection.Input; prm.Value = "Owner"; cmd.Parameters.Add(prm); DataSet ds = new DataSet(); OleDbDataAdapter da = new OleDbDataAdapter(); da.SelectCommand = cmd; da.Fill(ds); return ds.Tables[0]; } catch (Exception ex) { return null; } finally { cnn.Close(); }
OleDbParameter prm = new OleDbParameter("jobtitle", OleDbType.VarChar, 20); cmd.CommandType = CommandType.StoredProcedure ;
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)