Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to use connection.GetSchema()?

174 views
Skip to first unread message

kenn.minear

unread,
Jan 7, 2010, 4:44:12 PM1/7/10
to
Hello,

I need to use the connection object GetSchema method to
return the datatypes for all columns in a table. This is
part of the ADO.Net 2 specs, but I cannot find the method in
the ASE ADO.Net class. If Sybase doesn't support the
GetSchema method, could you give me some info on how to
replicate it (for example a query that uses system tables to
retrieve the same information, and would all users be able
to use that query?)

Regards, Kenn

Michael Garza

unread,
Jan 7, 2010, 11:10:38 PM1/7/10
to
Are you referencing Sybase.AdoNet2.AseClient.dll and not the older
Sybase.Data.AseClient.dll?

"kenn.minear" wrote in message news:4b4655ac.68...@sybase.com...

kenn.minear

unread,
Jan 8, 2010, 10:29:43 AM1/8/10
to
Hello, thank you for your response.

Yes, I am referencing Sybase.Data.AseClient.dll ... I did
not know that there was a Sybase.AdoNet2.AseClient package.
I will try to download it and try it out (assuming I can
find where to download it from). I downloaded the full
package on 12/18/2009 and it included the
Sybase.Data.AseClient, not the newer version.

Thanks again and regards, Kenn

kenn.minear

unread,
Jan 8, 2010, 12:43:33 PM1/8/10
to
Hello, Where can I find the download for
Sybase.AdoNet2.AseClient? I have searched the Sybase web
site and cannot locate it. Also, are there any other
dependicies (such as sybdrvado20.dll) that need to be
included?

Thanks, Kenn

kenn.minear

unread,
Jan 8, 2010, 2:02:58 PM1/8/10
to
Hello, well I found Sybase.AdoNet2.AseClient.dll and changed
the reference to the new dll in my project. I kept
sybdrvado20.dll in my bin path, but when I run my app I get
this exception:

System.IO.FileLoadException was unhandled
Message="Could not load file or assembly
'Sybase.AdoNet2.AseClient, Version=2.155.1000.0,
Culture=neutral, PublicKeyToken=95d94fac46c88e1e' or one of
its dependencies. The located assembly's manifest definition
does not match the assembly reference. (Exception from
HRESULT: 0x80131040)"

Obviously a DLL mismatch. I suspect sybdrvado20.dll.

Any ideas?

Regards and thanks for your help, Kenn

Paul Vero [Sybase]

unread,
Jan 12, 2010, 1:12:49 PM1/12/10
to
Hi Kenn,

What sort of application are you running here and please indicate exactly
how you deployed the DLLs.

Thank you,

-Paul

<kenn.minear> wrote in message news:4b478162.28b...@sybase.com...

kenn.minear

unread,
Jan 12, 2010, 1:28:43 PM1/12/10
to
Hi Paul,

In my bin directory I have Sybase.AdoNet2.AseClient.dll
(version 2.155.1000.0) and sybdrvado20.dll (version
2.155.1000.0).

I gave up on using GetSchema and instead query the
syscolumns table directly which works well for me, Sybase is
the only database I connect to that requires an explicit
conversion from integer to varchar, the six other databases
I connect to will do that implicitely.

My new error is when I try to load the AseDataAdapter, my
code is:

IDbDataAdapter idbAdapter = null;

idbAdapter =
(IDbDataAdapter)Activator.CreateInstance(typeof(Sybase.Data.AseClient.AseDataAdapter));


And the result is:

Could not load file or assembly 'Sybase.AdoNet2.AseClient,
Version=2.155.1000.0, Culture=neutral,
PublicKeyToken=95d94fac46c88e1e' or one of its dependencies.
The located assembly's manifest definition does not match
the assembly reference. (Exception from HRESULT: 0x80131040)

Should I open a new thread?

Regards, Kenn

Michael Garza

unread,
Jan 12, 2010, 1:59:11 PM1/12/10
to
There is another newsgroup posting called "Anyone tried using the
Sybase.AdoNet2.AseClient from ASP.NET?" which mentions that you need to
include the following DLLs along with sybdrvado20.dll. I've come to find
that we need to do this for our WinForms application as well.

msvcr80.dll
sybcsi_certicom_fips26.dll
sybcsi_core26.dll
sbgse2.dll


"kenn.minear" wrote in message news:4b4cbf5b.53d...@sybase.com...

Paul Vero [Sybase]

unread,
Jan 12, 2010, 2:04:26 PM1/12/10
to
Thank you Michael,

The newer releases require these DLLs. It's required for some security
functioanlity - so though
the DLLs need to be accessed and loaded they aren't used.

Sorry about missing that - still getting used to it myself.

So, Kenn, see if this helps in loading the Provider.

Are you using ASP.NET with IIS?

-Paul

