473,701 Members | 2,691 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 AddDataColumnNa mes() 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("AlertT ables")
Public EventCriteriaTa ble As DataTable = AlertDS.Tables. Add("EventCrite ria")
Public MinGPSHistoryTa ble As DataTable = AlertDS.Tables. Add("MinGPSHist ory")
Public EventLogTable As DataTable = AlertDS.Tables. Add("EventLog")
Dim AlertVar As New AlertVariables

Public Sub AddDataColumnNa mes()

'Add Column Names for Criteria and Command Data

'Set Column Properties
Dim CriteriaColumnH eader As DataColumn = New DataColumn
CriteriaColumnH eader.DataType = System.Type.Get Type("System.St ring")
CriteriaColumnH eader.AllowDBNu ll = False

' Add the Column Header to the table.
CriteriaColumnH eader.ColumnNam e = "CriteriaID "
EventCriteriaTa ble.Columns.Add (CriteriaColumn Header)
CriteriaColumnH eader.ColumnNam e = "Min_Num"
EventCriteriaTa ble.Columns.Add (CriteriaColumn Header)
CriteriaColumnH eader.ColumnNam e = "ReportingFrequ enecy"
EventCriteriaTa ble.Columns.Add (CriteriaColumn Header)
CriteriaColumnH eader.ColumnNam e = "TimeToLiveStar tDate"
EventCriteriaTa ble.Columns.Add (CriteriaColumn Header)
CriteriaColumnH eader.ColumnNam e = "TimeToLiveStar tTime"
EventCriteriaTa ble.Columns.Add (CriteriaColumn Header)
CriteriaColumnH eader.ColumnNam e = "TimeToLiveStop Date"
EventCriteriaTa ble.Columns.Add (CriteriaColumn Header)
CriteriaColumnH eader.ColumnNam e = "TimeToLiveStop Time"
EventCriteriaTa ble.Columns.Add (CriteriaColumn Header)
end class
Module DataAccessClass

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

AddDataColumnNa mes()
CriteriaDBConne ction.Open()

Dim CriteriaReader As SqlDataReader = CriteriaCMD.Exe cuteReader(Comm andBehavior.Clo seConnection)

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

CriteriaRow = AlertData.Event CriteriaTable.N ewRow() ' Create a New Row
CriteriaRow("Cr iteriaID") = CriteriaReader. GetSqlValue(0)
CriteriaRow("Mi n_Num") = CriteriaReader. GetSqlValue(1)
CriteriaRow("Re portingFrequene cy") = CriteriaReader. GetSqlValue(2)
CriteriaRow("Ti meToLiveStartDa te") = CriteriaReader. GetSqlValue(3)
CriteriaRow("Ti meToLiveStartTi me") = CriteriaReader. GetSqlValue(4)
CriteriaRow("Ti meToLiveStopDat e") = CriteriaReader. GetSqlValue(5)
CriteriaRow("Ti meToLiveStopTim e") = CriteriaReader. GetSqlValue(6)
end sub
end Module

Thanks

Nov 20 '05 #1
5 1429
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*******@disc ussions.microso ft.com> wrote in message
news:BC******** *************** ***********@mic rosoft.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 AddDataColumnNa mes() 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("AlertT ables")
Public EventCriteriaTa ble As DataTable = AlertDS.Tables. Add("EventCrite ria") Public MinGPSHistoryTa ble As DataTable = AlertDS.Tables. Add("MinGPSHist ory") Public EventLogTable As DataTable = AlertDS.Tables. Add("EventLog")
Dim AlertVar As New AlertVariables

Public Sub AddDataColumnNa mes()

'Add Column Names for Criteria and Command Data

'Set Column Properties
Dim CriteriaColumnH eader As DataColumn = New DataColumn
CriteriaColumnH eader.DataType = System.Type.Get Type("System.St ring") CriteriaColumnH eader.AllowDBNu ll = False

