ASP.NET ADO ODBC connection to Filemaker

  • Thread starter Thread starter Marcus Olsson
  • Start date Start date
M

Marcus Olsson

Hi!

I've created an ordinary Win App and placed the following
code under a button:

=========================================
string sConnString = "Dsn=Bokning_new";

OdbcConnection oODBCConnection = new OdbcConnection();
oODBCConnection.ConnectionString = sConnString;
oODBCConnection.Open();

DataSet ds = new DataSet("myDataSet");

OdbcDataAdapter sqlDA = new OdbcDataAdapter("select *
from Bokning", oODBCConnection);

sqlDA.Fill(ds, "Bokning");
=========================================

and it works, but if I place it in an ASP.NET page it
crashes when I do the ".Fill". It says that "Connection
failed" (but in swedish).

Please help me to solve this! Why does it work in an
ordinary app and not in ASP? Is there a way to solve it?
I badly need to get data from this Filemaker DB from
ASP.NET.

Regards,
/Marcus
 
Hi,

What is the error you get?

Try changing your code to this...

sqlDA.Fill(ds);
ds.Tables[0].TableName = "Bokning";
 
Already solved.

When you been struggling for hours and just put a Q here
you find the solution!

I had to set upp the DSN as remote and 127.0.0.1 to get
it to work in ASP.

/M
 
Hi!
Thanks for your answer, the thing was that I had to set
up the DSN as Remote and to IP 127.0.0.1. I find it
strange that it's only when you use ASP and not an
ordinary WinApp that you have to to that, now it works
for both! (I thougt that if you were at the same machine
you didn't have to use the remote.)
Reghards
/M

-----Original Message-----
Hi,

What is the error you get?

Try changing your code to this...

sqlDA.Fill(ds);
ds.Tables[0].TableName = "Bokning";
-----Original Message-----
Hi!

I've created an ordinary Win App and placed the following
code under a button:

=========================================
string sConnString = "Dsn=Bokning_new";

OdbcConnection oODBCConnection = new OdbcConnection();
oODBCConnection.ConnectionString = sConnString;
oODBCConnection.Open();

DataSet ds = new DataSet("myDataSet");

OdbcDataAdapter sqlDA = new OdbcDataAdapter("select *
from Bokning", oODBCConnection);

sqlDA.Fill(ds, "Bokning");
=========================================

and it works, but if I place it in an ASP.NET page it
crashes when I do the ".Fill". It says that "Connection
failed" (but in swedish).

Please help me to solve this! Why does it work in an
ordinary app and not in ASP? Is there a way to solve it?
I badly need to get data from this Filemaker DB from
ASP.NET.

Regards,
/Marcus
.
.
 
Neil said:
Hi,

What is the error you get?

Try changing your code to this...

sqlDA.Fill(ds);
ds.Tables[0].TableName = "Bokning";
-----Original Message-----
Hi!

I've created an ordinary Win App and placed the following
code under a button:

=========================================
string sConnString = "Dsn=Bokning_new";

OdbcConnection oODBCConnection = new OdbcConnection();
oODBCConnection.ConnectionString = sConnString;
oODBCConnection.Open();

DataSet ds = new DataSet("myDataSet");

OdbcDataAdapter sqlDA = new OdbcDataAdapter("select *
from Bokning", oODBCConnection);

sqlDA.Fill(ds, "Bokning");
=========================================

and it works, but if I place it in an ASP.NET page it
crashes when I do the ".Fill". It says that "Connection
failed" (but in swedish).

Please help me to solve this! Why does it work in an
ordinary app and not in ASP? Is there a way to solve it?
I badly need to get data from this Filemaker DB from
ASP.NET.

Regards,
/Marcus
.
 
Back
Top