1

i am using both VISUAL WEB DEVELOPER 2010 & VISUAL STUDIO 2012 EXPRESS EDITION. While writing WINDOWS FORMS APPLICATION ... i used only one statement to work with DataSet,DataTable and Datarow.It is,

Imports System.Data.SqlClient

But while developing WEB APPLICATIONS in ASP.NET using VISUAL WEB DEVELOPER 2010 , i had to use 2 statements.They are,

Imports System.Data.SqlClient
Imports System.Data

If i did not import System.Data , DataSet, DataRow, DataTable are not being recognized. What is the reason..?? I heard that BASE CLASS LIBRARY ( BCL ) is same for both windows & web application..??

1
  • Have a look at the references tab in your project. I assume that System.Data is imported by default in VB.NET-winforms applications. You can add other dll's as well there if you don't want to include the imports statement in all your files. Mar 13, 2013 at 16:21

4 Answers 4

1

You should add a reference to the System.Data assembly, that holds the System.Data namespace, including System.Data.SqlClient. Once you added the reference, use

Import System.Data.SqlClient 

for a VB.NET project or

using System.Data.SqlClient;

for a C# project.

The Import / Using statement makes the SqlClient namespace (located in the System.Data assembly) available to your code.

0

goto properties of your project change .net client profile to .net profile now check it

0

in Visual Studio 2010

Step1 - Goto Project Property under Project Menu. Step2 - Under References of the Project Click Add Step3 - Select .Net Tab and select System.Data and OK

:)

0

Go to Properties and Services check "Enable client application services".

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.