"Michael Garza" <mikea...@gmail.com> wrote in message
news:4b4cc67f$1@forums-1-dub...

kenn.minear

unread,
Jan 12, 2010, 5:52:41 PM1/12/10
to
Hi, Yes I am using IIS and an ASP.Net application, also
using a standard WinForms application (using Gizmox
libraries to convert the WinForm app to an ASP.Net app).
Error occurs both under WinForms and under IIS. I will try
including the other dll's and follow up with a post on the
results.

Thanks for your response and help, regards, Kenn

kenn.minear

unread,
Jan 12, 2010, 5:54:29 PM1/12/10
to
Thanks Paul, I read that thread but haven't tried adding
those dll's yet. I will give it a try and follow up with a
post on the results.

Regards, Kenn

Matthew P. Seltzer

unread,
Jan 14, 2010, 4:23:58 PM1/14/10
to
I've tried using the GetSchema() method of the OLEDBConnection class in conjunction with the Sybase ASE OLEDB Provider to retrieve stored procedure definitions.  So far, no luck (the method call doesn't abend but the result is consistently an empty string).
<kenn.minear> wrote in message news:4b4655ac.68...@sybase.com...

Matthew P. Seltzer

unread,
Jan 14, 2010, 4:42:29 PM1/14/10
to
...just changed my code to reference the ADO.NET2 Sybase ASE dll and I am
able to invoke the GetSchema method directly. Still can't get the text of
the stored procedure to come back in my result set, tho'. :( Back to
querying the system tables....

<kenn.minear> wrote in message news:4b4655ac.68...@sybase.com...

Paul Vero [Sybase]

unread,
Jan 20, 2010, 2:04:46 PM1/20/10
to
Hi Matthew,

Waht exactly are you calling?

-Paul

"Matthew P. Seltzer" <msel...@fideliscare.org> wrote in message
news:4b4f8fc5$1@forums-1-dub...

Matthew P. Seltzer

unread,
Jan 20, 2010, 3:17:50 PM1/20/10
to
Hi, Paul,
I am calling the GetSchema() method of the ASEConnection object with the
parameter "Procedures." A DataTable gets returned. When I examine the
contents of the DataTable, I do not find the text of the stored procedure
definition in any of the columns (although other metadata is returned...just
not what I want/need.)

Thanks,

Regards,

Matt
"Paul Vero [Sybase]" <pv...@nospam.com> wrote in message
news:4b5753ce$1@forums-1-dub...

Paul Vero [Sybase]

unread,
Jan 25, 2010, 2:29:26 PM1/25/10
to
Hi Matthew,

The stored procedure mapped to this GetSchema call only returns the
procedure name. It won't return the text. If this is a requirement, you
could request a feature
enhancement. You can log a Sybase Tech Support case to make this request.

In your DataTable you do have a column containing procedure names, correct?

Thank you,

-Paul

"Matthew P. Seltzer" <msel...@fideliscare.org> wrote in message

news:4b5764ee$1@forums-1-dub...

Matthew P. Seltzer

unread,
Jan 26, 2010, 9:31:55 AM1/26/10
to
Thanks, Paul. According to what I've read, the MS SQL Server Native Client
will return the text of a stored procedure from a GetSchema() call. It all
comes down to what the OLE DB provider can or cannot do, I guess.

M.


"Paul Vero [Sybase]" <pv...@nospam.com> wrote in message

news:4b5df116@forums-1-dub...

Paul Vero [Sybase]

unread,
Jan 27, 2010, 12:57:20 PM1/27/10
to
Hi Matthew,

If you;d like you can open a case with Sybase Tech Support and request
an enhancement.

I thinK ASE stores sproc text in teh syscomments table or something like
that.
If the GetSchema call has a valid field to contain such data it might be
something
feasible. I recall vaguely long ago doing something like this for some
driver but it
was a long time ago and don't know if it ever got implemented.

I don't think we could do something like return parameters of a result set
from
a stored proc execution, but returning sproc text might be possible. In the
enhancement we could add
the fact that the MS Native client (ado.net provider?) supports this
capability.

Thank you,

-Paul

"Matthew P. Seltzer" <msel...@fideliscare.org> wrote in message

news:4b5efcdb$1@forums-1-dub...

kenn.minear

unread,
Jan 28, 2010, 10:37:13 AM1/28/10
to
Hi Paul,

I added the following DLL's to my bin;

msvcr80.dll sybcsi_certicom_fips26.dll sybcsi.core26.dll
sbgse2.dll

I tried loading the DataAdapter again and still get the same
error.

Looks like if I am to support Sybase ASE I cannot use the
DataAdapter in my code. Fortunately I can redesign the
parts of my app that make use of the adapter to use a more
traditional CRUD operatiion, or just drop Sybase support and
suggest any other product instead. It just depends on the
client needs.

Thanks for your help.

Regards, Kenn

0 new messages