Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx thread: System.Data.SQL


Message #1 by "Neil Marshall" <neilm@c...> on Thu, 28 Jun 2001 21:22:18
Hi,



Visual Studio.NET 2 is installed on my Windows Server 2000 machine.  I 

have a copy of Introduction to .NET.



I copied a code sample for DataGrid from the chapter 7 on page 212.  The 

problem I am experiencing is that the namespace of system.data.sql is not 

defined when the page is loaded.  I tried system.data.ado and still get 

the same error.



Wonder if you could help me out.



Thanks,



Neil
Message #2 by "Juan T. Llibre" <j.llibre@c...> on Thu, 28 Jun 2001 17:47:04 -0400
Use  :



System.Data.SqlClient



Also, check http://www.123aspx.com/b1to2changes/default.asp

for more changes...



regards,





Juan T. Llibre

Microsoft MVP [IIS/ASP]

==================

----- Original Message -----

From: "Neil Marshall" <neilm@c...>

To: "ASP+" <aspx@p...>

Sent: Thursday, June 28, 2001 9:22 PM

Subject: [aspx] System.Data.SQL





> Hi,

>

> Visual Studio.NET 2 is installed on my Windows Server 2000 machine.  I

> have a copy of Introduction to .NET.

>

> I copied a code sample for DataGrid from the chapter 7 on page 212.  The

> problem I am experiencing is that the namespace of system.data.sql is not

> defined when the page is loaded.  I tried system.data.ado and still get

> the same error.

>

> Wonder if you could help me out.

>

> Thanks,

>

> Neil

> ---

> * Fast, Full-Featured Microsoft® Excel Web Reports & Charts!

> A breakthrough in high performance Web application development,

SoftArtisans

> ExcelWriter 1.1 supports native Excel charting, image insertion, and

> advanced functions & formatting. One click generates presentation-quality

> Excel spreadsheets-and ExcelWriter performs over 100 times faster than the

> Excel Object. Several editions, including ExcelWriterFREE, are available.

> http://www.softartisans.com/softartisans/excelwriter.html>




>



Message #3 by "George Saliba" <georges@c...> on Thu, 28 Jun 2001 14:27:30 -0700
The book you ahve is using Beta 1 while the code you're writing is Beta

2. In Beta 2 System.Data.SQL was changed to System.Data.SqlClient and

System.Data.ADO was changed to System.Data.OleDb. Many things have

changed since your book was written so you may want to get a new one, or

look for code online.



George Saliba



-----Original Message-----

From: Neil Marshall [mailto:neilm@c...]

Sent: Thursday, June 28, 2001 2:22 PM

To: ASP+

Subject: [aspx] System.Data.SQL





Hi,



Visual Studio.NET 2 is installed on my Windows Server 2000 machine.  I

have a copy of Introduction to .NET.



I copied a code sample for DataGrid from the chapter 7 on page 212.  The



problem I am experiencing is that the namespace of system.data.sql is

not

defined when the page is loaded.  I tried system.data.ado and still get

the same error.



Wonder if you could help me out.



Thanks,



Neil

Message #4 by "Daniel Anderson" <dcanderson@u...> on Thu, 28 Jun 2001 15:25:47 -0600
Neil,

System.SQL is now System.Data.SqlClient (CASE SENSITIVE!!!)



ADO is now System.Data.OleDb (also CASE SENSITIVE)



hth



Dan Anderson







----- Original Message -----

From: "Neil Marshall" <neilm@c...>

To: "ASP+" <aspx@p...>

Sent: Thursday, June 28, 2001 9:22 PM

Subject: [aspx] System.Data.SQL





> Hi,

>

> Visual Studio.NET 2 is installed on my Windows Server 2000 machine.  I

> have a copy of Introduction to .NET.

>

> I copied a code sample for DataGrid from the chapter 7 on page 212.  The

> problem I am experiencing is that the namespace of system.data.sql is not

> defined when the page is loaded.  I tried system.data.ado and still get

> the same error.

>

> Wonder if you could help me out.

>

> Thanks,

>

> Neil

Message #5 by "Neil Marshall" <neilm@c...> on Thu, 28 Jun 2001 22:38:09
Sorry for the previous message.  The correct error is:



The namespace or type 'SQL' for the import 'System.Data.SQL' cannot be 

found.



Imports System.Data.SQL

        ~~~~~~~~~~~~~~~



Does it means that the DLL could not be located or isn't existing, right?



> Hi,

> 

> Visual Studio.NET 2 is installed on my Windows Server 2000 machine.  I 

> have a copy of Introduction to .NET.

> 

> I copied a code sample for DataGrid from the chapter 7 on page 212.  The 

> problem I am experiencing is that the namespace of system.data.sql is 

not 

> defined when the page is loaded.  I tried system.data.ado and still get 

> the same error.

> 

> Wonder if you could help me out.

> 

> Thanks,

> 

> Neil
Message #6 by "Neil Marshall" <neilm@c...> on Thu, 28 Jun 2001 23:24:43
Hi,



Finally, the import seems working perfectly.  However, the next new error 

is here:



Compiler Error Message: BC30311: A value of 