' Add the Column Header to the table.
CriteriaColumnH eader.ColumnNam e = "CriteriaID "
EventCriteriaTa ble.Columns.Add (CriteriaColumn Header)
CriteriaColumnH eader.ColumnNam e = "Min_Num"
EventCriteriaTa ble.Columns.Add (CriteriaColumn Header)
CriteriaColumnH eader.ColumnNam e = "ReportingFrequ enecy"
EventCriteriaTa ble.Columns.Add (CriteriaColumn Header)
CriteriaColumnH eader.ColumnNam e = "TimeToLiveStar tDate"
EventCriteriaTa ble.Columns.Add (CriteriaColumn Header)
CriteriaColumnH eader.ColumnNam e = "TimeToLiveStar tTime"
EventCriteriaTa ble.Columns.Add (CriteriaColumn Header)
CriteriaColumnH eader.ColumnNam e = "TimeToLiveStop Date"
EventCriteriaTa ble.Columns.Add (CriteriaColumn Header)
CriteriaColumnH eader.ColumnNam e = "TimeToLiveStop Time"
EventCriteriaTa ble.Columns.Add (CriteriaColumn Header)
end class
Module DataAccessClass

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

AddDataColumnNa mes()
CriteriaDBConne ction.Open()

Dim CriteriaReader As SqlDataReader = CriteriaCMD.Exe cuteReader(Comm andBehavior.Clo seConnection)
If CriteriaReader. HasRows Then
NoData = False 'Data is available
While CriteriaReader. Read()
' Add Column Names and Row Data to Table

CriteriaRow = AlertData.Event CriteriaTable.N ewRow() ' Create a New Row CriteriaRow("Cr iteriaID") = CriteriaReader. GetSqlValue(0)
CriteriaRow("Mi n_Num") = CriteriaReader. GetSqlValue(1)
CriteriaRow("Re portingFrequene cy") = CriteriaReader. GetSqlValue(2) CriteriaRow("Ti meToLiveStartDa te") = CriteriaReader. GetSqlValue(3) CriteriaRow("Ti meToLiveStartTi me") = CriteriaReader. GetSqlValue(4) CriteriaRow("Ti meToLiveStopDat e") = CriteriaReader. GetSqlValue(5) CriteriaRow("Ti meToLiveStopTim e") = 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 MessageProcessi ng As New SageQuestMailer

At this point shouldn't I be able to add row data? My subroutine "CriteriaAl ert" 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*******@disc ussions.microso ft.com> wrote in message
news:BC******** *************** ***********@mic rosoft.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 AddDataColumnNa mes() 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("AlertT ables")
Public EventCriteriaTa ble As DataTable =

AlertDS.Tables. Add("EventCrite ria")
Public MinGPSHistoryTa ble As DataTable =

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

Public Sub AddDataColumnNa mes()

'Add Column Names for Criteria and Command Data

'Set Column Properties
Dim CriteriaColumnH eader As DataColumn = New DataColumn
CriteriaColumnH eader.DataType =

System.Type.Get Type("System.St ring")
CriteriaColumnH eader.AllowDBNu ll = False

' Add the Column Header to the table.
CriteriaColumnH eader.ColumnNam e = "CriteriaID "
EventCriteriaTa ble.Columns.Add (CriteriaColumn Header)
CriteriaColumnH eader.ColumnNam e = "Min_Num"
EventCriteriaTa ble.Columns.Add (CriteriaColumn Header)
CriteriaColumnH eader.ColumnNam e = "ReportingFrequ enecy"
EventCriteriaTa ble.Columns.Add (CriteriaColumn Header)
CriteriaColumnH eader.ColumnNam e = "TimeToLiveStar tDate"
EventCriteriaTa ble.Columns.Add (CriteriaColumn Header)
CriteriaColumnH eader.ColumnNam e = "TimeToLiveStar tTime"
EventCriteriaTa ble.Columns.Add (CriteriaColumn Header)
CriteriaColumnH eader.ColumnNam e = "TimeToLiveStop Date"
EventCriteriaTa ble.Columns.Add (CriteriaColumn Header)
CriteriaColumnH eader.ColumnNam e = "TimeToLiveStop Time"
EventCriteriaTa ble.Columns.Add (CriteriaColumn Header)
end class
Module DataAccessClass

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

AddDataColumnNa mes()
CriteriaDBConne ction.Open()

Dim CriteriaReader As SqlDataReader =

CriteriaCMD.Exe cuteReader(Comm andBehavior.Clo seConnection)

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

CriteriaRow = AlertData.Event CriteriaTable.N ewRow() '

Create a New Row
CriteriaRow("Cr iteriaID") = CriteriaReader. GetSqlValue(0)
CriteriaRow("Mi n_Num") = CriteriaReader. GetSqlValue(1)
CriteriaRow("Re portingFrequene cy") =

