By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,247 Members | 1,057 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,247 IT Pros & Developers. It's quick & easy.

DataColumn Names not seen in vb.et Module

P: n/a
I've created a AlertDataClass below within the class I have tables and column that I've create. In the AlertDataAccess class I'm trying to insert data into my tables. AlertDataAccess is a Module that is trying to insert data into the tables. Within the AlertDataClass is subroutine that init and creates ColumnNames. In invoke the AddDataColumnNames() sub to create the column headers.

Why can't I see the column names in my module that I'm trying to insert data into?
It appears that CriteriaAlert subroutine can not see the table column that have been created. I do initisate the AlertDataClass

Public Class AlertDataClass
' create Dataset and Tables
Public AlertDS As DataSet = New DataSet("AlertTables")
Public EventCriteriaTable As DataTable = AlertDS.Tables.Add("EventCriteria")
Public MinGPSHistoryTable As DataTable = AlertDS.Tables.Add("MinGPSHistory")
Public EventLogTable As DataTable = AlertDS.Tables.Add("EventLog")
Dim AlertVar As New AlertVariables

Public Sub AddDataColumnNames()

'Add Column Names for Criteria and Command Data

'Set Column Properties
Dim CriteriaColumnHeader As DataColumn = New DataColumn
CriteriaColumnHeader.DataType = System.Type.GetType("System.String")
CriteriaColumnHeader.AllowDBNull = False

' Add the Column Header to the table.
CriteriaColumnHeader.ColumnName = "CriteriaID"
EventCriteriaTable.Columns.Add(CriteriaColumnHeade r)
CriteriaColumnHeader.ColumnName = "Min_Num"
EventCriteriaTable.Columns.Add(CriteriaColumnHeade r)
CriteriaColumnHeader.ColumnName = "ReportingFrequenecy"
EventCriteriaTable.Columns.Add(CriteriaColumnHeade r)
CriteriaColumnHeader.ColumnName = "TimeToLiveStartDate"
EventCriteriaTable.Columns.Add(CriteriaColumnHeade r)
CriteriaColumnHeader.ColumnName = "TimeToLiveStartTime"
EventCriteriaTable.Columns.Add(CriteriaColumnHeade r)
CriteriaColumnHeader.ColumnName = "TimeToLiveStopDate"
EventCriteriaTable.Columns.Add(CriteriaColumnHeade r)
CriteriaColumnHeader.ColumnName = "TimeToLiveStopTime"
EventCriteriaTable.Columns.Add(CriteriaColumnHeade r)
end class
Module DataAccessClass

Dim AlertData As New AlertDataClass
Dim AlertVar As New AlertVariables
Dim Alerts = AlertData
Dim MessageProcessing As New SageQuestMailer
Sub CriteriaAlert

AddDataColumnNames()
CriteriaDBConnection.Open()

Dim CriteriaReader As SqlDataReader = CriteriaCMD.ExecuteReader(CommandBehavior.CloseCon nection)

If CriteriaReader.HasRows Then
NoData = False 'Data is available
While CriteriaReader.Read()
' Add Column Names and Row Data to Table

CriteriaRow = AlertData.EventCriteriaTable.NewRow() ' Create a New Row
CriteriaRow("CriteriaID") = CriteriaReader.GetSqlValue(0)
CriteriaRow("Min_Num") = CriteriaReader.GetSqlValue(1)
CriteriaRow("ReportingFrequenecy") = CriteriaReader.GetSqlValue(2)
CriteriaRow("TimeToLiveStartDate") = CriteriaReader.GetSqlValue(3)
CriteriaRow("TimeToLiveStartTime") = CriteriaReader.GetSqlValue(4)
CriteriaRow("TimeToLiveStopDate") = CriteriaReader.GetSqlValue(5)
CriteriaRow("TimeToLiveStopTime") = CriteriaReader.GetSqlValue(6)
end sub
end Module

Thanks

Nov 20 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
What do you mean when you say you cant 'see' the columns ?, are you
displaying them in a DataGrid?, if so have you enabled the display of the
column names ?

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .

Time flies when you don't know what you're doing

