473,396 Members | 1,833 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Sample needed

Hi

Is there a simple asp.net site with MS Access backend that I can use as a
learning example?

Thanks

Regards
Nov 18 '05 #1
1 915
The quickstart has examples for ado.net - Here is a bit of simple code to
get you started with something at least. Just create a DB in access 2000
(called database.mdb), put it in the same directory as the code and run the
code....cross your fingers and it might even work.

Take a look at the excellent example at w3schools
http://www.w3schools.com/aspnet/aspnet_dbconnection.asp

Have a look through the ADO samples here:
http://msdn.microsoft.com/library/de...us/vbcon/html/
vbwlkwalkthroughdisplayingdataingridinwebformspage .asp

--
Regards

John Timney
Microsoft Regional Director
Microsoft MVP

<%@ Page Language="VB"%>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.OleDb" %>

<script language="VB" runat="server">
Sub Page_Load(Src as object, E as EventArgs)

Dim objConnection As OleDbConnection
Dim objCommand As OleDbCommand
Dim objDataReader As OleDbDataReader
Dim strSQLQuery As String
objConnection = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;
Data Source=" & Server.MapPath("database.mdb") & ";")

strSQLQuery = "SELECT * FROM sample "

objCommand = New OleDbCommand(strSQLQuery, objConnection)

objConnection.Open()

objDataReader = objCommand.ExecuteReader(CommandBehavior.CloseConn ection)

resultsGrid.DataSource = objDataReader
resultsGrid.DataBind()

End Sub

</script>

<html>
<body>

<asp:DataGrid id="resultsGrid" runat="server"
cellspacing="1"
cellpadding="2"
HeaderStyle-Font-Bold="True"
ToolTip="This is Cool!"
MaintainViewState="false"
/>

</body>
</html>

Nov 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: kevin | last post by:
Hi, I believe there is a microsoft sample project that shows how to use VB and C# in the same project. Does anyone know were I can find it? I have some C# I want to use in my VB project. ...
1
by: Arni Snorri Eggertsson | last post by:
Hi there I was hoping to save some time and check if anyone would share their script to automate online backups using DB2 v8 on Windows and backing up to TSM. The part I am specially looking...
3
by: dkintheuk | last post by:
Hi everyone, I have a table with a set of accounts in that contains one row for each account for each time it has been audited. (this may not include every account we deal with) Each month I...
5
by: EMonaco | last post by:
All, Got this sample from a discussion on ICertificatePolicy. public enum CertificateProblem : long { CertEXPIRED = 0x800B0101, CertVALIDITYPERIODNESTING =...
4
by: Joey | last post by:
Does anyone know how to center this sample webpage in Firefox? If so, will you provide the example as it applies to this sample webpage? I have read numerous posts and articles on how to center...
2
by: sara | last post by:
Hi - I have been trying (for 2 days now) to make some simple surveys (5-7 questions each, each with 2-3 answer choices, always from the list) using Duane's sample. I've searched and searched...
6
by: =?Utf-8?B?cm9kY2hhcg==?= | last post by:
hey all, can someone please explain the advantages of interface-based programming? And then tell me what this is opposed to? thanks, rodchar
0
by: johnmott | last post by:
Hi all, I recently needed to compare versions of different DLL's to try to find the one most like a production version. There are a lot of ways and tools for this sort of thing, but what I...
0
by: Nolanclark | last post by:
Hi there. I've read a previous thread regarding the Old VB 6 checkbox array and how it's not really needed any more. That's fine, but I'm not really sure how to implement the checkbox control array...
0
by: msmithuk | last post by:
Hi, I am looking for the DSNTEP2 sample applications in DSN810.SDSNSAMP referred to in the DB2 UDB for z/OS Version 8 Application Programming and SQL Guide (SC18-7415) (see link below for...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.