PDA

View Full Version : binding to access database


texasjames
09-25-2004, 03:39 AM
why is this soooooo difficult?

ok...i've tried everything. i give up.
can anyone explain to me how to use the webmatrix accessdatasource control to bind to an access database so that it will work on a discountasp.net server???

i just can not get the connectionstring part to format without errors.

i've attempted:

<wmx:AccessDataSourceControl id="AccessDataSourceControl1" runat="server" ConnectionString="Provider=Microsoft.Jet.OleDB.4.0;Data Source="
& server.mappath("/data/mydadabase.mdb") & "UserId=Admin";></wmx:AccessDataSourceControl>

but when i save it it turns into the following garbage:

<wmx:AccessDataSourceControl id="AccessDataSourceControl1" runat="server" ConnectionString="Provider=Microsoft.Jet.OleDB.4.0;Data Source="
& ?;User permits.mdb?) server.mappath(?Data></wmx:AccessDataSourceControl>

all i'm trying to do is get my datasouce to connect to the database and use the webmatrix gridview to display my data.

texasjames

bruce
09-26-2004, 10:42 AM
Found this on the net,

http://www.123aspx.com/redir.aspx?res=27071

[b]quote:Originally posted by texasjames

why is this soooooo difficult?

ok...i've tried everything. i give up.
can anyone explain to me how to use the webmatrix accessdatasource control to bind to an access database so that it will work on a discountasp.net server???

i just can not get the connectionstring part to format without errors.

i've attempted:

<wmx:AccessDataSourceControl id="AccessDataSourceControl1" runat="server" ConnectionString="Provider=Microsoft.Jet.OleDB.4.0;Data Source="
& server.mappath("/data/mydadabase.mdb") & "UserId=Admin";></wmx:AccessDataSourceControl>

but when i save it it turns into the following garbage:

<wmx:AccessDataSourceControl id="AccessDataSourceControl1" runat="server" ConnectionString="Provider=Microsoft.Jet.OleDB.4.0;Data Source="
& ?;User permits.mdb?) server.mappath(?Data></wmx:AccessDataSourceControl>

all i'm trying to do is get my datasouce to connect to the database and use the webmatrix gridview to display my data.

texasjames

</blockquote id="quote"></font id="quote">

B.

DiscountASP.NET
http://www.DiscountASP.NET