"Larry Bird" <La*******@discussions.microsoft.com> wrote in message
news:BC**********************************@microsof t.com...
I've created a AlertDataClass below within the class I have tables and column that I've create. In the AlertDataAccess class I'm trying to insert
data into my tables. AlertDataAccess is a Module that is trying to insert
data into the tables. Within the AlertDataClass is subroutine that init and
creates ColumnNames. In invoke the AddDataColumnNames() sub to create the
column headers.
Why can't I see the column names in my module that I'm trying to insert data into?

It appears that CriteriaAlert subroutine can not see the table column that have been created. I do initisate the AlertDataClass
Public Class AlertDataClass
' create Dataset and Tables
Public AlertDS As DataSet = New DataSet("AlertTables")
Public EventCriteriaTable As DataTable = AlertDS.Tables.Add("EventCriteria") Public MinGPSHistoryTable As DataTable = AlertDS.Tables.Add("MinGPSHistory") Public EventLogTable As DataTable = AlertDS.Tables.Add("EventLog")
Dim AlertVar As New AlertVariables

Public Sub AddDataColumnNames()

'Add Column Names for Criteria and Command Data

'Set Column Properties
Dim CriteriaColumnHeader As DataColumn = New DataColumn
CriteriaColumnHeader.DataType = System.Type.GetType("System.String") CriteriaColumnHeader.AllowDBNull = False

' Add the Column Header to the table.
CriteriaColumnHeader.ColumnName = "CriteriaID"
EventCriteriaTable.Columns.Add(CriteriaColumnHeade r)
CriteriaColumnHeader.ColumnName = "Min_Num"
EventCriteriaTable.Columns.Add(CriteriaColumnHeade r)
CriteriaColumnHeader.ColumnName = "ReportingFrequenecy"
EventCriteriaTable.Columns.Add(CriteriaColumnHeade r)
CriteriaColumnHeader.ColumnName = "TimeToLiveStartDate"
EventCriteriaTable.Columns.Add(CriteriaColumnHeade r)
CriteriaColumnHeader.ColumnName = "TimeToLiveStartTime"
EventCriteriaTable.Columns.Add(CriteriaColumnHeade r)
CriteriaColumnHeader.ColumnName = "TimeToLiveStopDate"
EventCriteriaTable.Columns.Add(CriteriaColumnHeade r)
CriteriaColumnHeader.ColumnName = "TimeToLiveStopTime"
EventCriteriaTable.Columns.Add(CriteriaColumnHeade r)
end class
Module DataAccessClass

Dim AlertData As New AlertDataClass
Dim AlertVar As New AlertVariables
Dim Alerts = AlertData
Dim MessageProcessing As New SageQuestMailer
Sub CriteriaAlert

AddDataColumnNames()
CriteriaDBConnection.Open()

Dim CriteriaReader As SqlDataReader = CriteriaCMD.ExecuteReader(CommandBehavior.CloseCon nection)
If CriteriaReader.HasRows Then
NoData = False 'Data is available
While CriteriaReader.Read()
' Add Column Names and Row Data to Table

CriteriaRow = AlertData.EventCriteriaTable.NewRow() ' Create a New Row CriteriaRow("CriteriaID") = CriteriaReader.GetSqlValue(0)
CriteriaRow("Min_Num") = CriteriaReader.GetSqlValue(1)
CriteriaRow("ReportingFrequenecy") = CriteriaReader.GetSqlValue(2) CriteriaRow("TimeToLiveStartDate") = CriteriaReader.GetSqlValue(3) CriteriaRow("TimeToLiveStartTime") = CriteriaReader.GetSqlValue(4) CriteriaRow("TimeToLiveStopDate") = CriteriaReader.GetSqlValue(5) CriteriaRow("TimeToLiveStopTime") = CriteriaReader.GetSqlValue(6) end sub
end Module

Thanks

Nov 20 '05 #2

P: n/a
What I mean is I have the datatables create in a data class and I also create the colum names within a subroutine in the same data class.

I have a module which is my data access class, which I load data into the columns using the column names create above. It appears that I'm unable to access the columns within my data access class.

Within the data access class I inistitate the the data class as follows:

Dim AlertData As New AlertDataClass
Dim AlertVar As New AlertVariables
Dim Alerts = AlertData
Dim MessageProcessing As New SageQuestMailer

At this point shouldn't I be able to add row data? My subroutine "CriteriaAlert" does just that.

I've been working this for a couple of days and running out of time. Thanks
"One Handed Man ( OHM - Terry Burns )" wrote:
What do you mean when you say you cant 'see' the columns ?, are you
displaying them in a DataGrid?, if so have you enabled the display of the
column names ?

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .

