?
Solved

using System.Data namespace in Web Custom Control

Posted on 2004-08-12
4
Medium Priority
?
495 Views
Last Modified: 2008-03-17
Why can't I use System.Data namespace in a web custom control? I am making a reference to the namespace
System.Data in the following snippet

[ToolboxData("<{0}:WebTrailLogger runat=server creator=raza></{0}:WebTrailLogger>")]
public class PWWebTrailLogger
{
// override the DayRender function
public void Log(WEB_AUDIT_TRAIL_INFO info,string userId,string SessionId)
{
try
      {
      DAWebRequestTrail objDA = new DAWebRequestTrail(
            Connection.getConnectionString((int)Constant.CONNECTIONSTRINGLOCATIONS.SETTINGS_XML,
                              (int)Constant.DATABASE.DATABASE1)
                              );
      // Get an Empty Dataset
      DataSet ds = objDA.Get("");
      objDA.Get(userId);
      }
catch(Exception err)
{
      Debug.WriteLine(err.ToString());
}
}
}

But the compiler would not let it go until it sees

using System.Data on the top?

What do I need to do?
0
Comment
Question by:rxraza
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 8

Expert Comment

by:daffodils
ID: 11788126
Instead of the "using..." clause, you might as well use the fully qualified name.. System.Data.DataSet .. etc.
0
 

Author Comment

by:rxraza
ID: 11788370
Yes, of course we can use fully qualified name
like System.Data.DataSet but the problem is in the context of Web Custom Control that namespace is not visible. Does anyone know why?
0
 
LVL 8

Accepted Solution

by:
daffodils earned 300 total points
ID: 11788891
Hmm. I haven't heard of any restrictions regarding use of specific namespaces in composite server controls.

In this article about creating composite server control .. the author uses System.Data.
http://www.wimdows.net/articles/article.aspx?aid=10
0
 

Author Comment

by:rxraza
ID: 11789040
Got it figured out. The namespace does not get included automatically in the references node. It has to manually added.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have developed many web applications with asp & asp.net and to add and use a dropdownlist was always a very simple task, but with the new asp.net, setting the value is a bit tricky and its not similar to the old traditional method. So in this a…
One of the pain points with developing AJAX, JavaScript, JQuery, and other client-side behaviors is that JavaScript doesn’t allow for cross domain request for pulling content. For example, JavaScript code on www.johnchapman.name could not pull conte…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question