Dataset update problem

nkwk

Newcomer
Joined
Mar 11, 2004
Messages
13
I have to say, i'm toatally lost. Nothing seems to work.

I cant update my SQL database.

My code:

Visual Basic:
    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        If Not Page.IsPostBack Then
            ConnectionOpen()
            Bind()
        End If
    End Sub
    Private Sub ConnectionOpen()
        Adapter1.SelectCommand.CommandText = "SELECT * FROM cases_enquiries WHERE ID = '" & Session("ID") & "'"
        Dataset1.Clear()
        Adapter1.Fill(Dataset1, "cases_enquiries")
    End Sub
    Private Sub ConnectionClose()
        Dataset1.Clear()
    End Sub
    Private Sub Bind()
        TextBox1.DataBind()
        TextBox2.DataBind()
        TextBox3.DataBind()
        TextBox4.DataBind()
        TextBox5.DataBind()
        TextBox6.DataBind()
        TextBox7.DataBind()
        TextBox8.DataBind()
        TextBox9.DataBind()
        TextBox10.DataBind()
        TextBox11.DataBind()
        TextBox12.DataBind()
        TextBox13.DataBind()
        TextBox14.DataBind()
        DropDownList1.DataBind()
        DropDownList2.DataBind()
        DropDownList3.DataBind()
        DropDownList4.DataBind()
        DropDownList4.DataBind()
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

        Label16.Text = Adapter1.UpdateCommand.CommandText
        Adapter1.Update(DataSet1)
        DataSet1.AcceptChanges()

    End Sub

If the value in textbox1 has changed from the original value of '1' to '2'

What would I need to code for the dataset to update the SQL server?

I've tried using the oledb adapter and the sqladapter and still no success.

Nick
 
Back
Top