Time flies when you don't know what you're doing

"Larry Bird" <La*******@discussions.microsoft.com> wrote in message
news:BC**********************************@microsof t.com...
I've created a AlertDataClass below within the class I have tables and

column that I've create. In the AlertDataAccess class I'm trying to insert
data into my tables. AlertDataAccess is a Module that is trying to insert
data into the tables. Within the AlertDataClass is subroutine that init and
creates ColumnNames. In invoke the AddDataColumnNames() sub to create the
column headers.

Why can't I see the column names in my module that I'm trying to insert

data into?


It appears that CriteriaAlert subroutine can not see the table column that

have been created. I do initisate the AlertDataClass

Public Class AlertDataClass
' create Dataset and Tables
Public AlertDS As DataSet = New DataSet("AlertTables")
Public EventCriteriaTable As DataTable =

AlertDS.Tables.Add("EventCriteria")
Public MinGPSHistoryTable As DataTable =

AlertDS.Tables.Add("MinGPSHistory")
Public EventLogTable As DataTable = AlertDS.Tables.Add("EventLog")
Dim AlertVar As New AlertVariables

Public Sub AddDataColumnNames()

'Add Column Names for Criteria and Command Data

'Set Column Properties
Dim CriteriaColumnHeader As DataColumn = New DataColumn
CriteriaColumnHeader.DataType =

System.Type.GetType("System.String")
CriteriaColumnHeader.AllowDBNull = False

' Add the Column Header to the table.
CriteriaColumnHeader.ColumnName = "CriteriaID"
EventCriteriaTable.Columns.Add(CriteriaColumnHeade r)
CriteriaColumnHeader.ColumnName = "Min_Num"
EventCriteriaTable.Columns.Add(CriteriaColumnHeade r)
CriteriaColumnHeader.ColumnName = "ReportingFrequenecy"
EventCriteriaTable.Columns.Add(CriteriaColumnHeade r)
CriteriaColumnHeader.ColumnName = "TimeToLiveStartDate"
EventCriteriaTable.Columns.Add(CriteriaColumnHeade r)
CriteriaColumnHeader.ColumnName = "TimeToLiveStartTime"
EventCriteriaTable.Columns.Add(CriteriaColumnHeade r)
CriteriaColumnHeader.ColumnName = "TimeToLiveStopDate"
EventCriteriaTable.Columns.Add(CriteriaColumnHeade r)
CriteriaColumnHeader.ColumnName = "TimeToLiveStopTime"
EventCriteriaTable.Columns.Add(CriteriaColumnHeade r)
end class
Module DataAccessClass

Dim AlertData As New AlertDataClass
Dim AlertVar As New AlertVariables
Dim Alerts = AlertData
Dim MessageProcessing As New SageQuestMailer
Sub CriteriaAlert

AddDataColumnNames()
CriteriaDBConnection.Open()

Dim CriteriaReader As SqlDataReader =

CriteriaCMD.ExecuteReader(CommandBehavior.CloseCon nection)

If CriteriaReader.HasRows Then
NoData = False 'Data is available
While CriteriaReader.Read()
' Add Column Names and Row Data to Table

CriteriaRow = AlertData.EventCriteriaTable.NewRow() '

Create a New Row
CriteriaRow("CriteriaID") = CriteriaReader.GetSqlValue(0)
CriteriaRow("Min_Num") = CriteriaReader.GetSqlValue(1)
CriteriaRow("ReportingFrequenecy") =

CriteriaReader.GetSqlValue(2)
CriteriaRow("TimeToLiveStartDate") =

CriteriaReader.GetSqlValue(3)
CriteriaRow("TimeToLiveStartTime") =

CriteriaReader.GetSqlValue(4)
CriteriaRow("TimeToLiveStopDate") =

CriteriaReader.GetSqlValue(5)
CriteriaRow("TimeToLiveStopTime") =

CriteriaReader.GetSqlValue(6)
end sub
end Module

Thanks


Nov 20 '05 #3

P: n/a
In the Module DataAccessClass

AlertaData.AddDataColumnNames()

not

AddDataColumnNames()
--

OHM ( Terry Burns )
. . . One-Handed-Man . . .

Time flies when you don't know what you're doing

