PC Review


Reply
 
 
steve
Guest
Posts: n/a
 
      22nd Jul 2003
I am using the SQLHelper class provided in the data
application blocks but I am then trying to Ctype the DS
that is returned into a custom dataSet. I am working in
VB.net can ANYONE please help. I tried merge but I end
up with 2 tables in the ds. My empty one from the
constructor and the one that is returned.


Option Strict On
Option Explicit On

Imports System
Imports System.Data
Imports System.Runtime.Serialization


Namespace Data
<System.ComponentModel.DesignerCategory("Code"),
SerializableAttribute()> Public Class EventListData
Inherits DataSet

'
' Event table constants
'
Public Const EVENTLISTVARIABLES_TABLE As String
= "EventListVariables"
Public Const EVENTID_FIELD As String = "EventId"
Public Const PRODUCERID_FIELD As String
= "ProducerId"
Public Const EVENTNAME_FIELD As String
= "EventName"
Public Const REDIRECTURL As String = "RedirectURL"
Public Const BACKGROUNDURL As String
= "BackGroundURL"
Public Const PAGETITLE As String = "PageTitle"
Public Const POPUPHEIGHT As String = "PopUpHeight"
Public Const POPUPWIDTH As String = "PopUoWidth"
Public Const DOWNLOAD As String = "DoenLoad"


'Public Const INVALID_FIELD As String = "Invalid
Field"
'Public Const INVALID_FIELDS As String = "Invalid
Fields"

'-------------------------------------------------
---------------
' Sub New:
' Constructor to support serialization.
'-------------------------------------------------
---------------

Public Sub New(ByVal info As SerializationInfo,
ByVal context As StreamingContext)
MyBase.New(info, context)
End Sub


'-------------------------------------------------
---------------
' Sub New:
' Initialize a CategoryData instance by
building the table schema.
'-------------------------------------------------
---------------
Public Sub New()
MyBase.New()
'
' Create the tables in the dataset
'
BuildDataTables()
End Sub


'-------------------------------------------------
---------------
' Sub BuildDataTables:
' Creates the following datatables: Event
'-------------------------------------------------
---------------
Private Sub BuildDataTables()
'Create the tabe that will be returned
' Create the Event table
'
Dim table As DataTable = New DataTable
(Me.EVENTLISTVARIABLES_TABLE)
With table.Columns
.Add(EVENTID_FIELD, GetType(System.Int32))
.Add(PRODUCERID_FIELD, GetType
(System.Int32))
.Add(EVENTNAME_FIELD, GetType
(System.String))
.Add(REDIRECTURL, GetType(System.String))
.Add(BACKGROUNDURL, GetType
(System.String))
.Add(PAGETITLE, GetType(System.String))
.Add(POPUPHEIGHT, GetType(System.Int32))
.Add(POPUPWIDTH, GetType(System.Int32))
.Add(DOWNLOAD, GetType(System.String))
End With
'add the table
Me.Tables.Add(table)
End Sub
End Class
End Namespace

 
Reply With Quote
 
 
 
 
Scot Rose [MSFT]
Guest
Posts: n/a
 
      23rd Jul 2003
Do you have a complete project that you could send to me to look at?

Want to know more? Check out the MSDN Library at http://msdn.microsoft.com or the Microsoft Knowledge Base at http://support.microsoft.com

Scot Rose, MCSD
Microsoft Visual Basic Developer Support
Email : (E-Mail Removed) <Remove word online. from address>

This posting is provided “AS IS”, with no warranties, and confers no rights.




