Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 3.5 > ASP.NET 3.5 Professionals
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
ASP.NET 3.5 Professionals If you are an experienced ASP.NET programmer, this is the forum for your 3.5 questions. Please also see the Visual Web Developer 2008 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 3.5 Professionals section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Display Modes
  #1 (permalink)  
Old March 14th, 2013, 12:28 PM
Registered User
Points: 5, Level: 1
Points: 5, Level: 1 Points: 5, Level: 1 Points: 5, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2013
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default can not reference field in table

I have a connection string set up to point to the database that house my tables that I am working with, however I can not reference a colume needed. I get an error : the name 'xxxx' does not exist in the current context. I have added my code , Please take a look and see if anything jumps out at up..Thanks

Code:
 SqlConnection conn;
        conn.Open();
        SqlCommand cmd;
        string cmdString = ("Select * from cocceo");
        conn = new SqlConnection(@"Data Source=.\SPARE-PC\SQLEXPRESS ;AttachDbFilename=|DataDirectory|\TstCocDB.dbo1;Integrated Security=True;User Instance=true");
        cmd = new SqlCommand(cmdString, conn);
        SqlDataReader myReader;
        List<string> returnData = new List<string>();
        myReader = cmd.ExecuteReader(CommandBehavior.CloseConnection);
        while (myReader.Read())
        {
            returnData.Add(myReader["ceo_LastName"].ToString());
        }
         return returnData;
        if (TextBox1.Text = ceo_Last_Name)
            Response.Redirect("ceo.aspx");
        string cmdString1 = ("INSERT INTO lOGIN,UserName, Password, UserEmail, UserLevel");
        string cmdString2 = ("Update Login, set UserLevel to 1, conn");
        conn.Close();
    }
thanks again
 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Table of contents - reference to 2005? happygv Book: Professional Microsoft SQL Server 2008 Administration ISBN: 978-0-470-24796-9 0 March 28th, 2011 05:13 AM
Using a field reference in a query critereon rmccafferty Access 1 August 13th, 2009 09:05 AM
How to reference field by name dsr771 BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 2 December 21st, 2007 03:49 PM
Reference ADO Recordset Field after CommitTrans U.N.C.L.E. Classic ASP Professional 5 November 21st, 2006 03:20 AM
Does reference to a table change when db split? Loralee Access 2 June 29th, 2005 10:03 PM



All times are GMT -4. The time now is 06:38 AM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.