Solved

using System.Data namespace in Web Custom Control

Posted on 2004-08-12
4
490 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
  • 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 100 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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Suggested Solutions

User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

773 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