type 'System.Data.SqlClient.SqlConnection' cannot be converted 

to 'System.Data.SqlClient.SqlDataAdapter'.



Source Error:



Line 12:     strConnect = "server=c-crash;uid=sa;pwd=;database=pubs"

Line 13:     strCommand = "Select * from Authors"

Line 14:     objConnection = New SQLConnection(strConnect)

Line 15:     objCommand    = New SQLDataSetCommand(strCommand, strConnect)

Line 16:     objCommand.FillDataSet(dsl, "Authors")



I check the website you gave me and am not sure what the best way to do 

set a db connection using objConnectoin.



Thanks,



Neil



> Use  :

> 

> System.Data.SqlClient

> 

> Also, check http://www.123aspx.com/b1to2changes/default.asp

> for more changes...

> 

> regards,

> 

> 

> Juan T. Llibre

> Microsoft MVP [IIS/ASP]

> ==================

> ----- Original Message -----

> From: "Neil Marshall" <neilm@c...>

> To: "ASP+" <aspx@p...>

> Sent: Thursday, June 28, 2001 9:22 PM

> Subject: [aspx] System.Data.SQL

> 

> 

> > Hi,

> >

> > Visual Studio.NET 2 is installed on my Windows Server 2000 machine.  I

> > have a copy of Introduction to .NET.

> >

> > I copied a code sample for DataGrid from the chapter 7 on page 212.  

The

> > problem I am experiencing is that the namespace of system.data.sql is 

not

> > defined when the page is loaded.  I tried system.data.ado and still get

> > the same error.

> >

> > Wonder if you could help me out.

> >

> > Thanks,

> >

> > Neil

Message #7 by =?iso-8859-1?Q?Fredrik_Norm=E9n?= <fredrik.normen@e...> on Fri, 29 Jun 2001 07:49:40 +0200
Hi,



ADO.Net have been changed in beta 2.



Beta 1             Beta 2

System.Data.ADO -> System.Data.OleDb

SYstem.Data.SQL -> System.Data.SqlClient



ADO(Connection, DataSetCommand, Command) -> OleDb(Connection, DataAdapter,

Command)

SQL(Connection, DataSetCommand, Command) -> Sql(Connection, DataAdapter,

Command)



Before:

ADOConnection con = New ADOConnection()

ADODataSetCommand dsCom = New ADODataSetCommand()



Now:

OleDbConnection con = New OleDbConnection()

OleDbDataAdapter dsCom = New OleDbDataAdapter()



/Fredrik Normén





-----Original Message-----

From: Neil Marshall [mailto:neilm@c...]

Sent: den 28 juni 2001 21:22

To: ASP+

Subject: [aspx] System.Data.SQL





Hi,



Visual Studio.NET 2 is installed on my Windows Server 2000 machine.  I

have a copy of Introduction to .NET.



I copied a code sample for DataGrid from the chapter 7 on page 212.  The

problem I am experiencing is that the namespace of system.data.sql is not

defined when the page is loaded.  I tried system.data.ado and still get

the same error.



Wonder if you could help me out.



Thanks,



Neil







Message #8 by "Roger M. Taylor" <rogertaylor@f...> on Thu, 28 Jun 2001 21:09:29 -0400
If all you want to do is fill a datagrid, then from what I have been

reading the Dataset approach was there in Beta1 but beta2 has a much faster



.ExecuteDataReader method and MUCH less code.



there is a sample at http://www.aspng.com/learn/dbopensqlserver.aspx

which I am cutting and pasting here:



<%@ Import Namespace=3D"System.Data.sqlclient" %>

<script language=3D"VB" runat=3D"server">

Sub Page_Load(Src As Object, E As EventArgs)

         Dim strConn as string

=3D"server=3Dsql7.orcsweb.net;uid=3Dstudent;pwd=3Dmagic"

         Dim strSQL as string =3Dselect * from publishers where state=3D'NY'

         Dim Conn as New SQLConnection(strConn)

         Dim Cmd as New SQLCommand(strSQL,Conn)

         Conn.Open()

         myDataGrid.DataSource =3D

Cmd.ExecuteReader(system.data.CommandBehavior.CloseConnection)

         myDataGrid.DataBind()

End Sub

</script>

<html><head>

<title>Grid of New York Data</title>

</head>

<body bgcolor=3D"#FFFFFF">

<font face=3D"Verdana"><h3>New York Data</h3></font>

<

ASP:DataGrid id=3D"MyDataGrid" runat=3D"server"

Width=3D"100%"

BackColor=3D"white"

BorderColor=3D"black"

ShowFooter=3D"false"

CellPadding=3D3

CellSpacing=3D"0"

Font-Name=3D"Verdana"

Font-Size=3D"8pt"

Headerstyle-BackColor=3D"lightblue"

Headerstyle-Font-Size=3D"10pt"

Headerstyle-Font-Style=3D"bold"

MaintainState=3D"false"

/>

</body></html>



At 11:24 PM 6/28/2001 +0000, you wrote:

>Hi,

>

>Finally, the import seems working perfectly.  However, the next new error

>is here:

>

