473,387 Members | 3,801 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,387 software developers and data experts.

dataset name

Using vs2003, vb net.

Why does DS>DataSetName return the base name DS_Caller_Base instead of the
instantiated Name of DataSet1? See '**** for the line in question.

Friend sub1

' instantiate new dataset

dim DataSet1 as new DS_Caller_Base

' pass new dataset to sub2

sub2(DataSet1)

end sub

Friend sub2(ByRef DS As DS_Caller_Base)

' Note that the DataSetName below give its base name (not sure why),
instead of the name of the passed instantiated dataset.

dim x as string = DS.DataSetName '*****************

' why does x = DS_Caller_Base and not x = DataSet1

end sub

Thanks!

Bob
Nov 20 '05 #1
3 1946
Hi Bob,

Thanks for using Microsoft MSDN Managed Newsgroup.
My name is Gary, and I will be assisting you on this issue.

First of all, I would like to confirm my understanding of your issue.

From your description, I understand that when you defended as:
Dim DataSet1 as new DS_Caller_Base 'assume as DataSet
the DataSet1.DataSetName = "DS_Caller_Base", you wonder why is not the
"DataSet1"

Have I fully understood you? If there is anything I misunderstood, please
feel free to let me know.
Based on my knowledge, the "DataSet1" is the identity name(ID) of your
instantiated DataSet object(in other words it is your DataSet variable's
name, it is only recognized within your program code and just visible to
the compiler), it is not the DataSet object(represent by DataSet1)'s name.

The DataSet1object has its own default name(this is a property of the
DataSet class)(DS_Caller_Base"("NewDataSet"), you can change its default
name by
e.g. DataSet1.DataSetName = "My DataSet"
Hope I can make my words understood easily!

Thank!

Best regards,

Gary Chang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------

Nov 20 '05 #2
Yes you understand my question. Your answer is correct, but doesn't make
much sense. Asside from ".DataSetName" being a confusing way to mean
".DataSetBaseName", how do I get the instantiated dataset name?

The way ".DataSetName" works is like saying:
Dim x as integer
dim y as string = x.VarialbleName
y would return "Integer".

I am instantiating a Component Designer file that has many DataSets in it,
so it is not feasible for me to go through and try to name each instantiated
dataset one by one with some line like:
DataSet1.DataSetName = "DataSet1"

So, how can I return the instantiated DataSet1 name? I don't see anyway.

Thanks!

Bob

"Gary Chang" <v-******@online.microsoft.com> wrote in message
news:Lo**************@cpmsftngxa07.phx.gbl...
Hi Bob,

Thanks for using Microsoft MSDN Managed Newsgroup.
My name is Gary, and I will be assisting you on this issue.

First of all, I would like to confirm my understanding of your issue.

From your description, I understand that when you defended as:
Dim DataSet1 as new DS_Caller_Base 'assume as DataSet
the DataSet1.DataSetName = "DS_Caller_Base", you wonder why is not the
"DataSet1"

Have I fully understood you? If there is anything I misunderstood, please
feel free to let me know.
Based on my knowledge, the "DataSet1" is the identity name(ID) of your
instantiated DataSet object(in other words it is your DataSet variable's
name, it is only recognized within your program code and just visible to
the compiler), it is not the DataSet object(represent by DataSet1)'s name.

The DataSet1object has its own default name(this is a property of the
DataSet class)(DS_Caller_Base"("NewDataSet"), you can change its default
name by
e.g. DataSet1.DataSetName = "My DataSet"
Hope I can make my words understood easily!

Thank!

Best regards,

Gary Chang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights. --------------------

Nov 20 '05 #3
Hi Bob,

Thanks for your quickly reply!

As my last post description, the instantiated DataSet object's
name(DataSet1) is just a symbol to represent the DataSet object in your
code(design time).

However the ".DataSetName" is a *property* of the DataSet class, the
default value of this property is its class name, which is defined in MSDN.
That is to say, it returns the class name of a variable by default, not
variable name. we can assign it a meaningful name and use it at run-time.
I am instantiating a Component Designer file that has many DataSets in it,
so it is not feasible for me to go through and try to name each instantiateddataset one by one with some line like:
DataSet1.DataSetName = "DataSet1"

So, how can I return the instantiated DataSet1 name? I don't see anyway.


So there is no easy ways to return the instantiated object's name(DataSet1)
Automatically. In order to get a variable's name, we need to set its
DataSetName property manually in coding. Since the class is developed by
you, you could also add a customized property to store this name by
yourself.

Does that answer your question? If there is any unclear, please feel free
to post here.
Thanks!

Best regards,

Gary Chang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------

Nov 20 '05 #4

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

Similar topics

2
by: theWizK | last post by:
Hello all. I have noticed that when I generate a strongly-typed dataset from an xml schema that the DataTables that are generated have their constructors marked as internal. What this means is...
3
by: Bill C. | last post by:
Hi, I've got a simple console app that just reads an XML file into a DataSet then prints out a description of each table in the DataSet, including column names and row values for each column. ...
5
by: Grant | last post by:
Hello, How come when I add a new row to my dataset table it shows up as changed (agencyData.Haschanges() = True) but when I delete a row the dataset thinks here are no...
8
by: drg | last post by:
I have a DataSet with a DateTime field. I am using an EventRow r, to update it with values from a TextBox in a DataGrid. Suppose a DataGrid in edit mode had a field with value: 7/7/2005. Then the...
4
by: Brian Keating | last post by:
wonder if anyone can help me here, i've a framework 1.1 dataset which i serialize in framework 1.1 and deserialize in framework 2.0. This is fine, problem is that i want to modify some of the...
2
by: John Holmes | last post by:
I have a web interface where the user types in ID's one at a time. After an ID is typed in, a button is clicked and the button click event has code that does a query and returns a data reader and...
2
by: Gary Shell | last post by:
I have jumped in to the deep end of the pool, trying out visual inheritance of a form and have run into a snag. I have the need to create a simple maintenance form for five identically...
3
by: P K | last post by:
Hello, I have a dataset which is already loaded with data in one table. so dataset.tables("data") exists and has data. Now, I have to add another table to the dataset. The source for this...
3
by: David P. Donahue | last post by:
I'm re-writing an application in C# that was originally written in Delphi 7. The heart of the application is a DataSet displayed in a DataGrid. One of the main functions of the previous...
0
by: rickbear | last post by:
Hi group... I am having big difficulties with dataset and xsd schemas. First I dedicate a specific schema to a dataset. Then I use an adapter to fill each table in the dataset. But the problem...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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
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...

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.