"Larry Bird" <La*******@discussions.microsoft.com> wrote in message
news:F2**********************************@microsof t.com...
What I mean is I have the datatables create in a data class and I also create the colum names within a subroutine in the same data class.
I have a module which is my data access class, which I load data into the columns using the column names create above. It appears that I'm unable to
access the columns within my data access class.
Within the data access class I inistitate the the data class as follows:

Dim AlertData As New AlertDataClass
Dim AlertVar As New AlertVariables
Dim Alerts = AlertData
Dim MessageProcessing As New SageQuestMailer

At this point shouldn't I be able to add row data? My subroutine "CriteriaAlert" does just that.
I've been working this for a couple of days and running out of time. Thanks

"One Handed Man ( OHM - Terry Burns )" wrote:
What do you mean when you say you cant 'see' the columns ?, are you
displaying them in a DataGrid?, if so have you enabled the display of the column names ?

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .

Time flies when you don't know what you're doing

"Larry Bird" <La*******@discussions.microsoft.com> wrote in message
news:BC**********************************@microsof t.com...
I've created a AlertDataClass below within the class I have tables and

column that I've create. In the AlertDataAccess class I'm trying to insert data into my tables. AlertDataAccess is a Module that is trying to insert data into the tables. Within the AlertDataClass is subroutine that init and creates ColumnNames. In invoke the AddDataColumnNames() sub to create the column headers.

Why can't I see the column names in my module that I'm trying to insert
data into?


It appears that CriteriaAlert subroutine can not see the table column
that have been created. I do initisate the AlertDataClass

Public Class AlertDataClass
' create Dataset and Tables
Public AlertDS As DataSet = New DataSet("AlertTables")
Public EventCriteriaTable As DataTable =

AlertDS.Tables.Add("EventCriteria")
Public MinGPSHistoryTable As DataTable =

AlertDS.Tables.Add("MinGPSHistory")
Public EventLogTable As DataTable = AlertDS.Tables.Add("EventLog")
Dim AlertVar As New AlertVariables

Public Sub AddDataColumnNames()

'Add Column Names for Criteria and Command Data

'Set Column Properties
Dim CriteriaColumnHeader As DataColumn = New DataColumn
CriteriaColumnHeader.DataType =

System.Type.GetType("System.String")
CriteriaColumnHeader.AllowDBNull = False

' Add the Column Header to the table.
CriteriaColumnHeader.ColumnName = "CriteriaID"
EventCriteriaTable.Columns.Add(CriteriaColumnHeade r)
CriteriaColumnHeader.ColumnName = "Min_Num"
EventCriteriaTable.Columns.Add(CriteriaColumnHeade r)
CriteriaColumnHeader.ColumnName = "ReportingFrequenecy"
EventCriteriaTable.Columns.Add(CriteriaColumnHeade r)
CriteriaColumnHeader.ColumnName = "TimeToLiveStartDate"
EventCriteriaTable.Columns.Add(CriteriaColumnHeade r)
CriteriaColumnHeader.ColumnName = "TimeToLiveStartTime"
EventCriteriaTable.Columns.Add(CriteriaColumnHeade r)
CriteriaColumnHeader.ColumnName = "TimeToLiveStopDate"
EventCriteriaTable.Columns.Add(CriteriaColumnHeade r)
CriteriaColumnHeader.ColumnName = "TimeToLiveStopTime"
EventCriteriaTable.Columns.Add(CriteriaColumnHeade r)
end class
Module DataAccessClass

Dim AlertData As New AlertDataClass
Dim AlertVar As New AlertVariables
Dim Alerts = AlertData
Dim MessageProcessing As New SageQuestMailer
Sub CriteriaAlert

AddDataColumnNames()
CriteriaDBConnection.Open()

Dim CriteriaReader As SqlDataReader =

CriteriaCMD.ExecuteReader(CommandBehavior.CloseCon nection)

If CriteriaReader.HasRows Then
NoData = False 'Data is available
While CriteriaReader.Read()
' Add Column Names and Row Data to Table

CriteriaRow = AlertData.EventCriteriaTable.NewRow() '

Create a New Row
CriteriaRow("CriteriaID") =

CriteriaReader.GetSqlValue(0) CriteriaRow("Min_Num") = CriteriaReader.GetSqlValue(1)
CriteriaRow("ReportingFrequenecy") =

