HighTechTalks DotNet Forums  

Typed DataSet in code...

Dotnet Framework (ADO.net) microsoft.public.dotnet.framework.adonet


Discuss Typed DataSet in code... in the Dotnet Framework (ADO.net) forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Scott M.
 
Posts: n/a

Default Typed DataSet in code... - 06-01-2004 , 05:41 PM






Can a typed DataSet be made in code so that code that comes after the type
code will pick up on the dataset's table structure for intellisense?



Reply With Quote
  #2  
Old   
AT
 
Posts: n/a

Default RE: Typed DataSet in code... - 06-01-2004 , 08:28 PM






Hi Scott,

First of all, I would like to confirm my understanding of your issue. From
your description, I understand that you need to use intellisense on a typed
DataSet when it is made in code. If there is any misunderstanding, please
feel free to let me know.

As far as I know, typed DataSets are made in code. When you have created
your .XSD file in IDE, VS.NET will generate class (.cs or .vb) file
automatically according to the schema files using xsd.exe. The generated
file will be put together with the schema. To see the .cs or .vb file that
has been generated, here are the steps:

1. Click on the button Show all files in the Solution Explorer.
2. If your typed DataSet is MyDataSet, expand MyDataSet.xsd in the Solution
Explorer.
3. Double click MyDataSet.cs or MyDataSet.vb to see the typed DataSet class
definition.

After you have built the project, the typed DataSet structure can be used
for intellisense. For example, if you have two tables in it, named
Customers and Orders, when you need to get the reference for one of the
tables, you can simple use myDataSet.Orders instead of
myDataSet.Tables["Orders"].

HTH. If anything is unclear, please feel free to reply to the post.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."


Reply With Quote
  #3  
Old   
Scott M.
 
Posts: n/a

Default Re: Typed DataSet in code... - 06-01-2004 , 08:37 PM



Actually Kevin, my question is, can you make a typed dataset completely from
handwritten code, not using the IDE?

"Kevin Yu [MSFT]" <v-kevy (AT) online (DOT) microsoft.com> wrote

Quote:
Hi Scott,

First of all, I would like to confirm my understanding of your issue. From
your description, I understand that you need to use intellisense on a
typed
DataSet when it is made in code. If there is any misunderstanding, please
feel free to let me know.

As far as I know, typed DataSets are made in code. When you have created
your .XSD file in IDE, VS.NET will generate class (.cs or .vb) file
automatically according to the schema files using xsd.exe. The generated
file will be put together with the schema. To see the .cs or .vb file
that
has been generated, here are the steps:

1. Click on the button Show all files in the Solution Explorer.
2. If your typed DataSet is MyDataSet, expand MyDataSet.xsd in the
Solution
Explorer.
3. Double click MyDataSet.cs or MyDataSet.vb to see the typed DataSet
class
definition.

After you have built the project, the typed DataSet structure can be used
for intellisense. For example, if you have two tables in it, named
Customers and Orders, when you need to get the reference for one of the
tables, you can simple use myDataSet.Orders instead of
myDataSet.Tables["Orders"].

HTH. If anything is unclear, please feel free to reply to the post.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."




Reply With Quote
  #4  
Old   
William Ryan eMVP
 
Posts: n/a

Default Re: Typed DataSet in code... - 06-01-2004 , 09:54 PM



Only if you run xsd.exe against it. You can't do it dynamically at runtime
.. Well technically you can Process.Start(xsd.exe) but that won't get you
anything without a LOT of other work that is totally not worth it.

--
W.G. Ryan MVP Windows - Embedded

http://forums.devbuzz.com
http://www.knowdotnet.com/dataaccess.html
http://www.msmvps.com/williamryan/
"Scott M." <s-mar (AT) nospam (DOT) nospam> wrote

Quote:
Actually Kevin, my question is, can you make a typed dataset completely
from
handwritten code, not using the IDE?

"Kevin Yu [MSFT]" <v-kevy (AT) online (DOT) microsoft.com> wrote in message
news8xszDESEHA.1516 (AT) cpmsftngxa10 (DOT) phx.gbl...
Hi Scott,

First of all, I would like to confirm my understanding of your issue.
From
your description, I understand that you need to use intellisense on a
typed
DataSet when it is made in code. If there is any misunderstanding,
please
feel free to let me know.

As far as I know, typed DataSets are made in code. When you have created
your .XSD file in IDE, VS.NET will generate class (.cs or .vb) file
automatically according to the schema files using xsd.exe. The generated
file will be put together with the schema. To see the .cs or .vb file
that
has been generated, here are the steps:

1. Click on the button Show all files in the Solution Explorer.
2. If your typed DataSet is MyDataSet, expand MyDataSet.xsd in the
Solution
Explorer.
3. Double click MyDataSet.cs or MyDataSet.vb to see the typed DataSet
class
definition.

After you have built the project, the typed DataSet structure can be
used
for intellisense. For example, if you have two tables in it, named
Customers and Orders, when you need to get the reference for one of the
tables, you can simple use myDataSet.Orders instead of
myDataSet.Tables["Orders"].

HTH. If anything is unclear, please feel free to reply to the post.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."






