.NET Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgramming.NET Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old April 25th, 2005, 02:03 AM
Harlequeen Harlequeen is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2005
Posts: 12 Harlequeen User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 36 m
Reputation Power: 0
Input string was not in correct format

Hi

I have some code which should just allow me to enter info into text boxes and then save it to a database. When I run it I get the following error 'Input string was not in a correct format.'

This is the command text used
Code:
INSERT INTO Places
                      (Name, Address1, Address2, Address3, Phone, leftx, topy, w, h)
VALUES     (?, ?, ?, ?, ?, ?, ?, ?, ?)



And this is where I am getting the problem, it highlights the area in bold.

Any ideas where I am going wrong

Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        OleDbDataAdapterPlaces.Fill(DataSetPlaces11)
        pbman = Me.BindingContext(DataSetPlaces11, "Places")


        OleDbConnection1.Open()
        OleDbCommand1.CommandText = "INSERT INTO Places(Name, Address1, Address2, Address3, Phone, leftx, topy, w, h)     VALUES(?,?,?,?,?,?,?,?,?)"

        OleDbCommand1.Parameters.Add("@Name", TextBox1.Text)
        OleDbCommand1.Parameters.Add("@Address1", TextBox2.Text)
        OleDbCommand1.Parameters.Add("@Address2", TextBox3.Text)
        OleDbCommand1.Parameters.Add("@Address3", TextBox4.Text)
        OleDbCommand1.Parameters.Add("@Phone", TextBox5.Text)
        OleDbCommand1.Parameters.Add("@leftx", TextBox6.Text)
        OleDbCommand1.Parameters.Add("@topy", TextBox7.Text)


        
        Dim DBreturn As Integer

        DBreturn = OleDbCommand1.ExecuteNonQuery

        OleDbConnection1.Close()

Cheers

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgramming.NET Development > Input string was not in correct format


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway
Stay green...Green IT