What am I missing....? 
Author Message
 What am I missing....?

This is the event procedure in vb.net to send the
information put into textboxes on a form to an sql db to
a new row. The application does not bomb, but what is
worse it is not writing the new row to the sqldb which is
what I wanted it to. Soemthing else that is interesting
is that after you click ok if you attempt to send the
form again after it thanks you it says the record exists
though when you open the table it is not there.
dataset11 is the dataset, dekkercustomerlisting is the
table to be written to, dekkerdatabase is the name of the
database.
Thank you so much for your help......

Private Sub Button1_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles Button1.Click
        Dim msg As String
        Dim title As String
        Dim style As MsgBoxStyle
        Dim response As MsgBoxResult
        msg = "You have entered the following
information" & vbCrLf & vbCrLf & _
"Their Customer Number is " & TextBox1.Text & vbCrLf &
vbCrLf & _
"The Customer Last Name is " & TextBox2.Text & vbCrLf &
vbCrLf & _
"The Customer First Name is " & TextBox3.Text & vbCrLf &
vbCrLf & _
"The Customer wedding date is " & TextBox4.Text & vbCrLf
& vbCrLf & _
"The Customer Address is " & TextBox5.Text & vbCrLf &
vbCrLf & _
"The Customer Phone Number is " & TextBox6.Text & vbCrLf
& vbCrLf & _
"The Customer Fax Number is " & TextBox7.Text & vbCrLf &
vbCrLf & _
"The Customer Email Address is " & TextBox8.Text & vbCrLf
& vbCrLf & _
"If this information is correct click ok." & vbCrLf & _
"If not, click cancel. No information will be
recorded."   ' Define message.
        style = MsgBoxStyle.DefaultButton2 Or _
           MsgBoxStyle.YesNo Or MsgBoxStyle.Critical
        title = "Mary Dekker Customer Listing - Please
Verify the Information Submitted is Correct..."   '
Define title.
        ' Display message.
        response = MsgBox(msg, style, title)
        If response = MsgBoxResult.Yes Then   ' User
chose Yes.
            Dim drNew As System.Data.DataRow
            drNew =
Me.DataSet11.dekkercustomerlisting.NewRow
            drNew.Item("Customer Number") = TextBox1.Text
            drNew.Item("Last Name") = TextBox2.Text
            drNew.Item("First Name") = TextBox3.Text
            drNew.Item("Date of Wedding") = TextBox4.Text
            drNew.Item("Address") = TextBox5.Text
            drNew.Item("phone") = TextBox6.Text
            drNew.Item("fax") = TextBox7.Text
            drNew.Item("email") = TextBox8.Text
            Me.DataSet11.dekkercustomerlisting.Rows.Add
