Wrox Programmer Forums
|
ASP.NET 1.1 As of 10/6/2005, this forum is locked as part of the reorganization described here: http://p2p.wrox.com/topic.asp?TOPIC_ID=35394. No posts have been deleted. Open ongoing discussions from the last week have been moved to either ASP.NET 1.0 and 1.1 Beginners http://p2p.wrox.com/asp-net-1-0-1-1-basics-60/ or ASP.NET 1.0 and 1.1 Professional. http://p2p.wrox.com/forum.asp?FORUM_ID=50. See my sticky post inside for more.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.1 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 April 5th, 2005, 10:13 PM
Authorized User
 
Join Date: Nov 2004
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
Default oledbcommand insert help

ASP.net always said somethings wrong with the insert into statement
but I can't figure it out...........

The error is : some things wrong with the INSERT INTO CLAUSE

any one can help me

Database strucutre: http://xs.to/xs.php?h=xs23&d=05143&f=structure.JPG
Code:
        dim conn as new oledbconnection(application("connectstring"))
        conn.open()
        dim userinsert as string="INSERT INTO user (login_id, [password], name, email, address1, address2, address3, home, office, question, answer) VALUES (@login_id, @password, @name, @email, @address1, @address2, @address3, @home, @office, @question, @answer)"
        dim cmd as new oledbcommand(userinsert,conn)
        cmd.parameters.add(new oledbparameter("@Login_id",oledbtype.char,19))
        cmd.parameters(0).value=txtid.text
        cmd.parameters.add(new oledbparameter("@password",oledbtype.char,20))
        cmd.parameters(1).value=txtpass1.text
        cmd.parameters.add(new oledbparameter("@name",oledbtype.char,50))
        cmd.parameters(2).value=txtfull.text
        cmd.parameters.add(new oledbparameter("@email",oledbtype.char,30))
        cmd.parameters(3).value=txtemail.text
        cmd.parameters.add(new oledbparameter("@address1",oledbtype.char,20))
        cmd.parameters(4).value=txtadd1.text
        cmd.parameters.add(new oledbparameter("@address2",oledbtype.char,20))
        cmd.parameters(5).value=txtadd2.text
        cmd.parameters.add(new oledbparameter("@address3",oledbtype.char,10))
        cmd.parameters(6).value=txtadd3.text
        cmd.parameters.add(new oledbparameter("@home",oledbtype.char,16))
        cmd.parameters(7).value=txthome.text
        cmd.parameters.add(new oledbparameter("@office",oledbtype.char,16))
        cmd.parameters(8).value=txtoffice.text
        cmd.parameters.add(new oledbparameter("@question",oledbtype.char,50))
        cmd.parameters(9).value="home tel"
        cmd.parameters.add(new oledbparameter("@answer",oledbtype.char,50))
          cmd.parameters(10).value="26940671"
        cmd.executenonquery()

        conn.dispose()

__________________
For question asking, please made sure that your question is as similar as possible while providing enought level of details!
Since not all peoples, like to read large amounts of text just for reading or requirement and waste the answer time to read your text
 
Old April 6th, 2005, 07:13 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,110
Thanks: 0
Thanked 3 Times in 3 Posts
Default

What is the actual error message?






Similar Threads
Thread Thread Starter Forum Replies Last Post
OleDbCommand Problems FalseParadigm VB Databases Basics 8 April 10th, 2007 03:01 PM
VB.NET - oledbcommand.parameters BUG AleBernardi BOOK: Beginning VB.NET 2nd Edition/Beginning VB.NET 2003 1 October 9th, 2004 05:56 AM
oledbcommand and sql query problem andre ADO.NET 1 July 22nd, 2004 09:33 AM
OleDbCommand.ExecuteNonQuery(); kaz VS.NET 2002/2003 1 December 7th, 2003 04:29 PM





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