Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Add record using vb.net in sql server 2000
Message
General information
Forum:
ASP.NET
Category:
Databases
Miscellaneous
Thread ID:
00743226
Message ID:
00743235
Views:
10
I would recommend tracing your code and find the line of code that causes the error to occur. It sounds like the error is on your ExecuteNonQuery line and the SQL Server stored procedure is returning it. If that is the case then you will need to test your stored procedure to find the cause of the error. Another thing to check is the value of the parameter you are sending. Make sure it is the right data type and contains valid information from the TextBox Text property.

>I write following code for insert record.
>
>Dim invenConn As SqlConnection = New SqlConnection("Data Source=DEVELOPE;Integrated Security=SSPI;" & _
> "Initial Catalog=inventory")
>
>Dim Invecmd As SqlCommand = New SqlCommand("INSERTGODOWN", invenConn) 'Declare For Sql Command
> Invecmd.CommandType = CommandType.StoredProcedure
> Dim MyParm As SqlParameter 'Declare For Parameters
> MyParm = Invecmd.Parameters.Add("@godname", SqlDbType.VarChar, 15)
> MyParm.Value = LTrim(txtGodownName.Text)
> invenConn.Open()
>Invecmd.ExecuteNonQuery()
>Invenconn.Close()
>Invecmd.Dispose()
>Invenconn.Dispose()
>
>Executing above code follwoing message occure
>
>an unhandled execption of type 'System.data.Sqlclient.Sqlexecption'
>occurred in syystem.data.dll
>
>Aditional information : system error.
-----------------------------------------

Cathi Gero, CPA
Prenia Software & Consulting Services
Microsoft C# / .NET MVP
Mere Mortals for .NET MVP
cgero@prenia.com
www.prenia.com
Weblog: blogs.prenia.com/cathi
Previous
Reply
Map
View

Click here to load this message in the networking platform