CriteriaReader. GetSqlValue(2)
CriteriaRow("Ti meToLiveStartDa te") =

CriteriaReader. GetSqlValue(3)
CriteriaRow("Ti meToLiveStartTi me") =

CriteriaReader. GetSqlValue(4)
CriteriaRow("Ti meToLiveStopDat e") =

CriteriaReader. GetSqlValue(5)
CriteriaRow("Ti meToLiveStopTim e") =

CriteriaReader. GetSqlValue(6)
end sub
end Module

Thanks


Nov 20 '05 #3
In the Module DataAccessClass

AlertaData.AddD ataColumnNames( )

not

AddDataColumnNa mes()
--

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

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

"Larry Bird" <La*******@disc ussions.microso ft.com> wrote in message
news:F2******** *************** ***********@mic rosoft.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 MessageProcessi ng As New SageQuestMailer

At this point shouldn't I be able to add row data? My subroutine "CriteriaAl ert" 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*******@disc ussions.microso ft.com> wrote in message
news:BC******** *************** ***********@mic rosoft.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 AddDataColumnNa mes() 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("AlertT ables")
Public EventCriteriaTa ble As DataTable =

AlertDS.Tables. Add("EventCrite ria")
Public MinGPSHistoryTa ble As DataTable =

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

Public Sub AddDataColumnNa mes()

'Add Column Names for Criteria and Command Data

'Set Column Properties
Dim CriteriaColumnH eader As DataColumn = New DataColumn
CriteriaColumnH eader.DataType =

System.Type.Get Type("System.St ring")
CriteriaColumnH eader.AllowDBNu ll = False

' Add the Column Header to the table.
CriteriaColumnH eader.ColumnNam e = "CriteriaID "
EventCriteriaTa ble.Columns.Add (CriteriaColumn Header)
CriteriaColumnH eader.ColumnNam e = "Min_Num"
EventCriteriaTa ble.Columns.Add (CriteriaColumn Header)
CriteriaColumnH eader.ColumnNam e = "ReportingFrequ enecy"
EventCriteriaTa ble.Columns.Add (CriteriaColumn Header)
CriteriaColumnH eader.ColumnNam e = "TimeToLiveStar tDate"
EventCriteriaTa ble.Columns.Add (CriteriaColumn Header)
CriteriaColumnH eader.ColumnNam e = "TimeToLiveStar tTime"
EventCriteriaTa ble.Columns.Add (CriteriaColumn Header)
CriteriaColumnH eader.ColumnNam e = "TimeToLiveStop Date"
EventCriteriaTa ble.Columns.Add (CriteriaColumn Header)
CriteriaColumnH eader.ColumnNam e = "TimeToLiveStop Time"
EventCriteriaTa ble.Columns.Add (CriteriaColumn Header)
end class
Module DataAccessClass

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

AddDataColumnNa mes()
CriteriaDBConne ction.Open()

Dim CriteriaReader As SqlDataReader =

CriteriaCMD.Exe cuteReader(Comm andBehavior.Clo seConnection)

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

CriteriaRow = AlertData.Event CriteriaTable.N ewRow() '

Create a New Row
CriteriaRow("Cr iteriaID") =

CriteriaReader. GetSqlValue(0) CriteriaRow("Mi n_Num") = CriteriaReader. GetSqlValue(1)
CriteriaRow("Re portingFrequene cy") =

CriteriaReader. GetSqlValue(2)
CriteriaRow("Ti meToLiveStartDa te") =

CriteriaReader. GetSqlValue(3)
CriteriaRow("Ti meToLiveStartTi me") =

CriteriaReader. GetSqlValue(4)
CriteriaRow("Ti meToLiveStopDat e") =

CriteriaReader. GetSqlValue(5)
CriteriaRow("Ti meToLiveStopTim e") =

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.AddD ataColumnNames( )

not

AddDataColumnNa mes()
--

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

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

"Larry Bird" <La*******@disc ussions.microso ft.com> wrote in message
news:F2******** *************** ***********@mic rosoft.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 MessageProcessi ng As New SageQuestMailer

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

