[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.odbcnet

HELP Connection string to access with c#

a.b

6/3/2002 1:31:00 PM

i need to know what is the way to connect to access database WITH DSN, for
c# application.
thank u


5 Answers

(Hussein Abuthuraya(MSFT))

6/3/2002 9:54:00 PM

0

a.b

6/4/2002 12:31:00 PM

0

it not works because the odbc.net packages:
it returns System.io.FileNotFound.exception."Hussein Abuthuraya(MSFT)"
<HussAbOnline@microsoft.com> wrote in message
news:s6BZShzCCHA.2264@cpmsftngxa07...
> Hi,
>
> Here is an example:
>
> OdbcConnection con = new OdbcConnection("dsn=AccessNwindDSN;");
> OdbcCommand cmd = new OdbcCommand("select * from customers", con);
> OdbcDataAdapter da = new OdbcDataAdapter(cmd);
> DataSet ds = new DataSet();
>
> try
> {
> da.Fill(ds,"Customers");
> dataGrid1.DataSource = ds.Tables["Customers"];
> }
> catch (Exception ex)
> {
> MessageBox.Show(ex.Message);
> }
>
>
>
> Thanks,
> Hussein Abuthuraya
> Microsoft Developer Support
>
> This posting is provided "AS IS" with no warranties, and confers no
rights.
>
> Are you secure? For information about the Microsoft Strategic Technology
Protection Program and to order your FREE Security Tool Kit, please visit
> http://www.microsoft.co....
>


(Hussein Abuthuraya(MSFT))

6/4/2002 8:31:00 PM

0

Ah, I thought you are posting the question in the Odbc.Net newsgroup then you would have downloaded it at least. Here is a link to download the ODBC.NET Data Provider:

http://msdn.microsoft.com/downloads/sample.asp?url=/msdn-files/027/001/668/msdncompositedoc.xml&...

One more thing you need to do to run the previously posted code:
- Add reference to Odbc.Net to the project references
- add Imports statement in the general decleration area as:
Imports Microsoft.Data.Odbc
- Copy and paste the code
- Changes the dsn name to your dsn that you have created


Thanks,
Hussein Abuthuraya
Microsoft Developer Support

This posting is provided "AS IS" with no warranties, and confers no rights.

Are you secure? For information about the Microsoft Strategic Technology Protection Program and to order your FREE Security Tool Kit, please visit
http://www.microsoft.co....


a.b

6/5/2002 12:54:00 PM

0

it even not works!
the packages odbc.net not work with beta2
"Hussein Abuthuraya(MSFT)" <HussAbOnline@microsoft.com> wrote in message
news:io0F1X$CCHA.1956@cpmsftngxa07...
> Ah, I thought you are posting the question in the Odbc.Net newsgroup then
you would have downloaded it at least. Here is a link to download the
ODBC.NET Data Provider:
>
>
http://msdn.microsoft.com/downloads/sample.asp?url=/msdn-files/027...
sdncompositedoc.xml&frame=true
>
> One more thing you need to do to run the previously posted code:
> - Add reference to Odbc.Net to the project references
> - add Imports statement in the general decleration area as:
> Imports Microsoft.Data.Odbc
> - Copy and paste the code
> - Changes the dsn name to your dsn that you have created
>
>
> Thanks,
> Hussein Abuthuraya
> Microsoft Developer Support
>
> This posting is provided "AS IS" with no warranties, and confers no
rights.
>
> Are you secure? For information about the Microsoft Strategic Technology
Protection Program and to order your FREE Security Tool Kit, please visit
> http://www.microsoft.co....
>
>


(Hussein Abuthuraya(MSFT))

6/5/2002 9:58:00 PM

0

Can you describe what you have done so far and post your code?


Thanks,
Hussein Abuthuraya
Microsoft Developer Support

This posting is provided "AS IS" with no warranties, and confers no rights.

Are you secure? For information about the Microsoft Strategic Technology Protection Program and to order your FREE Security Tool Kit, please visit
http://www.microsoft.co....