Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > .NET 1.0 and Visual Studio.NET > VS.NET 2002/2003
|
VS.NET 2002/2003 Discussions about the Visual Studio.NET programming environment, the 2002 (1.0) and 2003 (1.1). ** Please don't post code questions here ** For issues specific to a particular language in .NET, please see the other forum categories.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VS.NET 2002/2003 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 15th, 2005, 02:46 AM
Registered User
 
Join Date: Sep 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default input string was not in a correct format

i am getting errorr that"input string was not in a correct format"
for ExecuteNonQuery()...
please some one help me...
here is my code
For i = 0 To a - 1

            SqlCmd = New SqlCommand("update_IRProfile", SqlCon)
            SqlCmd.CommandType = CommandType.StoredProcedure

            viewstate("g") = Request.Form("txta" & i).ToString()
            viewstate("g1") = Request.Form("txtb" & i).ToString()

            SqlCmd.Parameters.Add("@AAttr", SqlDbType.Char, 4).Value = lookup.SelectedItem.Text.ToString()
            SqlCmd.Parameters.Add("@VValue", SqlDbType.Int).Value = CStr(viewstate("g"))
            SqlCmd.Parameters.Add("@IValue", SqlDbType.Int).Value = CStr(viewstate("g1"))
            SqlCmd.Parameters.Add("@Desc", SqlDbType.VarChar, 25, "Descrp").Value = Label1.Text.ToString()

            SqlCmd.ExecuteNonQuery()
        Next i

 
Old October 11th, 2005, 12:18 AM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts
Default

Use a Try ... Catch block to get a more descriptive error
Response.write ex.Message

Also try to Response.Write SqlCmd.CommandText and don't execute it, this way you can see the sql string structure.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Input string was not in a correct format Dwizz VB.NET 2002/2003 Basics 8 April 29th, 2010 05:56 AM
Input string was not in a correct format. Silfverduk VB.NET 2002/2003 Basics 1 May 20th, 2006 04:58 AM
Input string was not in a correct format Dwizz VB.NET 2002/2003 Basics 2 April 4th, 2005 11:03 AM
"Input string was not in a correct format." keane Pro VB.NET 2002/2003 1 December 18th, 2004 08:45 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.