"CriteriaAl ert" 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*******@disc ussions.microso ft.com> wrote in message
news:BC******** *************** ***********@mic rosoft.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 AddDataColumnNa mes() 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("AlertT ables")
> Public EventCriteriaTa ble As DataTable =
AlertDS.Tables. Add("EventCrite ria")
> Public MinGPSHistoryTa ble As DataTable =
AlertDS.Tables. Add("MinGPSHist ory")
> Public EventLogTable As DataTable = AlertDS.Tables. Add("EventLog")
> Dim AlertVar As New AlertVariables
>
> Public Sub AddDataColumnNa mes()
>
> 'Add Column Names for Criteria and Command Data
>
> 'Set Column Properties
> Dim CriteriaColumnH eader As DataColumn = New DataColumn
> CriteriaColumnH eader.DataType =
System.Type.Get Type("System.St ring")
> CriteriaColumnH eader.AllowDBNu ll = False
>
> ' Add the Column Header to the table.
> CriteriaColumnH eader.ColumnNam e = "CriteriaID "
> EventCriteriaTa ble.Columns.Add (CriteriaColumn Header)
> CriteriaColumnH eader.ColumnNam e = "Min_Num"
> EventCriteriaTa ble.Columns.Add (CriteriaColumn Header)
> CriteriaColumnH eader.ColumnNam e = "ReportingFrequ enecy"
> EventCriteriaTa ble.Columns.Add (CriteriaColumn Header)
> CriteriaColumnH eader.ColumnNam e = "TimeToLiveStar tDate"
> EventCriteriaTa ble.Columns.Add (CriteriaColumn Header)
> CriteriaColumnH eader.ColumnNam e = "TimeToLiveStar tTime"
> EventCriteriaTa ble.Columns.Add (CriteriaColumn Header)
> CriteriaColumnH eader.ColumnNam e = "TimeToLiveStop Date"
> EventCriteriaTa ble.Columns.Add (CriteriaColumn Header)
> CriteriaColumnH eader.ColumnNam e = "TimeToLiveStop Time"
> EventCriteriaTa ble.Columns.Add (CriteriaColumn Header)
> end class
>
>
> Module DataAccessClass
>
> Dim AlertData As New AlertDataClass
> Dim AlertVar As New AlertVariables
> Dim Alerts = AlertData
> Dim MessageProcessi ng As New SageQuestMailer
> Sub CriteriaAlert
>
> AddDataColumnNa mes()
>
>
> CriteriaDBConne ction.Open()
>
> Dim CriteriaReader As SqlDataReader =
CriteriaCMD.Exe cuteReader(Comm andBehavior.Clo seConnection)
>
> If CriteriaReader. HasRows Then
> NoData = False 'Data is available
> While CriteriaReader. Read()
> ' Add Column Names and Row Data to Table
>
> CriteriaRow = AlertData.Event CriteriaTable.N ewRow() '
Create a New Row
> CriteriaRow("Cr iteriaID") = CriteriaReader. GetSqlValue(0) > CriteriaRow("Mi n_Num") = CriteriaReader. GetSqlValue(1)
> CriteriaRow("Re portingFrequene cy") =
CriteriaReader. GetSqlValue(2)
> CriteriaRow("Ti meToLiveStartDa te") =
CriteriaReader. GetSqlValue(3)
> CriteriaRow("Ti meToLiveStartTi me") =
CriteriaReader. GetSqlValue(4)
> CriteriaRow("Ti meToLiveStopDat e") =
CriteriaReader. GetSqlValue(5)
> CriteriaRow("Ti meToLiveStopTim e") =
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*******@disc ussions.microso ft.com> wrote in message
news:54******** *************** ***********@mic rosoft.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.AddD ataColumnNames( )

not

AddDataColumnNa mes()
--

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

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

"Larry Bird" <La*******@disc ussions.microso ft.com> wrote in message
news:F2******** *************** ***********@mic rosoft.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 MessageProcessi ng As New SageQuestMailer

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

"CriteriaAl ert" 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*******@disc ussions.microso ft.com> wrote in message
> news:BC******** *************** ***********@mic rosoft.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 AddDataColumnNa mes() 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("AlertT ables")
> > Public EventCriteriaTa ble As DataTable =
> AlertDS.Tables. Add("EventCrite ria")
> > Public MinGPSHistoryTa ble As DataTable =
> AlertDS.Tables. Add("MinGPSHist ory")
> > Public EventLogTable As DataTable =

