MS Access with ASP.NET

itschemistry

New Member
Greetings,<BR><BR>I am new to this new program, and would like to start with existing DB's in my webs can someone modify the following code to connect to an MS Access DB instead of SQL Server's demonstration...<BR><BR><%@ Import Namespace="System.Data" %><BR><%@ Import Namespace="System.Data.SqlClient" %><BR><BR><html><BR><script language="VB" runat="server"><BR><BR> Sub Page_Load(Sender As Object, E As EventArgs) <BR><BR> Dim DS As DataSet<BR> Dim MyConnection As SqlConnection<BR> Dim MyCommand As SqlDataAdapter<BR><BR> MyConnection = New SqlConnection("server=localhost;database=pubs;Trusted_Connection= yes")<BR> MyCommand = New SqlDataAdapter("select * from Authors", MyConnection)<BR><BR> DS = new DataSet()<BR> MyCommand.Fill(ds, "Authors")<BR><BR> MyDataGrid.DataSource=ds.Tables("Authors").DefaultView<BR> MyDataGrid.DataBind()<BR> End Sub<BR><BR></script><BR><BR><BR>Thanks in advance,<BR><BR>Timhttp://aspnet.4guysfromrolla.com/articles/032702-1.aspx<BR><BR>This has an example.That'sa what'I needed!<BR><BR>Thank you much...<BR><BR>Tim.
 
Back
Top