dcsimg
www.webdeveloper.com
Results 1 to 3 of 3

Thread: Adding a record..is there an easier way???

  1. #1
    Join Date
    Feb 2003
    Location
    Sault Ste Marie, On, Canada
    Posts
    168

    Adding a record..is there an easier way???

    Can someone point me to, or show me a "Simple" Example of how to add a record to a database? I'm Using Asp.net with WebMatrix and the code wizards are enormous! There has to be a simpler way to do this!
    Thx in advance!!

  2. #2
    Join Date
    Feb 2003
    Location
    Sault Ste Marie, On, Canada
    Posts
    168
    Ok I think I've made some Progress, but I'm not sure as to how I would execute the Insert Statement. Any Help? Thx In Advance!


    <script runat="server">

    Sub Page_Load(sender as Object, e as EventArgs)

    Dim connString as String

    connString = "PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=" & _
    "C:\Profiles\Databases\Profiles.mdb;"

    Dim objConnection as OleDbConnection
    objConnection = New OleDbConnection(connString)
    objConnection.Open()
    End Sub

    Sub AddDeceased(sender As Object, e As EventArgs)
    Dim AddProfile as string
    AddProfile = "INSERT INTO Profiles (First_Name, Last_Name) VALUES (@First_Name, @Last_Name)"



    End Sub

    </script>
    <html>
    <head>
    </head>
    <body>
    <form runat="server">
    <asp:TextBox id="First_Name" runat="server"></asp:TextBox>
    <br />
    <asp:TextBox id="Last_Name" runat="server"></asp:TextBox>
    <asp:Button id="cmdadd" onclick="AddDeceased" runat="Server" text="Add"></asp:Button>
    </form>
    </body>
    </html>

  3. #3
    Join Date
    Feb 2003
    Location
    Sault Ste Marie, On, Canada
    Posts
    168
    Ok guys, my heart has stopped racing and the sonic booms emitting my chest have stopped. I figured it out. But thx though! You can Delete this thread.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles