datasets

S

steve

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
 
S

Scot Rose [MSFT]

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 address removed) <Remove word online. from address>

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




--------------------
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top