473,326 Members | 2,126 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

DataColumn Names not seen in vb.et Module

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
5 1403
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Samantha | last post by:
I am attempting to extract the Font Names from the installed windows fonts. I am having a heck of a time getting these rather than the file names. Examples can be seen by going to Control Panel >...
3
by: Ron_Adam | last post by:
Hi, Sometimes it just helps to see what's going on, so I've been trying to write a tool to examine what names are pointing to what objects in the current scope. This still has some glitches,...
6
by: Mayer | last post by:
Hello: Is there a way to see at the python prompt the names of all the public methods of a class or the names exported by a module? I know that GUI-based IDEs have a nifty way of displaying...
3
by: J | last post by:
Is there anyway to format a calculated datacolumn? I would like the following column to display as money (formatted as $#,##0.00). Or how about simply displaying the column formatted as a number...
10
by: Peter Kirk | last post by:
Hi I am looking at some C# code, and can see in some of the classes there are instance variables whose names start with an underscore, for example: private string _projectId; Is there a...
2
by: Thomas Müller | last post by:
Hi, I need a way to find the names of the computers that are reachable over a network. Ideally when it is executed it should report back wich computernames are present. I have seen one...
4
by: bordsby | last post by:
Situation: I am using an OleDbDataAdapter to fill a DataSet's DataTable with data from an Access database. The DataSet's DataTable is bound to a DataGrid. After the OleDbDataAdapter.Fill method...
1
by: mfunkmann | last post by:
Hi, I recently got an error and I don't know how to fix it: Error 1 'System.Data.DataColumn' does not contain a definition for 'Windows' C:\c#\CsharpPRO\Form1.Designer.cs 304 77 CsharpPRO I...
3
by: DaveP | last post by:
im Trying to set a Datacolumn type for a new table boolean is not working, What is the correct waty //column.DataType = System.Type.GetType"System.Data.SqlTypes.SqlBoolean"); column.DataType...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.