473,395 Members | 1,968 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,395 software developers and data experts.

Data Column Names not seen in vb 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
1 1792
Duplicate Post

--

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:FC**********************************@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

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: 'bonehead | last post by:
Greetings, I'd like to figure out some syntax for retrieving the data from a table when I don't know all the of field names. What I do know are, the name of the table, the names of the primary...
16
by: D Witherspoon | last post by:
I am developing a Windows Forms application in VB.NET that will use .NET remoting to access the data tier classes. A very simple way I have come up with is by creating typed (.xsd) datasets. For...
1
by: Michael March | last post by:
I have seen a few recipes out there that allow for access to DB-API columns by their name instead of column number.. I was wondering if anyone knew of any code snippets that allow for the same...
1
by: Dan | last post by:
Could someone please help me with auto importing a series of data files into an Access table. I tried to follow code given below in a previous messagebut i'm getting error messages. Here's my...
1
by: Andrew Arace | last post by:
I scoured the groups for some hands on code to perform the menial task of exporting table data from an Access 2000 database to Oracle database (in this case, it was oracle 8i but i'm assuming this...
18
by: Joel Hedlund | last post by:
Hi! The question of type checking/enforcing has bothered me for a while, and since this newsgroup has a wealth of competence subscribed to it, I figured this would be a great way of learning...
14
by: Imbaud Pierre | last post by:
The applications I write are made of, lets say, algorithms and data. I mean constant data, dicts, tables, etc: to keep algorithms simple, describe what is peculiar, data dependent, as data rather...
162
by: Sh4wn | last post by:
Hi, first, python is one of my fav languages, and i'll definitely keep developing with it. But, there's 1 one thing what I -really- miss: data hiding. I know member vars are private when you...
5
by: dananrg | last post by:
Is there any way to retrieve column names from a cursor using the ODBC module? Or must I, in advance, create a dictionary of column position and column names for a particular table before I can...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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,...

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.