DotNetNewsgroup.com  
web access to complete list of Microsoft.NET newsgroups
   home   |   control panel login   |   archive  |  
 
  carried group
academic
adonet
aspnet
aspnet.announcements
aspnet.buildingcontrols
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
assignment_manager
datatools
dotnet.distributed_apps
dotnet.general
dotnet.myservices
dotnet.nternationalization
dotnet.scripting
dotnet.security
dotnet.vjsharp
dotnet.vsa
dotnet.xml
dotnetfaqs
framework
framework.clr
framework.compactframework
framework.component_services
framework.controls
framework.databinding
framework.drawing
framework.enhancements
framework.interop
framework.odbcnet
framework.performance
framework.remoting
framework.sdk
framework.setup
framework.webservices
framework.windowsforms
framework.wmi
frwk.windowsforms.designtime
lang.csharp
lang.jscript
lang.vb
lang.vb.controls
lang.vb.data
lang.vb.upgrade
lang.vc
lang.vc.libraries
  
 
start date: Sun, 19 Aug 2007 22:21:09 -0700,    posted on: microsoft.public.dotnet.framework.aspnet        back       

Thread Index
  1    unknown


database access problem   
I have a database (access2003) that i dragged into my App_data folder
on my webprovider's server that I use with .NET 2003. I looked at the
properties and it still says my path is C:\.....mdb. Is this expected?
The reason I ask is I have some code to add a record and it's has no
errors but will not write to the DB. I checked the security on my
Host's server and that is OK. The page looks fine in the browser. I
have a DetailsView1 on the page with the option set to allow inserts.
I tried editing my Webconfig to the complete URL of my website's
App_Data and that didn't work either. Here's my code:

<%@ Page Explicit="True" Language="VB" Debug="True" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.OleDb" %>
<html>
<body vlink="red">
<h1>Barcoded Products</h1>

<form id="Form1" runat="server">

<h2>Enter New Product</h2>

<script runat="server">
Protected Sub Page_Load(ByVal sender As Object, _
  ByVal e As System.EventArgs)

    DetailsView1.ChangeMode(DetailsViewMode.Insert)
End Sub

Protected Sub DetailsView1_ItemInserted( _
  ByVal sender As Object, ByVal e As _
  System.Web.UI.WebControls.DetailsViewInsertedEventArgs)

    Response.Redirect("default.aspx")
End Sub

Protected Sub DetailsView1_ItemCommand( _
  ByVal sender As Object, ByVal e As _
  System.Web.UI.WebControls.DetailsViewCommandEventArgs)

    If e.CommandName = "Cancel" Then
        Response.Redirect("default.aspx")
    End If
End Sub

</script>

<br />

<asp:DetailsView ID="DetailsView1" runat="server"
Height="50px" Width="100%" AutoGenerateRows="False"
DataKeyNames="ProdNum" DataSourceID="SqlDataSource1"
CellPadding="4" ForeColor="#333333" GridLines="None"
OnItemInserted="DetailsView1_ItemInserted"
OnItemCommand="DetailsView1_ItemCommand">

    <Fields>
        <asp:BoundField DataField="Title" HeaderText="Product"
            SortExpression="Product" />
    </Fields>

    <RowStyle BackColor="#FFFBD6" ForeColor="#333333" />

    <FieldHeaderStyle BackColor="#FFFF99" Font-Bold="True" />

</asp:DetailsView>

 

<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConflictDetection="CompareAllValues"
ConnectionString=
"<%$ ConnectionStrings:BarCodedProductConnectString %>"
InsertCommand="INSERT INTO Ads (Product) VALUES (?)"
ProviderName=
"<%$ ConnectionStrings:BarCodedProductConnectString.ProviderName %>"
SelectCommand="SELECT Product FROM Ads" >

    <InsertParameters>
        <asp:Parameter Name="Title" Type="String" />

    </InsertParameters>
</asp:SqlDataSource>

</form>
</body>
</html>
Date:Sun, 19 Aug 2007 22:21:09 -0700   Author:  

Google
 
Web dotnetnewsgroup.com


COPYRIGHT ?2005, EUROFRONT WORLDWIDE LTD., ALL RIGHT RESERVE  |   Contact us