[Mono-devel-list] Using OleDB / Access database with Asp.Net

Daniel Morgan danielmorgan at verizon.net
Tue Jul 13 19:41:01 EDT 2004


See http://www.go-mono.com/ado-net.html ADO.NET stuff with Mono.

See http://www.go-mono.com/oledb.html about OleDb.

System.Data.OleDb requires libgda which can be found at
http://www.gnome-db.org/
You need to look at the System.Data.OleDb source code to see how to get
it to work.  

An alternative to OleDb is GDA# found in GTK#, but it requires libgda
too.  

If you're connecting to SQL Server 7/2000/2005, your best bet is
System.Data.SqlClient.
Otherwise, I would use System.Data.Odbc with unixODBC and FreeTDS.

-----Original Message-----
From: mono-devel-list-admin at lists.ximian.com
[mailto:mono-devel-list-admin at lists.ximian.com] On Behalf Of Tizio
Incognito
Sent: Tuesday, July 13, 2004 12:43 PM
To: Mono Develop List
Subject: [Mono-devel-list] Using OleDB / Access database with Asp.Net


Hi fellows,
in the end I'm having a running version of mono on my linux box. I'm 
very interested on Asp.Net porting, 'cause I'd like to share my windows 
webapps also under linux.

I use the XSP server. I got a simple asp.net page with some buttons and 
textboxes working.
First: are there problems with that? Maybe is better to use Apache and 
mod_mono? 'Cause if it's the same thing, then I'll keep on using XSP.

As you can understand, I think I'll never develop an app without a 
database on the backside. So, I first tried (just because I was curious)

a OleDB connection to a remote MSSQL, but that didn't, as specified in 
documentation, works.

So I tried a simpler OleDB connection to an access database file.. but 
also this one doesn't works.

Following are a few lines on my page:

private void Page_Load(object sender, System.EventArgs e)
        {
            // Put user code to initialize the page here
            OleDbConnection cn = new OleDbConnection();
            cn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0; 
Data Source=" + Server.MapPath("db.mdb");
            cn.Open();
            OleDbCommand cmd = new OleDbCommand("SELECT * FROM
tMedias",cn);
            OleDbDataAdapter da = new OleDbDataAdapter(cmd);
            DataSet ds = new DataSet();
            da.Fill(ds);
            this.DataGrid1.DataSource = ds;
            this.DataGrid1.DataBind();
            ...
            ...

Probably the provider is completely wrong: I refer, under VS/win to a 
Jet provider.. what do I have to use? If anyone have working samples...
:)

TIA,

--
T.I.



_______________________________________________
Mono-devel-list mailing list
Mono-devel-list at lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list




More information about the Mono-devel-list mailing list