Wrox Programmer Forums
|
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 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 March 14th, 2013, 11:28 AM
Registered User
 
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





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 04:13 AM
Using a field reference in a query critereon rmccafferty Access 1 August 13th, 2009 08: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 09:03 PM





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