473,473 Members | 1,924 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Basic N-Tiered structure in VB

I have an xsd file called zTest.xsd. In it, I have a DataTable called
CategoryCountByStore, a TableAdapter that is generated automatically called
CategoryCountByStoreTableAdapter, and a GetMethod name
etCategoryCount )which gets the value from a Stored Procedure). Using
Visual Studio 2005 and testing by Preview Data" it works fine, returning an
integer reflecting a SQL Count. (e.g. running the
preview...Results:CategoryCountByStore = 4, for some StoreID that is filled
in in the value column.)

I have a file under the folder App_Code called Stores.vb. In it, I have the
statement:

Public Function CategoryCountByStore(ByVal StoreID As Integer)
Dim CountCategoriesByStore As New
zTestTableAdapters.CategoryCountByStoreTableAdapte r
Return CountCategoriesByStore.GetCategoryCount(StoreID)
End Function

I get no error messages (I know that means little).

Now, I would like to get that value displayed on a WebPage, so I tried, in
the page's code-behind: (The Label2 is in the html section)

Dim myCategoryCount As New Stores
Dim StoreID As Integer = 2
Label2.Text = myCategoryCount.CategoryCountByStore(StoreID).ToSt ring.

But I do not get the value I expected (I get the label saying
CategoryCountByStore).

Could you please go over how to get a value from a DataSet, as Visual Studio
makes easy now, to a Class (object?) and then to the page?

TIA,

Paul


Jun 9 '06 #1
3 1067
Cast "myCategoryCount.CategoryCountByStore(StoreID) " to the appropriate
numeric type before calling to ToString()
"Paul" <Pa***********@TheCornerStore.com> wrote in message
news:Rk*************@fe09.lga...
I have an xsd file called zTest.xsd. In it, I have a DataTable called
CategoryCountByStore, a TableAdapter that is generated automatically called CategoryCountByStoreTableAdapter, and a GetMethod name
etCategoryCount )which gets the value from a Stored Procedure). Using
Visual Studio 2005 and testing by Preview Data" it works fine, returning an integer reflecting a SQL Count. (e.g. running the
preview...Results:CategoryCountByStore = 4, for some StoreID that is filled in in the value column.)

I have a file under the folder App_Code called Stores.vb. In it, I have the statement:

Public Function CategoryCountByStore(ByVal StoreID As Integer)
Dim CountCategoriesByStore As New
zTestTableAdapters.CategoryCountByStoreTableAdapte r
Return CountCategoriesByStore.GetCategoryCount(StoreID)
End Function

I get no error messages (I know that means little).

Now, I would like to get that value displayed on a WebPage, so I tried, in
the page's code-behind: (The Label2 is in the html section)

Dim myCategoryCount As New Stores
Dim StoreID As Integer = 2
Label2.Text = myCategoryCount.CategoryCountByStore(StoreID).ToSt ring.

But I do not get the value I expected (I get the label saying
CategoryCountByStore).

Could you please go over how to get a value from a DataSet, as Visual Studio makes easy now, to a Class (object?) and then to the page?

TIA,

Paul

Jun 9 '06 #2
Thanks. Where would I cast?
"Jorge Bustos" <jb*****@teleline.es> wrote in message
news:eC**************@TK2MSFTNGP03.phx.gbl...
Cast "myCategoryCount.CategoryCountByStore(StoreID) " to the appropriate
numeric type before calling to ToString()
"Paul" <Pa***********@TheCornerStore.com> wrote in message
news:Rk*************@fe09.lga...
I have an xsd file called zTest.xsd. In it, I have a DataTable called
CategoryCountByStore, a TableAdapter that is generated automatically

called
CategoryCountByStoreTableAdapter, and a GetMethod name
etCategoryCount )which gets the value from a Stored Procedure). Using
Visual Studio 2005 and testing by Preview Data" it works fine, returning

an
integer reflecting a SQL Count. (e.g. running the
preview...Results:CategoryCountByStore = 4, for some StoreID that is

filled
in in the value column.)

I have a file under the folder App_Code called Stores.vb. In it, I have

the
statement:

