?
Solved

Type 'SQLDataSetCommand' is not defined. ??

Posted on 2003-03-20
3
Medium Priority
?
654 Views
Last Modified: 2012-05-04
Ok, I'm trying to use a Code Behind with a Datagrid that simply pulls info out from a MS SQL DB
However, i get the error: Type 'SQLDataSetCommand' is not defined.  What gives?  I am copying the source code from: http://www.dotnetjunkies.com/tutorials.aspx?tutorialid=54

Also, can you recommend any good sites to learn more about code behind's?  I am looking into 4guysfromrolla now.

THANKS!



Here is my code:

Option Strict Off

Imports System
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.Web.UI.HtmlControls
Imports System.Data
Imports System.Data.SQLClient

Public Class myPage : Inherits Page

     Public myDataGrid As DataGrid
     Public myLabel As Label
     
     Public Property myProp As String
          Get
               Return myLabel.Text
          End Get
          Set
               myLabel.Text = Value
          End Set
     End Property
     
     Public Sub Page_Load(Source As Object, E As EventArgs)
          Dim ds As New DataSet
          Dim dsc As SQLDataSetCommand
          DIM dsc = New SQLDataSetCommand("SELECT CompanyName, ContactName, ContactTitle FROM Customers", _
                                                  "server=localhost;uid=sa;pwd=;database=Northwind;")
          dsc.FillDataSet(ds, "Customers")
          myDataGrid.DataSource = ds.Tables("Customers").DefaultView
          myDataGrid.DataBind()
     End Sub


End Class
0
Comment
Question by:dinodod
[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
3 Comments
 
LVL 10

Expert Comment

by:GoodJun
ID: 8176237
there is no SQLDataSetCommand, use SqlDataAdaper instead
0
 
LVL 10

Accepted Solution

by:
GoodJun earned 1000 total points
ID: 8176247
  Public Sub Page_Load(Source As Object, E As EventArgs)
         Dim ds As New DataSet
         Dim dsc As SQLDataAdapter
         DIM dsc = New SQLDataAdapter("SELECT CompanyName, ContactName, ContactTitle FROM Customers", _
                                                 "server=localhost;uid=sa;pwd=;database=Northwind;")
         dsc.FillDataSet(ds, "Customers")
         myDataGrid.DataSource = ds.Tables("Customers").DefaultView
         myDataGrid.DataBind()
    End Sub
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 9688062
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Answered by GoodJun

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

TheLearnedOne
EE Cleanup Volunteer
0

Featured Post

Interactive Way of Training for the AWS CSA Exam

An interactive way of learning that will help you visualize core concepts so that you can be more effective when taking your AWS certification exam.  Built for students by a student to help them understand the concepts that they are being taught.

Question has a verified solution.

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

Recently while returning home from work my wife (another .NET developer) was murmuring something. On further poking she said that she has been assigned a task where she has to serialize and deserialize objects and she is afraid of serialization. Wha…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

777 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