[Mono-devel-list] Using OleDB / Access database with Asp.Net
Tizio Incognito
tizioincognito at tiscali.be
Tue Jul 13 12:42:32 EDT 2004
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.
More information about the Mono-devel-list
mailing list