CriteriaReader.GetSqlValue(2)
CriteriaRow("TimeToLiveStartDate") =

CriteriaReader.GetSqlValue(3)
CriteriaRow("TimeToLiveStartTime") =

CriteriaReader.GetSqlValue(4)
CriteriaRow("TimeToLiveStopDate") =

CriteriaReader.GetSqlValue(5)
CriteriaRow("TimeToLiveStopTime") =

CriteriaReader.GetSqlValue(6)
end sub
end Module

Thanks


Nov 20 '05 #4

P: n/a
I tried that before posting this. When the class name is removed I get an intellsense error that the sub is not defined. The basics of what I trying to accomplish here is that I have datatables that I create and assign column names to in one class/AlertData class and in another class/AlertDataAccess class(Module) I want to read and add data to those tables. a

I apprecitate all of your help and I still trying to get things working.

How do I tell VB.NET that the datatables and column names can be accessed by any subroutine or fucntion within my project?
"One Handed Man ( OHM - Terry Burns )" wrote:
In the Module DataAccessClass

AlertaData.AddDataColumnNames()

not

AddDataColumnNames()
--

OHM ( Terry Burns )
. . . One-Handed-Man . . .

Time flies when you don't know what you're doing

"Larry Bird" <La*******@discussions.microsoft.com> wrote in message
news:F2**********************************@microsof t.com...
What I mean is I have the datatables create in a data class and I also

create the colum names within a subroutine in the same data class.

I have a module which is my data access class, which I load data into the

columns using the column names create above. It appears that I'm unable to
access the columns within my data access class.

Within the data access class I inistitate the the data class as follows:

Dim AlertData As New AlertDataClass
Dim AlertVar As New AlertVariables
Dim Alerts = AlertData
Dim MessageProcessing As New SageQuestMailer

At this point shouldn't I be able to add row data? My subroutine

"CriteriaAlert" does just that.

I've been working this for a couple of days and running out of time.

Thanks


"One Handed Man ( OHM - Terry Burns )" wrote:
What do you mean when you say you cant 'see' the columns ?, are you
displaying them in a DataGrid?, if so have you enabled the display of the column names ?

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .

Time flies when you don't know what you're doing

"Larry Bird" <La*******@discussions.microsoft.com> wrote in message
news:BC**********************************@microsof t.com...
> I've created a AlertDataClass below within the class I have tables and
column that I've create. In the AlertDataAccess class I'm trying to insert data into my tables. AlertDataAccess is a Module that is trying to insert data into the tables. Within the AlertDataClass is subroutine that init and creates ColumnNames. In invoke the AddDataColumnNames() sub to create the column headers.
>
> Why can't I see the column names in my module that I'm trying to insert data into?
>
>
> It appears that CriteriaAlert subroutine can not see the table column that have been created. I do initisate the AlertDataClass
>
> Public Class AlertDataClass
> ' create Dataset and Tables
> Public AlertDS As DataSet = New DataSet("AlertTables")
> Public EventCriteriaTable As DataTable =
AlertDS.Tables.Add("EventCriteria")
> Public MinGPSHistoryTable As DataTable =
AlertDS.Tables.Add("MinGPSHistory")
> Public EventLogTable As DataTable = AlertDS.Tables.Add("EventLog")
> Dim AlertVar As New AlertVariables
>
> Public Sub AddDataColumnNames()
>
> 'Add Column Names for Criteria and Command Data
>
> 'Set Column Properties
> Dim CriteriaColumnHeader As DataColumn = New DataColumn
> CriteriaColumnHeader.DataType =
System.Type.GetType("System.String")
> CriteriaColumnHeader.AllowDBNull = False
>
> ' Add the Column Header to the table.
> CriteriaColumnHeader.ColumnName = "CriteriaID"
> EventCriteriaTable.Columns.Add(CriteriaColumnHeade r)
> CriteriaColumnHeader.ColumnName = "Min_Num"
> EventCriteriaTable.Columns.Add(CriteriaColumnHeade r)
> CriteriaColumnHeader.ColumnName = "ReportingFrequenecy"
> EventCriteriaTable.Columns.Add(CriteriaColumnHeade r)
> CriteriaColumnHeader.ColumnName = "TimeToLiveStartDate"
> EventCriteriaTable.Columns.Add(CriteriaColumnHeade r)
> CriteriaColumnHeader.ColumnName = "TimeToLiveStartTime"
> EventCriteriaTable.Columns.Add(CriteriaColumnHeade r)
> CriteriaColumnHeader.ColumnName = "TimeToLiveStopDate"
> EventCriteriaTable.Columns.Add(CriteriaColumnHeade r)
> CriteriaColumnHeader.ColumnName = "TimeToLiveStopTime"
> EventCriteriaTable.Columns.Add(CriteriaColumnHeade r)
> end class
>
>
> Module DataAccessClass
>
> Dim AlertData As New AlertDataClass
> Dim AlertVar As New AlertVariables
> Dim Alerts = AlertData
> Dim MessageProcessing As New SageQuestMailer
> Sub CriteriaAlert
>
> AddDataColumnNames()
>
>
> CriteriaDBConnection.Open()
>
> Dim CriteriaReader As SqlDataReader =
CriteriaCMD.ExecuteReader(CommandBehavior.CloseCon nection)
>
> If CriteriaReader.HasRows Then
> NoData = False 'Data is available
> While CriteriaReader.Read()
> ' Add Column Names and Row Data to Table
>
> CriteriaRow = AlertData.EventCriteriaTable.NewRow() '
Create a New Row
> CriteriaRow("CriteriaID") = CriteriaReader.GetSqlValue(0) > CriteriaRow("Min_Num") = CriteriaReader.GetSqlValue(1)
> CriteriaRow("ReportingFrequenecy") =
CriteriaReader.GetSqlValue(2)
> CriteriaRow("TimeToLiveStartDate") =
CriteriaReader.GetSqlValue(3)
> CriteriaRow("TimeToLiveStartTime") =
CriteriaReader.GetSqlValue(4)
> CriteriaRow("TimeToLiveStopDate") =
CriteriaReader.GetSqlValue(5)
> CriteriaRow("TimeToLiveStopTime") =
CriteriaReader.GetSqlValue(6)
> end sub
> end Module
>
> Thanks
>