--------------------
>Content-Class: urn:content-classes:message
>From: "steve" <(E-Mail Removed)>
>Sender: "steve" <(E-Mail Removed)>
>Subject: datasets
>Date: Mon, 21 Jul 2003 17:40:36 -0700
>Lines: 106
>Message-ID: <066001c34fe9$de02de10$(E-Mail Removed)>
>MIME-Version: 1.0
>Content-Type: text/plain;
> charset="iso-8859-1"
>Content-Transfer-Encoding: 7bit
>X-Newsreader: Microsoft CDO for Windows 2000
>X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
>Thread-Index: AcNP6d4C+N+oTXwXQbGl6/n3qApwMg==
>Newsgroups: microsoft.public.dotnet.framework.adonet
>Path: cpmsftngxa06.phx.gbl
>Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.adonet:56378
>NNTP-Posting-Host: TK2MSFTNGXA11 10.40.1.163
>X-Tomcat-NG: microsoft.public.dotnet.framework.adonet
>
>I am using the SQLHelper class provided in the data
>application blocks but I am then trying to Ctype the DS
>that is returned into a custom dataSet. I am working in
>VB.net can ANYONE please help. I tried merge but I end
>up with 2 tables in the ds. My empty one from the
>constructor and the one that is returned.
>
>
>Option Strict On
>Option Explicit On
>
>Imports System
>Imports System.Data
>Imports System.Runtime.Serialization
>
>
>Namespace Data
> <System.ComponentModel.DesignerCategory("Code"),
>SerializableAttribute()> Public Class EventListData
> Inherits DataSet
>
> '
> ' Event table constants
> '
> Public Const EVENTLISTVARIABLES_TABLE As String
>= "EventListVariables"
> Public Const EVENTID_FIELD As String = "EventId"
> Public Const PRODUCERID_FIELD As String
>= "ProducerId"
> Public Const EVENTNAME_FIELD As String
>= "EventName"
> Public Const REDIRECTURL As String = "RedirectURL"
> Public Const BACKGROUNDURL As String
>= "BackGroundURL"
> Public Const PAGETITLE As String = "PageTitle"
> Public Const POPUPHEIGHT As String = "PopUpHeight"
> Public Const POPUPWIDTH As String = "PopUoWidth"
> Public Const DOWNLOAD As String = "DoenLoad"
>
>
> 'Public Const INVALID_FIELD As String = "Invalid
>Field"
> 'Public Const INVALID_FIELDS As String = "Invalid
>Fields"
>
> '-------------------------------------------------
>---------------
> ' Sub New:
> ' Constructor to support serialization.
> '-------------------------------------------------
>---------------
>
> Public Sub New(ByVal info As SerializationInfo,
>ByVal context As StreamingContext)
> MyBase.New(info, context)
> End Sub
>
>
> '-------------------------------------------------
>---------------
> ' Sub New:
> ' Initialize a CategoryData instance by
>building the table schema.
> '-------------------------------------------------
>---------------
> Public Sub New()
> MyBase.New()
> '
> ' Create the tables in the dataset
> '
> BuildDataTables()
> End Sub
>
>
> '-------------------------------------------------
>---------------
> ' Sub BuildDataTables:
> ' Creates the following datatables: Event
> '-------------------------------------------------
>---------------
> Private Sub BuildDataTables()
> 'Create the tabe that will be returned
> ' Create the Event table
> '
> Dim table As DataTable = New DataTable
>(Me.EVENTLISTVARIABLES_TABLE)
> With table.Columns
> .Add(EVENTID_FIELD, GetType(System.Int32))
> .Add(PRODUCERID_FIELD, GetType
>(System.Int32))
> .Add(EVENTNAME_FIELD, GetType
>(System.String))
> .Add(REDIRECTURL, GetType(System.String))
> .Add(BACKGROUNDURL, GetType
>(System.String))
> .Add(PAGETITLE, GetType(System.String))
> .Add(POPUPHEIGHT, GetType(System.Int32))
> .Add(POPUPWIDTH, GetType(System.Int32))
> .Add(DOWNLOAD, GetType(System.String))
> End With
> 'add the table
> Me.Tables.Add(table)
> End Sub
> End Class
>End Namespace
>
>



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do Datasets manage to get deserialized as DataSets instead of a wsdl.exe-created proxy class? Francisco Garcia Microsoft ASP .NET 2 13th Apr 2006 11:41 AM
How do Datasets manage to get deserialized as DataSets instead of a wsdl.exe-created proxy class? news.microsoft.com Microsoft ASP .NET 0 12th Apr 2006 10:07 AM
Discussion: Typet DataSets vs Untyped DataSets Przemo Microsoft VB .NET 11 3rd Sep 2004 07:58 AM
Typed DataSets returned as regular datasets =?Utf-8?B?Sm9uIEtpbmc=?= Microsoft ADO .NET 2 29th Aug 2004 01:41 AM
Converting Untyped Datasets into Strongly Typed Datasets with Foreign Key Constraints. Alex Berryhill Microsoft ADO .NET 2 19th Mar 2004 02:20 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:15 PM.