Public Function CategoryCountByStore(ByVal StoreID As Integer)
Dim CountCategoriesByStore As New
zTestTableAdapters.CategoryCountByStoreTableAdapte r
Return CountCategoriesByStore.GetCategoryCount(StoreID)
End Function

I get no error messages (I know that means little).

Now, I would like to get that value displayed on a WebPage, so I tried,
in
the page's code-behind: (The Label2 is in the html section)

Dim myCategoryCount As New Stores
Dim StoreID As Integer = 2
Label2.Text = myCategoryCount.CategoryCountByStore(StoreID).ToSt ring.

But I do not get the value I expected (I get the label saying
CategoryCountByStore).

Could you please go over how to get a value from a DataSet, as Visual

Studio
makes easy now, to a Class (object?) and then to the page?

TIA,

Paul


Jun 9 '06 #3
You should so something like this (I don't use VB, but C#, anyway I think
this is VB's way to do it):

myCategoryCount.CategoryCountByStore(StoreID)
returns a generic object.

CType(int, myCategoryCount.CategoryCountByStore(StoreID))
-> This converts the generic object to a int (You should choose the
appropriate type)

CType(int, myCategoryCount.CategoryCountByStore(StoreID)).ToS tring()
-> this hopefully will return just what you want

Let me know if this solves your problem.

Jorge
"Paul" <Pa***********@TheCornerStore.com> wrote in message
news:Lc***********@fe08.lga...
Thanks. Where would I cast?
"Jorge Bustos" <jb*****@teleline.es> wrote in message
news:eC**************@TK2MSFTNGP03.phx.gbl...
Cast "myCategoryCount.CategoryCountByStore(StoreID) " to the appropriate
numeric type before calling to ToString()
"Paul" <Pa***********@TheCornerStore.com> wrote in message
news:Rk*************@fe09.lga...
I have an xsd file called zTest.xsd. In it, I have a DataTable called
CategoryCountByStore, a TableAdapter that is generated automatically

called
CategoryCountByStoreTableAdapter, and a GetMethod name
etCategoryCount )which gets the value from a Stored Procedure). Using
Visual Studio 2005 and testing by Preview Data" it works fine,
returning an
integer reflecting a SQL Count. (e.g. running the
preview...Results:CategoryCountByStore = 4, for some StoreID that is

filled
in in the value column.)

I have a file under the folder App_Code called Stores.vb. In it, I
have the
statement:

Public Function CategoryCountByStore(ByVal StoreID As Integer)
Dim CountCategoriesByStore As New
zTestTableAdapters.CategoryCountByStoreTableAdapte r
Return CountCategoriesByStore.GetCategoryCount(StoreID)
End Function

I get no error messages (I know that means little).

Now, I would like to get that value displayed on a WebPage, so I tried,
in
the page's code-behind: (The Label2 is in the html section)

Dim myCategoryCount As New Stores
Dim StoreID As Integer = 2
Label2.Text = myCategoryCount.CategoryCountByStore(StoreID).ToSt ring.

But I do not get the value I expected (I get the label saying
CategoryCountByStore).

Could you please go over how to get a value from a DataSet, as Visual

Studio
makes easy now, to a Class (object?) and then to the page?

TIA,

Paul



Jun 10 '06 #4

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

Similar topics

7
by: Michael Foord | last post by:
#!/usr/bin/python -u # 15-09-04 # v1.0.0 # auth_example.py # A simple script manually demonstrating basic authentication. # Copyright Michael Foord # Free to use, modify and relicense. #...
56
by: Dave Vandervies | last post by:
I just fixed a bug that some of the correctness pedants around here may find useful as ammunition. The problem was that some code would, very occasionally, die with a segmentation violation...
10
by: trippeer | last post by:
I have the source code to an old BASIC program that a friend of mine would like to run online. I am a beginner at JS, but I think that it would be a good choice for the project. My background is in...
97
by: Master Programmer | last post by:
An friend insider told me that VB is to be killled off within 18 months. I guess this makes sence now that C# is here. I believe it and am actualy surprised they ever even included it in VS 2003 in...
6
by: Simon Walsh | last post by:
I'm an Electronics student in college and I'm currently working on a project. I was given a circuit diagram for my project, from which I had to design a printed circuit board to be sent off and...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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
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,...
1
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...
0
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...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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...

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.