AlertDS.Tables. Add("EventLog") > > Dim AlertVar As New AlertVariables
> >
> > Public Sub AddDataColumnNa mes()
> >
> > 'Add Column Names for Criteria and Command Data
> >
> > 'Set Column Properties
> > Dim CriteriaColumnH eader As DataColumn = New DataColumn
> > CriteriaColumnH eader.DataType =
> System.Type.Get Type("System.St ring")
> > CriteriaColumnH eader.AllowDBNu ll = False
> >
> > ' Add the Column Header to the table.
> > CriteriaColumnH eader.ColumnNam e = "CriteriaID "
> > EventCriteriaTa ble.Columns.Add (CriteriaColumn Header)
> > CriteriaColumnH eader.ColumnNam e = "Min_Num"
> > EventCriteriaTa ble.Columns.Add (CriteriaColumn Header)
> > CriteriaColumnH eader.ColumnNam e = "ReportingFrequ enecy"
> > EventCriteriaTa ble.Columns.Add (CriteriaColumn Header)
> > CriteriaColumnH eader.ColumnNam e = "TimeToLiveStar tDate"
> > EventCriteriaTa ble.Columns.Add (CriteriaColumn Header)
> > CriteriaColumnH eader.ColumnNam e = "TimeToLiveStar tTime"
> > EventCriteriaTa ble.Columns.Add (CriteriaColumn Header)
> > CriteriaColumnH eader.ColumnNam e = "TimeToLiveStop Date"
> > EventCriteriaTa ble.Columns.Add (CriteriaColumn Header)
> > CriteriaColumnH eader.ColumnNam e = "TimeToLiveStop Time"
> > EventCriteriaTa ble.Columns.Add (CriteriaColumn Header)
> > end class
> >
> >
> > Module DataAccessClass
> >
> > Dim AlertData As New AlertDataClass
> > Dim AlertVar As New AlertVariables
> > Dim Alerts = AlertData
> > Dim MessageProcessi ng As New SageQuestMailer
> > Sub CriteriaAlert
> >
> > AddDataColumnNa mes()
> >
> >
> > CriteriaDBConne ction.Open()
> >
> > Dim CriteriaReader As SqlDataReader =
> CriteriaCMD.Exe cuteReader(Comm andBehavior.Clo seConnection)
> >
> > If CriteriaReader. HasRows Then
> > NoData = False 'Data is available
> > While CriteriaReader. Read()
> > ' Add Column Names and Row Data to Table
> >
> > CriteriaRow = AlertData.Event CriteriaTable.N ewRow() ' > Create a New Row
> > CriteriaRow("Cr iteriaID") =

CriteriaReader. GetSqlValue(0)
> > CriteriaRow("Mi n_Num") = CriteriaReader. GetSqlValue(1) > > CriteriaRow("Re portingFrequene cy") =
> CriteriaReader. GetSqlValue(2)
> > CriteriaRow("Ti meToLiveStartDa te") =
> CriteriaReader. GetSqlValue(3)
> > CriteriaRow("Ti meToLiveStartTi me") =
> CriteriaReader. GetSqlValue(4)
> > CriteriaRow("Ti meToLiveStopDat e") =
> CriteriaReader. GetSqlValue(5)
> > CriteriaRow("Ti meToLiveStopTim e") =
> 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
3999
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 > Fonts Any help or direction is appreciated. S
3
1820
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, like not working in winpython or the command line, I get a 'stack not deep enough' error. I haven't tested it on linux yet either. It could be something with my python install.(?) Anyway, here's the source with an example output. I'm still not...
6
1812
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 these in the form of a drop-down list, but I'm looking for some function or method that will simply return a list of strings. Thanks,
3
18716
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 with only 2 decimals (#,##0.00)? In the sample below, amount and taxrate are existing DataColumn's. DataColumn colTax = new DataColumn(); colTax.DataType = System.Type.GetType("System.String"); colTax.ColumnName = "tax";...
10
3185
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 reason for using underscores like this in C#? Thanks,
2
2162
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 solution with System.DirectoryServices but that doesn't work for me because the required isn't installed on the computer.
4
2454
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 is called, the DataGrid displays the column headings as the column names output from the Access SQL query. I would like to change some of the styles for certain columns in the DataGrid, so I first need to set the DataGridColumnStyle.MappingName...
1
7841
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 am note sure what to do because all propertiers work, except the System.Data.DataColumn.. I didn't write any code by hand and used the visual studio to set the properties..
3
6202
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 = System.Type.GetType"System.Boolean"); //"System.Boolean"); tia
0
8736
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8649
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9083
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7824
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6571
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5904
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3102
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2398
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2035
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.