Hi,
I try to call a stored procedure with oledb provider in c#.
the procedure declaration in pervasive is as follows:
CREATE PROCEDURE GET_LICENSES(IN :CHANGED_AFTER TIMESTAMP,IN :IS_ANNUAL BIT,IN :IS_BAKARAT_NEHAGIM BIT,IN :IS_TEUDAT_LIVUY BIT)
This LICENSESSelectCommand works fine in Odbc:
this.LICENSESSelectCommand.CommandText = "{CALL GET_LICENSES( ?, ?, ?, ? )}";
this.LICENSESSelectCommand.CommandType = System.Data.CommandType.StoredProcedure;
this.LICENSESSelectCommand.Connection = con;
this.LICENSESSelectCommand.Parameters.Add(new System.Data.Odbc.OdbcParameter(":CHANGED_AFTER", System.Data.Odbc.OdbcType.DateTime,14));
this.LICENSESSelectCommand.Parameters.Add(new System.Data.Odbc.OdbcParameter(":IS_ANNUAL", System.Data.Odbc.OdbcType.Bit, 2));
this.LICENSESSelectCommand.Parameters.Add(new System.Data.Odbc.OdbcParameter(":IS_BAKARAT_NEHAGIM", System.Data.Odbc.OdbcType.Bit, 2));
this.LICENSESSelectCommand.Parameters.Add(new System.Data.Odbc.OdbcParameter(":IS_TEUDAT_LIVUY", System.Data.Odbc.OdbcType.Bit, 2));
however, converting the code to use OleDb provider always throws some exception which I suspect is because stored procedure definition cannot accept there OleDbTypes correctly, or the parameter size should be changed.
this.LICENSESSelectCommand.CommandText = "{CALL GET_LICENSES( ?, ?, ?, ? )}";
this.LICENSESSelectCommand.CommandType = System.Data.CommandType.StoredProcedure;
this.LICENSESSelectCommand.Connection = con;
this.LICENSESSelectCommand.Parameters.Add(new System.Data.OleDb.OleDbParameter(":CHANGED_AFTER", System.Data.OleDb.OleDbType.DBTimeStamp,14));
this.LICENSESSelectCommand.Parameters.Add(new System.Data.OleDb.OleDbParameter(":IS_ANNUAL", System.Data.OleDb.OleDbType.Boolean,2));
this.LICENSESSelectCommand.Parameters.Add(new System.Data.OleDb.OleDbParameter(":IS_BAKARAT_NEHAGIM", System.Data.OleDb.OleDbType.Boolean,2));
this.LICENSESSelectCommand.Parameters.Add(new System.Data.OleDb.OleDbParameter(":IS_TEUDAT_LIVUY", System.Data.OleDb.OleDbType.Boolean,2));
Help, I'm loosing my mind here for days....
OleDb DtaAdapter wizard also not working in VS .NET 2003 (ODBC works not perfectly, but works).
Thanx,
Amit
I try to call a stored procedure with oledb provider in c#.
the procedure declaration in pervasive is as follows:
CREATE PROCEDURE GET_LICENSES(IN :CHANGED_AFTER TIMESTAMP,IN :IS_ANNUAL BIT,IN :IS_BAKARAT_NEHAGIM BIT,IN :IS_TEUDAT_LIVUY BIT)
This LICENSESSelectCommand works fine in Odbc:
this.LICENSESSelectCommand.CommandText = "{CALL GET_LICENSES( ?, ?, ?, ? )}";
this.LICENSESSelectCommand.CommandType = System.Data.CommandType.StoredProcedure;
this.LICENSESSelectCommand.Connection = con;
this.LICENSESSelectCommand.Parameters.Add(new System.Data.Odbc.OdbcParameter(":CHANGED_AFTER", System.Data.Odbc.OdbcType.DateTime,14));
this.LICENSESSelectCommand.Parameters.Add(new System.Data.Odbc.OdbcParameter(":IS_ANNUAL", System.Data.Odbc.OdbcType.Bit, 2));
this.LICENSESSelectCommand.Parameters.Add(new System.Data.Odbc.OdbcParameter(":IS_BAKARAT_NEHAGIM", System.Data.Odbc.OdbcType.Bit, 2));
this.LICENSESSelectCommand.Parameters.Add(new System.Data.Odbc.OdbcParameter(":IS_TEUDAT_LIVUY", System.Data.Odbc.OdbcType.Bit, 2));
however, converting the code to use OleDb provider always throws some exception which I suspect is because stored procedure definition cannot accept there OleDbTypes correctly, or the parameter size should be changed.
this.LICENSESSelectCommand.CommandText = "{CALL GET_LICENSES( ?, ?, ?, ? )}";
this.LICENSESSelectCommand.CommandType = System.Data.CommandType.StoredProcedure;
this.LICENSESSelectCommand.Connection = con;
this.LICENSESSelectCommand.Parameters.Add(new System.Data.OleDb.OleDbParameter(":CHANGED_AFTER", System.Data.OleDb.OleDbType.DBTimeStamp,14));
this.LICENSESSelectCommand.Parameters.Add(new System.Data.OleDb.OleDbParameter(":IS_ANNUAL", System.Data.OleDb.OleDbType.Boolean,2));
this.LICENSESSelectCommand.Parameters.Add(new System.Data.OleDb.OleDbParameter(":IS_BAKARAT_NEHAGIM", System.Data.OleDb.OleDbType.Boolean,2));
this.LICENSESSelectCommand.Parameters.Add(new System.Data.OleDb.OleDbParameter(":IS_TEUDAT_LIVUY", System.Data.OleDb.OleDbType.Boolean,2));
Help, I'm loosing my mind here for days....
OleDb DtaAdapter wizard also not working in VS .NET 2003 (ODBC works not perfectly, but works).
Thanx,
Amit