ksilvoso
asked on
Access Database with Visual Web developer
I have just started using visual web developer and have created an access database called computerswaps.mdb.
I can get the data to display online but can't figure out how to input data to the database from the web interface. All I have in the web site now are two pages:
default.aspx which is my actual web page
web.config
Here are the contents of default.aspx
<%@ Page Language="C#" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>DAH Computers</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<br />
<strong><span style="font-size: 24pt">Department of Arkansas Heritage Computers<br />
</span></strong>
<br />
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:computer _swapsConn ectionStri ng %>"
ProviderName="<%$ ConnectionStrings:computer _swapsConn ectionStri ng.Provide rName %>"
SelectCommand="SELECT * FROM [Computers] ORDER BY [Old PC Name]"></asp:SqlDataSource >
</div>
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False " CellPadding="7"
DataKeyNames="ID" DataSourceID="SqlDataSourc e1" ForeColor="#333333" GridLines="None">
<FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
<Columns>
<asp:BoundField DataField="ID" HeaderText="ID" InsertVisible="False" ReadOnly="True"
SortExpression="ID" />
<asp:BoundField DataField="Dept" HeaderText="Dept" SortExpression="Dept" />
<asp:BoundField DataField="Name of Main User" HeaderText="Name of Main User" SortExpression="Name of Main User" />
<asp:BoundField DataField="Old PC Name" HeaderText="Old PC Name" SortExpression="Old PC Name" />
<asp:BoundField DataField="New PC Name" HeaderText="New PC Name" SortExpression="New PC Name" />
<asp:BoundField DataField="Old Serial" HeaderText="Old Serial" SortExpression="Old Serial" />
<asp:BoundField DataField="New Serial" HeaderText="New Serial" SortExpression="New Serial" />
<asp:BoundField DataField="Date" HeaderText="Date" SortExpression="Date" />
<asp:BoundField DataField="Installer" HeaderText="Installer" SortExpression="Installer" />
<asp:BoundField DataField="Notes" HeaderText="Notes" SortExpression="Notes" />
<asp:BoundField DataField="Field10" HeaderText="Field10" SortExpression="Field10" />
</Columns>
<RowStyle BackColor="#FFFBD6" ForeColor="#333333" />
<SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="Navy" />
<PagerStyle BackColor="#FFCC66" ForeColor="#333333" HorizontalAlign="Center" />
<HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
<AlternatingRowStyle BackColor="White" />
</asp:GridView>
</form>
</body>
</html>
Here is the web.config file:
<?xml version="1.0"?>
<!--
Note: As an alternative to hand editing this file you can use the
web admin tool to configure settings for your application. Use
the Website->Asp.Net Configuration option in Visual Studio.
A full list of settings and comments can be found in
machine.config.comments usually located in
\Windows\Microsoft.Net\Fra mework\v2. x\Config
-->
<configuration>
<appSettings/>
<connectionStrings>
<add name="computer_swapsConnec tionString " connectionString="Provider =Microsoft .Jet.OLEDB .4.0;Data Source=\\ftp-web\inetpub\w wwroot\dah _intranet\ computer_d atabase\co mputer_swa ps.mdb" providerName="System.Data. OleDb"/>
</connectionStrings>
<system.web>
<!--
Set compilation debug="true" to insert debugging
symbols into the compiled page. Because this
affects performance, set this value to true only
during development.
-->
<compilation debug="true"/>
<!--
The <authentication> section enables configuration
of the security authentication mode used by
ASP.NET to identify an incoming user.
-->
<authentication mode="Windows"/>
<!--
The <customErrors> section enables configuration
of what to do if/when an unhandled error occurs
during the execution of a request. Specifically,
it enables developers to configure html error pages
to be displayed in place of a error stack trace.
<customErrors mode="RemoteOnly" defaultRedirect="GenericEr rorPage.ht m">
<error statusCode="403" redirect="NoAccess.htm" />
<error statusCode="404" redirect="FileNotFound.htm " />
</customErrors>
-->
</system.web>
</configuration>
I haven't done alot of coding but I realize I'll probably have to do some to get this working because it doesn't seem to be a gui option.
Any help would be greatly appreciated.
Thanks, Karen
I can get the data to display online but can't figure out how to input data to the database from the web interface. All I have in the web site now are two pages:
default.aspx which is my actual web page
web.config
Here are the contents of default.aspx
<%@ Page Language="C#" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>DAH Computers</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<br />
<strong><span style="font-size: 24pt">Department of Arkansas Heritage Computers<br />
</span></strong>
<br />
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:computer
ProviderName="<%$ ConnectionStrings:computer
SelectCommand="SELECT * FROM [Computers] ORDER BY [Old PC Name]"></asp:SqlDataSource
</div>
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False
DataKeyNames="ID" DataSourceID="SqlDataSourc
<FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
<Columns>
<asp:BoundField DataField="ID" HeaderText="ID" InsertVisible="False" ReadOnly="True"
SortExpression="ID" />
<asp:BoundField DataField="Dept" HeaderText="Dept" SortExpression="Dept" />
<asp:BoundField DataField="Name of Main User" HeaderText="Name of Main User" SortExpression="Name of Main User" />
<asp:BoundField DataField="Old PC Name" HeaderText="Old PC Name" SortExpression="Old PC Name" />
<asp:BoundField DataField="New PC Name" HeaderText="New PC Name" SortExpression="New PC Name" />
<asp:BoundField DataField="Old Serial" HeaderText="Old Serial" SortExpression="Old Serial" />
<asp:BoundField DataField="New Serial" HeaderText="New Serial" SortExpression="New Serial" />
<asp:BoundField DataField="Date" HeaderText="Date" SortExpression="Date" />
<asp:BoundField DataField="Installer" HeaderText="Installer" SortExpression="Installer"
<asp:BoundField DataField="Notes" HeaderText="Notes" SortExpression="Notes" />
<asp:BoundField DataField="Field10" HeaderText="Field10" SortExpression="Field10" />
</Columns>
<RowStyle BackColor="#FFFBD6" ForeColor="#333333" />
<SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="Navy" />
<PagerStyle BackColor="#FFCC66" ForeColor="#333333" HorizontalAlign="Center" />
<HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
<AlternatingRowStyle BackColor="White" />
</asp:GridView>
</form>
</body>
</html>
Here is the web.config file:
<?xml version="1.0"?>
<!--
Note: As an alternative to hand editing this file you can use the
web admin tool to configure settings for your application. Use
the Website->Asp.Net Configuration option in Visual Studio.
A full list of settings and comments can be found in
machine.config.comments usually located in
\Windows\Microsoft.Net\Fra
-->
<configuration>
<appSettings/>
<connectionStrings>
<add name="computer_swapsConnec
</connectionStrings>
<system.web>
<!--
Set compilation debug="true" to insert debugging
symbols into the compiled page. Because this
affects performance, set this value to true only
during development.
-->
<compilation debug="true"/>
<!--
The <authentication> section enables configuration
of the security authentication mode used by
ASP.NET to identify an incoming user.
-->
<authentication mode="Windows"/>
<!--
The <customErrors> section enables configuration
of what to do if/when an unhandled error occurs
during the execution of a request. Specifically,
it enables developers to configure html error pages
to be displayed in place of a error stack trace.
<customErrors mode="RemoteOnly" defaultRedirect="GenericEr
<error statusCode="403" redirect="NoAccess.htm" />
<error statusCode="404" redirect="FileNotFound.htm
</customErrors>
-->
</system.web>
</configuration>
I haven't done alot of coding but I realize I'll probably have to do some to get this working because it doesn't seem to be a gui option.
Any help would be greatly appreciated.
Thanks, Karen
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.