문제

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..??

도움이 되었습니까?

해결책

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.

다른 팁

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

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

:)

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top