Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB.NET 1.0 > Pro VB.NET 2002/2003
|
Pro VB.NET 2002/2003 For advanced Visual Basic coders working .NET version 2002/2003. Beginning-level questions will be redirected to other forums, including Beginning VB.NET.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro VB.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 19th, 2006, 09:04 AM
Authorized User
 
Join Date: Aug 2006
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to amit_mande@yahoo.com Send a message via AIM to amit_mande@yahoo.com Send a message via MSN to amit_mande@yahoo.com Send a message via Yahoo to amit_mande@yahoo.com
Default What is wrong in following code?Give me solution

This is my code

Private Sub cmdAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdAdd.Click
        myCommand = New OleDbCommand

        myCommand.Connection = myConnection
        Dim intPositin As Int16
        intPositin = myCurrencyManager.Position

        myCommand.CommandText = "insert into login (UserId, Password) values (@UserId, @Password)"
        myCommand.Parameters.Add("@UserId", txtUserName.Text)
        myCommand.Parameters.Add("@Password", txtPassword.Text)
        myConnection.Open()
        Try
            myCommand.ExecuteNonQuery()
        Catch ex As Exception
            MessageBox.Show(ex.ToString)
        End Try
        myConnection.Close()
        FillDataSetAndView()
        BindFields()
        myCurrencyManager.Position = myCurrencyManager.Count
        ShowPosition()
        StatusBar1.Text = "Record Added"
        Clear()
    End Sub

I am using Try...Catch to catch exception.
I get Following exception

Syntax error in INSERT INTO statement

What is wrong with code.
if you have another code for inserting above values give me that code

 
Old September 19th, 2006, 04:49 PM
Friend of Wrox
 
Join Date: Nov 2004
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
Default

This question is posted at http://p2p.wrox.com/topic.asp?TOPIC_ID=49965

If you are going to post a question in more than one forum, you should post the actual question in one place, and references to it elsewhere. That way all action on the question will be in one place. This usually results in better, more robust discussions...





Similar Threads
Thread Thread Starter Forum Replies Last Post
Please give me solution deepak.deemca C++ Programming 1 October 17th, 2007 04:27 PM
give me solution asudhakar ASP.NET 1.0 and 1.1 Basics 2 March 19th, 2007 09:33 AM
Please give me the solution to my example. vijaykumartaduri General .NET 4 March 7th, 2007 11:41 PM
hi expert! Can u give me solution for this???? jasdeephere ASP.NET 1.0 and 1.1 Professional 1 February 10th, 2007 02:16 AM
CROSS_TAB,,, RTL problem, Plz Give me solution raza_mrk36 Crystal Reports 0 April 4th, 2006 02:33 AM





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