Reply With Quote
  #5  
Old   
Miha Markic [MVP C#]
 
Posts: n/a

Default Re: Typed DataSet in code... - 06-02-2004 , 02:34 AM



Hi Scott,

Why not?
Look the .cs class behind the xsd file -there is everything
MSDataSetGenerator created.

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
miha at rthand com
www.rthand.com

"Scott M." <s-mar (AT) nospam (DOT) nospam> wrote

Quote:
Actually Kevin, my question is, can you make a typed dataset completely
from
handwritten code, not using the IDE?

"Kevin Yu [MSFT]" <v-kevy (AT) online (DOT) microsoft.com> wrote in message
news8xszDESEHA.1516 (AT) cpmsftngxa10 (DOT) phx.gbl...
Hi Scott,

First of all, I would like to confirm my understanding of your issue.
From
your description, I understand that you need to use intellisense on a
typed
DataSet when it is made in code. If there is any misunderstanding,
please
feel free to let me know.

As far as I know, typed DataSets are made in code. When you have created
your .XSD file in IDE, VS.NET will generate class (.cs or .vb) file
automatically according to the schema files using xsd.exe. The generated
file will be put together with the schema. To see the .cs or .vb file
that
has been generated, here are the steps:

1. Click on the button Show all files in the Solution Explorer.
2. If your typed DataSet is MyDataSet, expand MyDataSet.xsd in the
Solution
Explorer.
3. Double click MyDataSet.cs or MyDataSet.vb to see the typed DataSet
class
definition.

After you have built the project, the typed DataSet structure can be
used
for intellisense. For example, if you have two tables in it, named
Customers and Orders, when you need to get the reference for one of the
tables, you can simple use myDataSet.Orders instead of
myDataSet.Tables["Orders"].

HTH. If anything is unclear, please feel free to reply to the post.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."






Reply With Quote
  #6  
Old   
Scott M.
 
Posts: n/a

Default Re: Typed DataSet in code... - 06-02-2004 , 07:07 AM



I'm not asking if a typed DataSet can be represented by code. I'm asking if
I can make one completely in code (no VS .NET drag & drop) and still get
intellisense when I use the DataSet.


"Miha Markic [MVP C#]" <miha at rthand com> wrote

Quote:
Hi Scott,

Why not?
Look the .cs class behind the xsd file -there is everything
MSDataSetGenerator created.

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
miha at rthand com
www.rthand.com

"Scott M." <s-mar (AT) nospam (DOT) nospam> wrote in message
news:O$7edIESEHA.2876 (AT) TK2MSFTNGP09 (DOT) phx.gbl...
Actually Kevin, my question is, can you make a typed dataset completely
from
handwritten code, not using the IDE?

"Kevin Yu [MSFT]" <v-kevy (AT) online (DOT) microsoft.com> wrote in message
news8xszDESEHA.1516 (AT) cpmsftngxa10 (DOT) phx.gbl...
Hi Scott,

First of all, I would like to confirm my understanding of your issue.
From
your description, I understand that you need to use intellisense on a
typed
DataSet when it is made in code. If there is any misunderstanding,
please
feel free to let me know.

As far as I know, typed DataSets are made in code. When you have
created
your .XSD file in IDE, VS.NET will generate class (.cs or .vb) file
automatically according to the schema files using xsd.exe. The
generated
file will be put together with the schema. To see the .cs or .vb file
that
has been generated, here are the steps:

1. Click on the button Show all files in the Solution Explorer.
2. If your typed DataSet is MyDataSet, expand MyDataSet.xsd in the
Solution
Explorer.
3. Double click MyDataSet.cs or MyDataSet.vb to see the typed DataSet
class
definition.

After you have built the project, the typed DataSet structure can be
used
for intellisense. For example, if you have two tables in it, named
Customers and Orders, when you need to get the reference for one of
the
tables, you can simple use myDataSet.Orders instead of
myDataSet.Tables["Orders"].

HTH. If anything is unclear, please feel free to reply to the post.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."








Reply With Quote
  #7  
Old   
Miha Markic [MVP C#]
 
Posts: n/a

Default Re: Typed DataSet in code... - 06-02-2004 , 07:38 AM



Hi Scott,

I am not sure I understand you.
Typed dataset is code, acutally it is a class derived from DataSet.
The designer does just that - it converts xsd into a class derived from
DataSet which is later used by ide.
You can freely create it by yourself - it is no magic there.

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
miha at rthand com
www.rthand.com

So, if you code your own typed dataset
"Scott M." <s-mar (AT) nospam (DOT) nospam> wrote

Quote:
I'm not asking if a typed DataSet can be represented by code. I'm asking
if
I can make one completely in code (no VS .NET drag & drop) and still get
intellisense when I use the DataSet.


"Miha Markic [MVP C#]" <miha at rthand com> wrote in message
news:eRAoaQHSEHA.1644 (AT) TK2MSFTNGP09 (DOT) phx.gbl...
Hi Scott,

Why not?
Look the .cs class behind the xsd file -there is everything
MSDataSetGenerator created.

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
miha at rthand com
www.rthand.com

"Scott M." <s-mar (AT) nospam (DOT) nospam> wrote in message
news:O$7edIESEHA.2876 (AT) TK2MSFTNGP09 (DOT) phx.gbl...
Actually Kevin, my question is, can you make a typed dataset
completely
from
handwritten code, not using the IDE?

"Kevin Yu [MSFT]" <v-kevy (AT) online (DOT) microsoft.com> wrote in message
news8xszDESEHA.1516 (AT) cpmsftngxa10 (DOT) phx.gbl...
Hi Scott,

First of all, I would like to confirm my understanding of your
issue.
From
your description, I understand that you need to use intellisense on
a
typed
DataSet when it is made in code. If there is any misunderstanding,
please
feel free to let me know.

As far as I know, typed DataSets are made in code. When you have
created
your .XSD file in IDE, VS.NET will generate class (.cs or .vb) file
automatically according to the schema files using xsd.exe. The
generated
file will be put together with the schema. To see the .cs or .vb
file
that
has been generated, here are the steps:

1. Click on the button Show all files in the Solution Explorer.
2. If your typed DataSet is MyDataSet, expand MyDataSet.xsd in the
Solution
Explorer.
3. Double click MyDataSet.cs or MyDataSet.vb to see the typed
DataSet
class
definition.

After you have built the project, the typed DataSet structure can be
used
for intellisense. For example, if you have two tables in it, named
Customers and Orders, when you need to get the reference for one of
the
tables, you can simple use myDataSet.Orders instead of
myDataSet.Tables["Orders"].

HTH. If anything is unclear, please feel free to reply to the post.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."










Reply With Quote
  #8  
Old   
Scott M.
 
Posts: n/a

Default Re: Typed DataSet in code... - 06-02-2004 , 07:56 AM



Again Miha, I understand that the RESULT of the designer is code that I
could have written myself. But the designer also creates an XSD file, which
is the basis for the intellisense that you get when coding against the
dataset in other spots in the code. My question was can I get the
intelliSense of a typed DataSet, when making a dataset by hand (not with the
designer), and thus, without an xsd file.


"Miha Markic [MVP C#]" <miha at rthand com> wrote

Quote:
Hi Scott,

I am not sure I understand you.
Typed dataset is code, acutally it is a class derived from DataSet.
The designer does just that - it converts xsd into a class derived from
DataSet which is later used by ide.
You can freely create it by yourself - it is no magic there.

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
miha at rthand com
www.rthand.com

So, if you code your own typed dataset
"Scott M." <s-mar (AT) nospam (DOT) nospam> wrote in message
news:%23gjDioJSEHA.3056 (AT) TK2MSFTNGP11 (DOT) phx.gbl...
I'm not asking if a typed DataSet can be represented by code. I'm asking
if
I can make one completely in code (no VS .NET drag & drop) and still get
intellisense when I use the DataSet.


"Miha Markic [MVP C#]" <miha at rthand com> wrote in message
news:eRAoaQHSEHA.1644 (AT) TK2MSFTNGP09 (DOT) phx.gbl...
Hi Scott,

Why not?
Look the .cs class behind the xsd file -there is everything
MSDataSetGenerator created.

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
miha at rthand com
www.rthand.com

"Scott M." <s-mar (AT) nospam (DOT) nospam> wrote in message
news:O$7edIESEHA.2876 (AT) TK2MSFTNGP09 (DOT) phx.gbl...
Actually Kevin, my question is, can you make a typed dataset
completely
from
handwritten code, not using the IDE?

"Kevin Yu [MSFT]" <v-kevy (AT) online (DOT) microsoft.com> wrote in message
news8xszDESEHA.1516 (AT) cpmsftngxa10 (DOT) phx.gbl...
Hi Scott,

First of all, I would like to confirm my understanding of your
issue.
From
your description, I understand that you need to use intellisense
on
a
typed
DataSet when it is made in code. If there is any misunderstanding,
please
feel free to let me know.

As far as I know, typed DataSets are made in code. When you have
created
your .XSD file in IDE, VS.NET will generate class (.cs or .vb)
file
automatically according to the schema files using xsd.exe. The
generated
file will be put together with the schema. To see the .cs or .vb
file
that
has been generated, here are the steps:

1. Click on the button Show all files in the Solution Explorer.
2. If your typed DataSet is MyDataSet, expand MyDataSet.xsd in the
Solution
Explorer.
3. Double click MyDataSet.cs or MyDataSet.vb to see the typed
DataSet
class
definition.

After you have built the project, the typed DataSet structure can
be
used
for intellisense. For example, if you have two tables in it, named
Customers and Orders, when you need to get the reference for one
of
the
tables, you can simple use myDataSet.Orders instead of
myDataSet.Tables["Orders"].

HTH. If anything is unclear, please feel free to reply to the
post.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers
no
rights."












Reply With Quote
  #9  
Old   
AT
 
Posts: n/a

Default Re: Typed DataSet in code... - 06-03-2004 , 04:17 AM



Hi Scott,

I think you can feel free to create a DataSet by hand and get intellisense,
since the .xsd file is used for generating the .cs file for class. Just
derive from DataSet class to do it.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."


Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.