|
-
Oct 24th, 2003, 01:39 PM
#1
Thread Starter
Hyperactive Member
SQL statement
What is wrong with this...
' define and get the Customers Master
Dim cmdSQL_C As New SqlCommand("Select Top 1 * from Customers where CustomerID = @CustomerID")
cmdSQL_C.Connection = conSQL
cmdSQL_C.Parameters.Add("@CustomerID", System.Data.SqlDbType.Int)
cmdSQL_C.Parameters("@CustomerID").Value = TextBox3.Text 'has a valid key value
conSQL.Open()
Rdr = cmdSQL_C.ExecuteReader()
Rdr.Read()
At the .ExecuteReader I get the error :
An unhandled exception of type 'System.FormatException' occurred in system.data.dll
Additional information: Input string was not in a correct format
The key to Customers is nchar(5).
When I use this same set of code for a key that numeric .. all is fine... What's up???
gollnick
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|