Nov 20 '05 #5

P: n/a
I see what's wrong here. You cant use or assign outside a member function.
Try this

Class Module1

Private c As New Class1

Sub New()

c.AddColumns()

End Sub

End Class
--

OHM ( Terry Burns )
. . . One-Handed-Man . . .

Time flies when you don't know what you're doing

"Larry Bird" <La*******@discussions.microsoft.com> wrote in message
news:54**********************************@microsof t.com...
I tried that before posting this. When the class name is removed I get an intellsense error that the sub is not defined. The basics of what I trying
to accomplish here is that I have datatables that I create and assign column
names to in one class/AlertData class and in another class/AlertDataAccess
class(Module) I want to read and add data to those tables. a
I apprecitate all of your help and I still trying to get things working.

How do I tell VB.NET that the datatables and column names can be accessed by any subroutine or fucntion within my project?

"One Handed Man ( OHM - Terry Burns )" wrote:
In the Module DataAccessClass

AlertaData.AddDataColumnNames()

not

AddDataColumnNames()
--

OHM ( Terry Burns )
. . . One-Handed-Man . . .

Time flies when you don't know what you're doing

"Larry Bird" <La*******@discussions.microsoft.com> wrote in message
news:F2**********************************@microsof t.com...
What I mean is I have the datatables create in a data class and I also

create the colum names within a subroutine in the same data class.

I have a module which is my data access class, which I load data into the
columns using the column names create above. It appears that I'm unable to access the columns within my data access class.

Within the data access class I inistitate the the data class as
follows:
Dim AlertData As New AlertDataClass
Dim AlertVar As New AlertVariables
Dim Alerts = AlertData
Dim MessageProcessing As New SageQuestMailer

At this point shouldn't I be able to add row data? My subroutine

"CriteriaAlert" does just that.

I've been working this for a couple of days and running out of time.

Thanks


"One Handed Man ( OHM - Terry Burns )" wrote:

> What do you mean when you say you cant 'see' the columns ?, are you
> displaying them in a DataGrid?, if so have you enabled the display of the
> column names ?
>
>
>
> --
>
> OHM ( Terry Burns )
> . . . One-Handed-Man . . .
>
> Time flies when you don't know what you're doing
>
> "Larry Bird" <La*******@discussions.microsoft.com> wrote in message
> news:BC**********************************@microsof t.com...
> > I've created a AlertDataClass below within the class I have tables
and > column that I've create. In the AlertDataAccess class I'm trying to

