
April 23rd, 2005, 08:36 AM
|
|
Registered User
|
|
Join Date: Mar 2005
Posts: 12
Time spent in forums: 2 h 36 m
Reputation Power: 0
|
|
|
Updating but not ending!
I have a form which is a map, when I click on it a new label is drawn in the place I want and a second form opens and allows me to input data which refers to the new label place.
I am able to input the information to the database, then nothing happens. The insert code is shown below, minus any try statements I had, because they do not get that far. If I close the form, the insert takes place, but the label does not attach to the first form. If I don't close the form with the close button I have to stop debug running.
I am trying to teach this to myself, but am getting nowhere fast...
Any help would be appreciated.
Code:
Public Sub btnSubmit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSubmit.Click
'MessageBox.Show("formnew " & f1.TextBox1.Text & " & " & f1.TextBox2.Text)
OleDbDataAdapter1.Fill(DataSet11)
pbman = Me.BindingContext(DataSet11, "Places")
'rec_number = OleDbDataAdapter1.Fill(DataSet11)
Dim ds As DataSet1
OleDbConnection1.Open()
OleDbCommand1.CommandText = "INSERT INTO Places(Name, Address1, Address2, Address3,Phone,leftx,topy,w,h) VALUES(?,?,?,?,?,?,?,50,28);"
OleDbCommand1.Parameters.Add("@Name", TextBox1.Text)
OleDbCommand1.Parameters.Add("@Address1", TextBox2.Text)
OleDbCommand1.Parameters.Add("@Address2", TextBox3.Text)
OleDbCommand1.Parameters.Add("@Address3", TextBox7.Text)
OleDbCommand1.Parameters.Add("@Phone", TextBox4.Text)
OleDbCommand1.Parameters.Add("@leftx", TextBox5.Text)
OleDbCommand1.Parameters.Add("@topy", TextBox6.Text)
OleDbCommand1.Parameters.Add("@w", TextBox8.Text)
OleDbCommand1.Parameters.Add("@l", TextBox9.Text)
Dim DBreturn As Integer
DBreturn = OleDbCommand1.ExecuteNonQuery
OleDbConnection1.Close()
|