Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Wrox Announcements and Feedback > Forum and Wrox.com Feedback
|
Forum and Wrox.com Feedback Post your suggestions for improving the Forums or Wrox.com or questions for the staff here. "Where can I find the code for my book?"
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Forum and Wrox.com Feedback 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
  #1 (permalink)  
Old March 12th, 2007, 09:30 AM
Registered User
 
Join Date: Mar 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default i get error during declaration of variable

Hi i am using this code

string str1 = "insert into tblAccessLevel(AccessLevel) values(@level)";
        cmd1 = new OdbcCommand(str1, con);
        OdbcParameter param = new OdbcParameter("@level", OdbcType.VarChar);
        param.Value = DropDownList4.SelectedItem.ToString();
        cmd1.Parameters.Add(param);


        cmd1.Connection.Open();
        cmd1.ExecuteNonQuery();
        cmd1.Connection.Close();


and i got error message
"must declare the variable @level"..
please tell me what should i do.

  #2 (permalink)  
Old March 12th, 2007, 09:42 AM
jminatel's Avatar
Wrox Staff
Points: 18,059, Level: 58
Points: 18,059, Level: 58 Points: 18,059, Level: 58 Points: 18,059, Level: 58
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2003
Posts: 1,906
Thanks: 62
Thanked 139 Times in 101 Posts
Default

What are you trying to do?

Jim Minatel
Senior Acquisitions Editor
Wiley Technology Publishing
WROX Press
Blog: http://wroxblog.typepad.com/
Jim's Book of the week: No book this week - Donate to the Red Cross!





Similar Threads
Thread Thread Starter Forum Replies Last Post
standalone declaration Jay Frank XML 5 September 28th, 2007 08:57 AM
Declaration of variable without initialization v_kewlani Other Programming Languages 0 May 24th, 2007 01:51 AM
Doubt regarding variable declaration and useage dsekar_nat XSLT 2 July 27th, 2006 10:19 PM
Declaration Expected kenn_rosie ADO.NET 7 January 17th, 2006 03:58 AM
asp variable declaration bad characters crmpicco Classic ASP Basics 2 August 18th, 2005 07:49 AM





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