(drNew)
            MsgBox("Thank You", MsgBoxStyle.Information)
        Else
            MsgBox("No changes have been entered into
your database. Please review this customers information
again" & vbCrLf & _
            "and make whatever changes are needed and
then click submit again.", MsgBoxStyle.Information, "Mary
Dekker Customer Listing - Please Enter the Information
For This Customer Again...")
        End If



Wed, 09 Feb 2005 22:06:47 GMT
 What am I missing....?

Short answer, data in your data set is not sent to the database until you
call Update using a DataAdapter.  You may also want to read up on data
binding.

Rob


Quote:
> This is the event procedure in vb.net to send the
> information put into textboxes on a form to an sql db to
> a new row. The application does not bomb, but what is
> worse it is not writing the new row to the sqldb which is
> what I wanted it to. Soemthing else that is interesting
> is that after you click ok if you attempt to send the
> form again after it thanks you it says the record exists
> though when you open the table it is not there.
> dataset11 is the dataset, dekkercustomerlisting is the
> table to be written to, dekkerdatabase is the name of the
> database.
> Thank you so much for your help......

> Private Sub Button1_Click(ByVal sender As System.Object,
> ByVal e As System.EventArgs) Handles Button1.Click
>         Dim msg As String
>         Dim title As String
>         Dim style As MsgBoxStyle
>         Dim response As MsgBoxResult
>         msg = "You have entered the following
> information" & vbCrLf & vbCrLf & _
> "Their Customer Number is " & TextBox1.Text & vbCrLf &
> vbCrLf & _
> "The Customer Last Name is " & TextBox2.Text & vbCrLf &
> vbCrLf & _
> "The Customer First Name is " & TextBox3.Text & vbCrLf &
> vbCrLf & _
> "The Customer wedding date is " & TextBox4.Text & vbCrLf
> & vbCrLf & _
> "The Customer Address is " & TextBox5.Text & vbCrLf &
> vbCrLf & _
> "The Customer Phone Number is " & TextBox6.Text & vbCrLf
> & vbCrLf & _
> "The Customer Fax Number is " & TextBox7.Text & vbCrLf &
> vbCrLf & _
> "The Customer Email Address is " & TextBox8.Text & vbCrLf
> & vbCrLf & _
> "If this information is correct click ok." & vbCrLf & _
> "If not, click cancel. No information will be
> recorded."   ' Define message.
>         style = MsgBoxStyle.DefaultButton2 Or _
>            MsgBoxStyle.YesNo Or MsgBoxStyle.Critical
>         title = "Mary Dekker Customer Listing - Please
> Verify the Information Submitted is Correct..."   '
> Define title.
>         ' Display message.
>         response = MsgBox(msg, style, title)
>         If response = MsgBoxResult.Yes Then   ' User
> chose Yes.
>             Dim drNew As System.Data.DataRow
>             drNew =
> Me.DataSet11.dekkercustomerlisting.NewRow
>             drNew.Item("Customer Number") = TextBox1.Text
>             drNew.Item("Last Name") = TextBox2.Text
>             drNew.Item("First Name") = TextBox3.Text
>             drNew.Item("Date of Wedding") = TextBox4.Text
>             drNew.Item("Address") = TextBox5.Text
>             drNew.Item("phone") = TextBox6.Text
>             drNew.Item("fax") = TextBox7.Text
>             drNew.Item("email") = TextBox8.Text
>             Me.DataSet11.dekkercustomerlisting.Rows.Add
> (drNew)
>             MsgBox("Thank You", MsgBoxStyle.Information)
>         Else
>             MsgBox("No changes have been entered into
> your database. Please review this customers information
> again" & vbCrLf & _
>             "and make whatever changes are needed and
> then click submit again.", MsgBoxStyle.Information, "Mary
> Dekker Customer Listing - Please Enter the Information
> For This Customer Again...")
>         End If



Wed, 09 Feb 2005 23:40:18 GMT
 What am I missing....?
I did bind the textboxes to the various fields. Do I need to repeat that
code in the event procedure?
The Update statement you spoke of. Since I wrote this I tried this. But it
still did not work. Is this what you had in mind with the update statement:
Me.SqlConnection1.Open()

Me.DataSet11.dekkercustomerlisting.Rows.Add(drNew)

Me.Update()

Me.SqlConnection1.Close()



Quote:
> Short answer, data in your data set is not sent to the database until you
> call Update using a DataAdapter.  You may also want to read up on data
> binding.

> Rob



> > This is the event procedure in vb.net to send the
> > information put into textboxes on a form to an sql db to
> > a new row. The application does not bomb, but what is
> > worse it is not writing the new row to the sqldb which is
> > what I wanted it to. Soemthing else that is interesting
> > is that after you click ok if you attempt to send the
> > form again after it thanks you it says the record exists
> > though when you open the table it is not there.
> > dataset11 is the dataset, dekkercustomerlisting is the
> > table to be written to, dekkerdatabase is the name of the
> > database.
> > Thank you so much for your help......

> > Private Sub Button1_Click(ByVal sender As System.Object,
> > ByVal e As System.EventArgs) Handles Button1.Click
> >         Dim msg As String
> >         Dim title As String
> >         Dim style As MsgBoxStyle
> >         Dim response As MsgBoxResult
> >         msg = "You have entered the following
> > information" & vbCrLf & vbCrLf & _
> > "Their Customer Number is " & TextBox1.Text & vbCrLf &
> > vbCrLf & _
> > "The Customer Last Name is " & TextBox2.Text & vbCrLf &
> > vbCrLf & _
> > "The Customer First Name is " & TextBox3.Text & vbCrLf &
> > vbCrLf & _
> > "The Customer wedding date is " & TextBox4.Text & vbCrLf
> > & vbCrLf & _
> > "The Customer Address is " & TextBox5.Text & vbCrLf &
> > vbCrLf & _
> > "The Customer Phone Number is " & TextBox6.Text & vbCrLf
> > & vbCrLf & _
> > "The Customer Fax Number is " & TextBox7.Text & vbCrLf &
> > vbCrLf & _
> > "The Customer Email Address is " & TextBox8.Text & vbCrLf
> > & vbCrLf & _
> > "If this information is correct click ok." & vbCrLf & _
> > "If not, click cancel. No information will be
> > recorded."   ' Define message.
> >         style = MsgBoxStyle.DefaultButton2 Or _
> >            MsgBoxStyle.YesNo Or MsgBoxStyle.Critical
> >         title = "Mary Dekker Customer Listing - Please
> > Verify the Information Submitted is Correct..."   '
> > Define title.
> >         ' Display message.
> >         response = MsgBox(msg, style, title)
> >         If response = MsgBoxResult.Yes Then   ' User
> > chose Yes.
> >             Dim drNew As System.Data.DataRow
> >             drNew =
> > Me.DataSet11.dekkercustomerlisting.NewRow
> >             drNew.Item("Customer Number") = TextBox1.Text
> >             drNew.Item("Last Name") = TextBox2.Text
> >             drNew.Item("First Name") = TextBox3.Text
> >             drNew.Item("Date of Wedding") = TextBox4.Text
> >             drNew.Item("Address") = TextBox5.Text
> >             drNew.Item("phone") = TextBox6.Text
> >             drNew.Item("fax") = TextBox7.Text
> >             drNew.Item("email") = TextBox8.Text
> >             Me.DataSet11.dekkercustomerlisting.Rows.Add
> > (drNew)
> >             MsgBox("Thank You", MsgBoxStyle.Information)
> >         Else
> >             MsgBox("No changes have been entered into
> > your database. Please review this customers information
> > again" & vbCrLf & _
> >             "and make whatever changes are needed and
> > then click submit again.", MsgBoxStyle.Information, "Mary
> > Dekker Customer Listing - Please Enter the Information
> > For This Customer Again...")
> >         End If



Thu, 10 Feb 2005 00:01:40 GMT
 What am I missing....?
I figured it out.....thanks Robert.....
it all came together after you told me that I was not addressing the
adapter.
How stupid of me.....



Quote:
> Short answer, data in your data set is not sent to the database until you
> call Update using a DataAdapter.  You may also want to read up on data
> binding.

> Rob



> > This is the event procedure in vb.net to send the
> > information put into textboxes on a form to an sql db to
> > a new row. The application does not bomb, but what is
> > worse it is not writing the new row to the sqldb which is
> > what I wanted it to. Soemthing else that is interesting
> > is that after you click ok if you attempt to send the
> > form again after it thanks you it says the record exists
> > though when you open the table it is not there.
> > dataset11 is the dataset, dekkercustomerlisting is the
> > table to be written to, dekkerdatabase is the name of the
> > database.
> > Thank you so much for your help......

> > Private Sub Button1_Click(ByVal sender As System.Object,
> > ByVal e As System.EventArgs) Handles Button1.Click
> >         Dim msg As String
> >         Dim title As String
> >         Dim style As MsgBoxStyle
> >         Dim response As MsgBoxResult
> >         msg = "You have entered the following
> > information" & vbCrLf & vbCrLf & _
> > "Their Customer Number is " & TextBox1.Text & vbCrLf &
> > vbCrLf & _
> > "The Customer Last Name is " & TextBox2.Text & vbCrLf &
> > vbCrLf & _
> > "The Customer First Name is " & TextBox3.Text & vbCrLf &
> > vbCrLf & _
> > "The Customer wedding date is " & TextBox4.Text & vbCrLf
> > & vbCrLf & _
> > "The Customer Address is " & TextBox5.Text & vbCrLf &
> > vbCrLf & _
> > "The Customer Phone Number is " & TextBox6.Text & vbCrLf
> > & vbCrLf & _
> > "The Customer Fax Number is " & TextBox7.Text & vbCrLf &
> > vbCrLf & _
> > "The Customer Email Address is " & TextBox8.Text & vbCrLf
> > & vbCrLf & _
> > "If this information is correct click ok." & vbCrLf & _
> > "If not, click cancel. No information will be
> > recorded."   ' Define message.
> >         style = MsgBoxStyle.DefaultButton2 Or _
> >            MsgBoxStyle.YesNo Or MsgBoxStyle.Critical
> >         title = "Mary Dekker Customer Listing - Please
> > Verify the Information Submitted is Correct..."   '
> > Define title.
> >         ' Display message.
> >         response = MsgBox(msg, style, title)
> >         If response = MsgBoxResult.Yes Then   ' User
> > chose Yes.
> >             Dim drNew As System.Data.DataRow
> >             drNew =
> > Me.DataSet11.dekkercustomerlisting.NewRow
> >             drNew.Item("Customer Number") = TextBox1.Text
> >             drNew.Item("Last Name") = TextBox2.Text
> >             drNew.Item("First Name") = TextBox3.Text
> >             drNew.Item("Date of Wedding") = TextBox4.Text
> >             drNew.Item("Address") = TextBox5.Text
> >             drNew.Item("phone") = TextBox6.Text
> >             drNew.Item("fax") = TextBox7.Text
> >             drNew.Item("email") = TextBox8.Text
> >             Me.DataSet11.dekkercustomerlisting.Rows.Add
> > (drNew)
> >             MsgBox("Thank You", MsgBoxStyle.Information)
> >         Else
> >             MsgBox("No changes have been entered into
> > your database. Please review this customers information
> > again" & vbCrLf & _
> >             "and make whatever changes are needed and
> > then click submit again.", MsgBoxStyle.Information, "Mary
> > Dekker Customer Listing - Please Enter the Information
> > For This Customer Again...")
> >         End If



Thu, 10 Feb 2005 00:16:40 GMT
 
 [ 4 post ] 

 Relevant Pages 

1. INITIALIZE DEVICE- -What am I missing???

2. Integrated Security: What am I missing here?

3. HELP: Am I missing the point or something ?

4. Help with SQL Query - what am I missing?

5. What am I missing

6. Am I missing something????

7. Transaction Snapshots - What am I Missing?...

8. Simple set variable, what am I missing

9. What am I missing???

10. Restore of Master -- What am I missing?

11. Am I missing something?

12. what am I missing?


 
Powered by phpBB® Forum Software