insert
> data into my tables. AlertDataAccess is a Module that is trying to

insert
> data into the tables. Within the AlertDataClass is subroutine that init and
> creates ColumnNames. In invoke the AddDataColumnNames() sub to
create the
> column headers.
> >
> > Why can't I see the column names in my module that I'm trying to

insert
> data into?
> >
> >
> > It appears that CriteriaAlert subroutine can not see the table
column that
> have been created. I do initisate the AlertDataClass
> >
> > Public Class AlertDataClass
> > ' create Dataset and Tables
> > Public AlertDS As DataSet = New DataSet("AlertTables")
> > Public EventCriteriaTable As DataTable =
> AlertDS.Tables.Add("EventCriteria")
> > Public MinGPSHistoryTable As DataTable =
> AlertDS.Tables.Add("MinGPSHistory")
> > Public EventLogTable As DataTable =

AlertDS.Tables.Add("EventLog") > > Dim AlertVar As New AlertVariables
> >
> > Public Sub AddDataColumnNames()
> >
> > 'Add Column Names for Criteria and Command Data
> >
> > 'Set Column Properties
> > Dim CriteriaColumnHeader As DataColumn = New DataColumn
> > CriteriaColumnHeader.DataType =
> System.Type.GetType("System.String")
> > CriteriaColumnHeader.AllowDBNull = False
> >
> > ' Add the Column Header to the table.
> > CriteriaColumnHeader.ColumnName = "CriteriaID"
> > EventCriteriaTable.Columns.Add(CriteriaColumnHeade r)
> > CriteriaColumnHeader.ColumnName = "Min_Num"
> > EventCriteriaTable.Columns.Add(CriteriaColumnHeade r)
> > CriteriaColumnHeader.ColumnName = "ReportingFrequenecy"
> > EventCriteriaTable.Columns.Add(CriteriaColumnHeade r)
> > CriteriaColumnHeader.ColumnName = "TimeToLiveStartDate"
> > EventCriteriaTable.Columns.Add(CriteriaColumnHeade r)
> > CriteriaColumnHeader.ColumnName = "TimeToLiveStartTime"
> > EventCriteriaTable.Columns.Add(CriteriaColumnHeade r)
> > CriteriaColumnHeader.ColumnName = "TimeToLiveStopDate"
> > EventCriteriaTable.Columns.Add(CriteriaColumnHeade r)
> > CriteriaColumnHeader.ColumnName = "TimeToLiveStopTime"
> > EventCriteriaTable.Columns.Add(CriteriaColumnHeade r)
> > end class
> >
> >
> > Module DataAccessClass
> >
> > Dim AlertData As New AlertDataClass
> > Dim AlertVar As New AlertVariables
> > Dim Alerts = AlertData
> > Dim MessageProcessing As New SageQuestMailer
> > Sub CriteriaAlert
> >
> > AddDataColumnNames()
> >
> >
> > CriteriaDBConnection.Open()
> >
> > Dim CriteriaReader As SqlDataReader =
> CriteriaCMD.ExecuteReader(CommandBehavior.CloseCon nection)
> >
> > If CriteriaReader.HasRows Then
> > NoData = False 'Data is available
> > While CriteriaReader.Read()
> > ' Add Column Names and Row Data to Table
> >
> > CriteriaRow = AlertData.EventCriteriaTable.NewRow() ' > Create a New Row
> > CriteriaRow("CriteriaID") =

CriteriaReader.GetSqlValue(0)
> > CriteriaRow("Min_Num") = CriteriaReader.GetSqlValue(1) > > CriteriaRow("ReportingFrequenecy") =
> CriteriaReader.GetSqlValue(2)
> > CriteriaRow("TimeToLiveStartDate") =
> CriteriaReader.GetSqlValue(3)
> > CriteriaRow("TimeToLiveStartTime") =
> CriteriaReader.GetSqlValue(4)
> > CriteriaRow("TimeToLiveStopDate") =
> CriteriaReader.GetSqlValue(5)
> > CriteriaRow("TimeToLiveStopTime") =
> CriteriaReader.GetSqlValue(6)
> > end sub
> > end Module
> >
> > Thanks
> >
>
>
>


Nov 20 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.