>Compiler Error Message: BC30311: A value of

>type 'System.Data.SqlClient.SqlConnection' cannot be converted

>to 'System.Data.SqlClient.SqlDataAdapter'.

>

>Source Error:

>

>Line 12:     strConnect =3D "server=3Dc-crash;uid=3Dsa;pwd=3D;database=3Dpu

bs"

>Line 13:     strCommand =3D "Select * from Authors"

>Line 14:     objConnection =3D New SQLConnection(strConnect)

>Line 15:     objCommand    =3D New SQLDataSetCommand(strCommand,

 strConnect)

>Line 16:     objCommand.FillDataSet(dsl, "Authors")

>

>I check the website you gave me and am not sure what the best way to do

>set a db connection using objConnectoin.

>

>Thanks,

>

>Neil

>

> > Use  :

> >

> > System.Data.SqlClient

> >

> > Also, check http://www.123aspx.com/b1to2changes/default.asp

> > for more changes...

> >

> > regards,

> >

> >

> > Juan T. Llibre

> > Microsoft MVP [IIS/ASP]

> > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

> > ----- Original Message -----

> > From: "Neil Marshall" <neilm@c...>

> > To: "ASP+" <aspx@p...>

> > Sent: Thursday, June 28, 2001 9:22 PM

> > Subject: [aspx] System.Data.SQL

> >

> >

> > > Hi,

> > >

> > > Visual Studio.NET 2 is installed on my Windows Server 2000 machine.  I

> > > have a copy of Introduction to .NET.

> > >

> > > I copied a code sample for DataGrid from the chapter 7 on page 212.

>The

> > > problem I am experiencing is that the namespace of system.data.sql is

>not

> > > defined when the page is loaded.  I tried system.data.ado and still

 get

> > > the same error.

> > >

> > > Wonder if you could help me out.

> > >

> > > Thanks,

> > >

> > > Neil

>



Message #9 by "George Saliba" <georges@c...> on Thu, 28 Jun 2001 19:41:16 -0700
The problem is that System.Data.SQL was renamed to System.Data.SqlClient

(case sensitive) in Beta 2. You are running Beta 2 (Visual Studio.NET

Beta 2), but your book was written during Beta 1, so its using Beta 1

classes (the ones which were renamed).



George Saliba



-----Original Message-----

From: Neil Marshall [mailto:neilm@c...]

Sent: Thursday, June 28, 2001 3:38 PM

To: ASP+

Subject: [aspx] Re: System.Data.SQL





Sorry for the previous message.  The correct error is:



The namespace or type 'SQL' for the import 'System.Data.SQL' cannot be

found.



Imports System.Data.SQL

        ~~~~~~~~~~~~~~~



Does it means that the DLL could not be located or isn't existing,

right?



> Hi,

>

> Visual Studio.NET 2 is installed on my Windows Server 2000 machine.  I



> have a copy of Introduction to .NET.

>

> I copied a code sample for DataGrid from the chapter 7 on page 212.

The

> problem I am experiencing is that the namespace of system.data.sql is

not

> defined when the page is loaded.  I tried system.data.ado and still

get

> the same error.

>

> Wonder if you could help me out.

>

> Thanks,

>

> Neil







Message #10 by =?iso-8859-1?Q?Fredrik_Norm=E9n?= <fredrik.normen@e...> on Fri, 29 Jun 2001 11:03:09 +0200
Hi,



Look at this:



Rename your DataSetCommand to DataAdapter.

SQLDataSetCommand -> SqlDataAdapter

ADODataSetCommand -> OleDbDataAdapter



Here is an example, I change somelines in your code:



  Line 12:   strConnect = "server=c-crash;uid=sa;pwd=;database=pubs"

  Line 13:   strCommand = "Select * from Authors"

> Line 15:   objCommand = New SQLDataAdapter(strCommand, strConnect)

> Line 16:   objCommand.Fill(dsl, "Authors")





/Fredrik Normén





-----Original Message-----

From: Neil Marshall [mailto:neilm@c...]

Sent: den 28 juni 2001 23:25

To: ASP+

Subject: [aspx] Re: System.Data.SQL





Hi,



Finally, the import seems working perfectly.  However, the next new error

is here:



Compiler Error Message: BC30311: A value of

type 'System.Data.SqlClient.SqlConnection' cannot be converted

to 'System.Data.SqlClient.SqlDataAdapter'.



Source Error:



Line 12:     strConnect = "server=c-crash;uid=sa;pwd=;database=pubs"

Line 13:     strCommand = "Select * from Authors"

Line 14:     objConnection = New SQLConnection(strConnect)

Line 15:     objCommand    = New SQLDataSetCommand(strCommand, strConnect)

Line 16:     objCommand.FillDataSet(dsl, "Authors")



I check the website you gave me and am not sure what the best way to do

set a db connection using objConnectoin.



Thanks,



Neil



> Use  :

>

> System.Data.SqlClient

>

> Also, check http://www.123aspx.com/b1to2changes/default.asp

> for more changes...

>

> regards,

>

>

> Juan T. Llibre

> Microsoft MVP [IIS/ASP]




  Return to Index