Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics 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
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old June 12th, 2007, 05:37 PM
Authorized User
Points: 239, Level: 4
Points: 239, Level: 4 Points: 239, Level: 4 Points: 239, Level: 4
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2005
Location: , , .
Posts: 43
Thanks: 0
Thanked 0 Times in 0 Posts
Default Assembly Reference Problem

Hi and thanks for taking a second. I am trying to bind the text property of a label to a datareader in codebehind. VS keeps telling me I am missing assembly references but I believe they are all there . (See the using directives below) I keep getting errors such as the following:

Error 1 The type or namespace name 'SQLDataReader' could not be found (are you missing a using directive or an assembly reference?) C:\Documents and Settings\Jason Livengood\My Documents\Visual Studio 2005\WebSites\JasonLivengood\BeatlesDetails.aspx.c s 27 9 C:\...\JasonLivengood

Error 3 'System.Configuration.ConfigurationSettings.AppSet tings' is a 'property' but is used like a 'method' C:\Documents and Settings\Jason Livengood\My Documents\Visual Studio 2005\WebSites\JasonLivengood\BeatlesDetails.aspx.c s 28 54 C:\...\JasonLivengood

Error 4 The type or namespace name 'SQLConnection' could not be found (are you missing a using directive or an assembly reference?) C:\Documents and Settings\Jason Livengood\My Documents\Visual Studio 2005\WebSites\JasonLivengood\BeatlesDetails.aspx.c s 29 9 C:\...\JasonLivengood

Error 8 The type or namespace name 'SQLCommand' could not be found (are you missing a using directive or an assembly reference?) C:\Documents and Settings\Jason Livengood\My Documents\Visual Studio 2005\WebSites\JasonLivengood\BeatlesDetails.aspx.c s 36 36 C:\...\JasonLivengood\


Any advice or help would be greatly appreciated. - Jason


 using System;

using System.Data;

using System.Configuration;

using System.Collections;

using System.Web;

using System.Web.Security;

using System.Web.UI;

using System.Web.UI.WebControls;

using System.Web.UI.WebControls.WebParts;

using System.Web.UI.HtmlControls;

using System.Data.SqlClient;

using System.Data.Sql;

using System.Data.SqlTypes;



public partial class BeatlesDetails : System.Web.UI.Page

{

protected void Page_Load(object sender, EventArgs e)

{

BindLabel();

}

public void BindLabel()

{



int intID2;

SQLDataReader dtrAlbumn;

string strConnection = ConfigurationSettings.AppSettings("Beatles");

SQLConnection objCon = new SQLConnection(strConnection);

// Retrieve Albumn ID and Albumn pic ID

intID2 = Int32.Parse(Request.QueryString("id"));

//Get Albumn Name

SQLCommand cmdSelect = new SQLCommand("usp_Retrieve_Albumn_Title", objCon);

cmdSelect.CommandType = CommandType.StoredProcedure;

cmdSelect.Parameters.Add("@ID", intID2);

objCon.Open();

dtrAlbumn = cmdSelect.ExecuteReader();

if (dtrAlbumn.Read)

{

lblAlbumn.Text = dtrAlbumn("title");

dtrAlbumn.Close();

objCon.Close();

}

}

}
[u]</u>

Reply With Quote
  #2 (permalink)  
Old June 12th, 2007, 09:13 PM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

SQL isn't capitalized, its SqlCommand, SqlConnection, etc.

hth.

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html
================================================== =========
Why can't Programmers, program??
http://www.codinghorror.com/blog/archives/000781.html
================================================== =========
Reply With Quote
  #3 (permalink)  
Old June 12th, 2007, 09:19 PM
Registered User
 
Join Date: Feb 2007
Location: Madison, SD, USA.
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to condescendent Send a message via Yahoo to condescendent
Default

Does it matter if I use capitalized "SQLCommand" instead of "SqlCommand". Hope OP can give us an answer.

I am a database programmer and .Net programmer
Reply With Quote
  #4 (permalink)  
Old June 13th, 2007, 03:16 AM
Friend of Wrox
Points: 1,935, Level: 17
Points: 1,935, Level: 17 Points: 1,935, Level: 17 Points: 1,935, Level: 17
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2004
Location: United Kingdom
Posts: 550
Thanks: 0
Thanked 1 Time in 1 Post
Default

As parsons said, the classes, methods, functions etc are case sensitive, so you cannot use them as you wish, in all caps or all lower. SqlCommand can't be used as SQLCommand.

Regards
Mike

Don't expect too much, too soon.
Reply With Quote
  #5 (permalink)  
Old June 13th, 2007, 11:38 PM
Authorized User
Points: 239, Level: 4
Points: 239, Level: 4 Points: 239, Level: 4 Points: 239, Level: 4
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2005
Location: , , .
Posts: 43
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks- Jason

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
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
missing a using directive or an assembly reference zhshqzyc ASP.NET 2.0 Basics 3 January 13th, 2008 03:50 AM
problem in assembly salnavddin BOOK: ASP.NET Website Programming Problem-Design-Solution 0 July 8th, 2007 05:27 AM
problem with adding reference from 2.0 to 1.1 karthik_byk .NET Framework 2.0 1 May 11th, 2007 07:52 AM
inline assembly on VS2005 c++ PROBLEM Huskey C++ Programming 0 January 24th, 2007 10:58 AM
Object Reference Problem shaileshmark General .NET 3 July 22nd, 2004 04:13 PM



All times are GMT -4. The time now is 01:52 PM.


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