Tracing ADO.NET and ODBC

K

KMILO

Hello There,

Im recently implementing some app that provides connectivity with asp.net
and unify dataserver, these transactions reports sintax errors, so I wanna
see these error verbose, the connectivity is only possible throw odbc im
using ado.net objects for odbc, I put the odbc tracer on into my odbc data
sources and NOTHING appears, so I was thinking if somebody knows how can I
trace these transactions over ADO.NET is that possible?

Thanks in advance and forgive my poor english :s


KMILO
 
K

KMILO

this is the code and the error that appears when I executed, I want to make a more extensive trace of this error with ado or ODBC, I was trying to make a odbc tracing and nothing appears, any ideas??

Thanks in advance


public bool fncClientePorIDyClave(string IdCliente,string Password)
{
DataSet objDS = new DataSet(); //Dataset object is Instanced
bool ExistErrors = true; //assigns a true value on a boolean variable, this variable checks the function's answer
OdbcCommand odbcComm = new OdbcCommand(); // OdbcCommand object is Instanced
OdbcParameter odbcParam;
odbcParam = new OdbcParameter("idcliente",System.Data.Odbc.OdbcType.Char); //the parameter called idcliente of type char is assigned
odbcParam.Value = IdCliente; //parameter value assignment
odbcParam.Direction = ParameterDirection.Input; //parameter direction
odbcComm.Parameters.Add(odbcParam);
odbcParam = null;
odbcParam = new OdbcParameter("password",System.Data.Odbc.OdbcType.Char); // the parameter called password of type char is assigned
odbcParam.Value = Password; // parameter value assignment
odbcParam.Direction = ParameterDirection.Input; // parameter direction
odbcComm.Parameters.Add(odbcParam);
odbcParam = null;
odbcComm.CommandText = "pos.ClientePassword"; //The Store procedure name is given
odbcComm.CommandType = CommandType.StoredProcedure; //this object describes the command type to execute
OdbcConnection OdbcConn = new OdbcConnection("connection string with unify");//Object connection instanced
try
{
odbcComm.Connection = OdbcConn; //Object connection of odbcCommand instanced based on odbcConnection object
OdbcDataAdapter odbcDA = new OdbcDataAdapter(odbcComm); // OdbcDataAdapter is instanced by sending like parameter the OdbcCommand object
OdbcConn.Open(); //The data base has been opened
odbcDA.Fill(objDS); //The OdbcDataAdapter object fills the dataset with the possible results of the transaction
OdbcConn.Close(); //the data base has been closed
}
catch(OdbcException ERRcaught) //Errors catching section if any error appears this match will assign a false value to the result boolean variable
{
if(ERRcaught.Errors.Count > 0)
{
ExistErrors = false;
}
GC.Collect(); //the Garbage Collector is invoked for freeing memory purposes
}
finally
{
GC.Collect(); // the Garbage Collector is invoked for freeing memory purposes
}
return ExistErrors; //Returns the boolean variable answer of the funcion }

After all of this process, the function returns the following error in the catch section:
"ERROR [42000] [Unify][UnifyClient ODBC Driver][UnifyClient][UnifyLNA][Unify][Unify DataServer ODBC Driver][Unify DataServer]Syntax error in SQL dynamic statement. (1060)"
 
C

Cor Ligthert [MVP]

Kmilo,

Sorry I had sent the wrong answer. I have few information from you to give you a real answer, however one trick to see adonet errors in ASPNET is

try{'do whatever adonet action}
catch (Exception ex){
response.redirect(ex.ToString());}

I hope this helps,

Cor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top