473,738 Members | 7,110 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Programmaticall y Create Oracle Typed DataSets?

Hi,

Is it possible to create a progam to mimic the following action

a) drag oledbadapter to form1.cs
b) select my oracle ole connection
c) enter 'select * from mytable'
d) create adapter for select only (no updates)
e) repeat for all my tables
f) generate dataset for all the those adapters/tables

Doing by hand is going to be a little tedious for my 500 tables...
I need the typed dataset

thanks!

Tim
Nov 16 '05 #1
7 2554
Tim,

Good news, it is actually possible.

One gotcha - all your typed datasets will have to map an equivalent SQL
Query/Table/Stored proc in your oracle database (not a big deal huh?).

OracleDataAdapt er and OleDBDataAdapte r (and SqlDataAdapter should u care
for) should have a FillSchema method on it, use that to cread XSD files,
then run XSD.EXE to create .cs or .vb files to generate strongly typed
datasets out of that.

One word of caution - donot use FillSchema in a production application, the
query that it executes is hella expensive. Pre-prepare your strongly typed
datasets to include in your app, don't generate them on the fly.

Hope that helps.

- Sahil Malik
Independent Consultant
You can reach me thru my blog at -
http://www.dotnetjunkies.com/weblog/sahilmalik/

"Tim Smith" <ti*******@hotm ail.com> wrote in message
news:a7******** *************** ***@posting.goo gle.com...
Hi,

Is it possible to create a progam to mimic the following action

a) drag oledbadapter to form1.cs
b) select my oracle ole connection
c) enter 'select * from mytable'
d) create adapter for select only (no updates)
e) repeat for all my tables
f) generate dataset for all the those adapters/tables

Doing by hand is going to be a little tedious for my 500 tables...
I need the typed dataset

thanks!

Tim

Nov 16 '05 #2
Hi Tim,

I would recommend CodeSmith (free template based code generator) for such
features.
www.ericjsmith.net/codesmith/
You might also take a look at my few templates for CodeSmith:
http://www.rthand.com/default.aspx?Page=2&SubPage=1#4

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
miha at rthand com
www.rthand.com
"Tim Smith" <ti*******@hotm ail.com> wrote in message
news:a7******** *************** ***@posting.goo gle.com...
Hi,

Is it possible to create a progam to mimic the following action

a) drag oledbadapter to form1.cs
b) select my oracle ole connection
c) enter 'select * from mytable'
d) create adapter for select only (no updates)
e) repeat for all my tables
f) generate dataset for all the those adapters/tables

Doing by hand is going to be a little tedious for my 500 tables...
I need the typed dataset

thanks!

Tim

Nov 16 '05 #3
If you already have the DataAdapters set up, you can use WriteXML from the
DataSet. You will have to be filling the same DataSet with all of the
adapters, of course.

Now, create a new DataSet object and copy the XML from the .xsd you created
with WriteXML. Then, you only need to change the DataSet declaration from
DataSet to your new name, like so:

DataSet DataSet1 = new DataSet();

MyStName DataSet1 = new DataSet();

There is no tool to do all of this, however. If you wanted to create a tool,
there is a table in oracle called ALL_ALL_TABLES to get table names. If you
want to figure out sprocs in the database, ALL_SOURCE is your baby. NOTE:
You will have to have perms to hit these tables.
--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

*************** *************** *************** ***
Think Outside the Box!
*************** *************** *************** ***
"Tim Smith" <ti*******@hotm ail.com> wrote in message
news:a7******** *************** ***@posting.goo gle.com...
Hi,

Is it possible to create a progam to mimic the following action

a) drag oledbadapter to form1.cs
b) select my oracle ole connection
c) enter 'select * from mytable'
d) create adapter for select only (no updates)
e) repeat for all my tables
f) generate dataset for all the those adapters/tables

Doing by hand is going to be a little tedious for my 500 tables...
I need the typed dataset

thanks!

Tim

Nov 16 '05 #4
Gregory,

I hope you mean WriteXML with the XmlMode = WriteSchema?? Just
clarifying/making sure/checking my own feet here. :)

Why not just DataAdapter.Fil lSchema then?

I agree with your assessment - there is no tool to do this directly, and
even for FillSchema to work, you need permissions to hit all those tables -
even in SQL Server.

- Sahil Malik
Independent Consultant
You can reach me thru my blog - http://dotnetjunkies.com/WebLog/sahilmalik/

"Cowboy (Gregory A. Beamer) [MVP]" <No************ @comcast.netNoS pamM> wrote
in message news:uP******** ******@TK2MSFTN GP09.phx.gbl...
If you already have the DataAdapters set up, you can use WriteXML from the
DataSet. You will have to be filling the same DataSet with all of the
adapters, of course.

Now, create a new DataSet object and copy the XML from the .xsd you created with WriteXML. Then, you only need to change the DataSet declaration from
DataSet to your new name, like so:

DataSet DataSet1 = new DataSet();

MyStName DataSet1 = new DataSet();

There is no tool to do all of this, however. If you wanted to create a tool, there is a table in oracle called ALL_ALL_TABLES to get table names. If you want to figure out sprocs in the database, ALL_SOURCE is your baby. NOTE:
You will have to have perms to hit these tables.
--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

*************** *************** *************** ***
Think Outside the Box!
*************** *************** *************** ***
"Tim Smith" <ti*******@hotm ail.com> wrote in message
news:a7******** *************** ***@posting.goo gle.com...
Hi,

Is it possible to create a progam to mimic the following action

a) drag oledbadapter to form1.cs
b) select my oracle ole connection
c) enter 'select * from mytable'
d) create adapter for select only (no updates)
e) repeat for all my tables
f) generate dataset for all the those adapters/tables

Doing by hand is going to be a little tedious for my 500 tables...
I need the typed dataset

thanks!

Tim


Nov 16 '05 #5
BTW, this is exactly what you need (I hope) -

http://www.gotdotnet.com/Community/U...b-2a6de230a3a3

- Sahil Malik
Independent Consultant
You can reach me thru my blog - http://dotnetjunkies.com/WebLog/sahilmalik/

"Cowboy (Gregory A. Beamer) [MVP]" <No************ @comcast.netNoS pamM> wrote
in message news:uP******** ******@TK2MSFTN GP09.phx.gbl...
If you already have the DataAdapters set up, you can use WriteXML from the
DataSet. You will have to be filling the same DataSet with all of the
adapters, of course.

Now, create a new DataSet object and copy the XML from the .xsd you created with WriteXML. Then, you only need to change the DataSet declaration from
DataSet to your new name, like so:

DataSet DataSet1 = new DataSet();

MyStName DataSet1 = new DataSet();

There is no tool to do all of this, however. If you wanted to create a tool, there is a table in oracle called ALL_ALL_TABLES to get table names. If you want to figure out sprocs in the database, ALL_SOURCE is your baby. NOTE:
You will have to have perms to hit these tables.
--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

*************** *************** *************** ***
Think Outside the Box!
*************** *************** *************** ***
"Tim Smith" <ti*******@hotm ail.com> wrote in message
news:a7******** *************** ***@posting.goo gle.com...
Hi,

Is it possible to create a progam to mimic the following action

a) drag oledbadapter to form1.cs
b) select my oracle ole connection
c) enter 'select * from mytable'
d) create adapter for select only (no updates)
e) repeat for all my tables
f) generate dataset for all the those adapters/tables

Doing by hand is going to be a little tedious for my 500 tables...
I need the typed dataset

thanks!

Tim


Nov 16 '05 #6
I was shortcutting the idea, technically:

dataSet.WriteXM LSchema(fileNam e); //filename ends with .xsd

The import into the project can be done graphically in the IDE or in a text
editor by copying the XML.

I do like the other link you posted, BTW. Interesting code gen tool.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

*************** *************** *************** ***
Think Outside the Box!
*************** *************** *************** ***
"Sahil Malik" <co************ *****@nospam.co m> wrote in message
news:OE******** ******@tk2msftn gp13.phx.gbl...
Gregory,

I hope you mean WriteXML with the XmlMode = WriteSchema?? Just
clarifying/making sure/checking my own feet here. :)

Why not just DataAdapter.Fil lSchema then?

I agree with your assessment - there is no tool to do this directly, and
even for FillSchema to work, you need permissions to hit all those tables - even in SQL Server.

- Sahil Malik
Independent Consultant
You can reach me thru my blog - http://dotnetjunkies.com/WebLog/sahilmalik/
"Cowboy (Gregory A. Beamer) [MVP]" <No************ @comcast.netNoS pamM> wrote in message news:uP******** ******@TK2MSFTN GP09.phx.gbl...
If you already have the DataAdapters set up, you can use WriteXML from the DataSet. You will have to be filling the same DataSet with all of the
adapters, of course.

Now, create a new DataSet object and copy the XML from the .xsd you

created
with WriteXML. Then, you only need to change the DataSet declaration from DataSet to your new name, like so:

DataSet DataSet1 = new DataSet();

MyStName DataSet1 = new DataSet();

There is no tool to do all of this, however. If you wanted to create a

tool,
there is a table in oracle called ALL_ALL_TABLES to get table names. If

you
want to figure out sprocs in the database, ALL_SOURCE is your baby. NOTE: You will have to have perms to hit these tables.
--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

*************** *************** *************** ***
Think Outside the Box!
*************** *************** *************** ***
"Tim Smith" <ti*******@hotm ail.com> wrote in message
news:a7******** *************** ***@posting.goo gle.com...
Hi,

Is it possible to create a progam to mimic the following action

a) drag oledbadapter to form1.cs
b) select my oracle ole connection
c) enter 'select * from mytable'
d) create adapter for select only (no updates)
e) repeat for all my tables
f) generate dataset for all the those adapters/tables

Doing by hand is going to be a little tedious for my 500 tables...
I need the typed dataset

thanks!

Tim




Nov 16 '05 #7
Oh okay Dataset.WriteXM LSchema <--- that'll work. The "WriteXML" threw me
off.

- Sahil Malik
Independent Consultant
You can reach me thru my blog - http://dotnetjunkies.com/WebLog/sahilmalik/

"Cowboy (Gregory A. Beamer) [MVP]" <No************ @comcast.netNoS pamM> wrote
in message news:ez******** *****@TK2MSFTNG P11.phx.gbl...
I was shortcutting the idea, technically:

dataSet.WriteXM LSchema(fileNam e); //filename ends with .xsd

The import into the project can be done graphically in the IDE or in a text editor by copying the XML.

I do like the other link you posted, BTW. Interesting code gen tool.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

*************** *************** *************** ***
Think Outside the Box!
*************** *************** *************** ***
"Sahil Malik" <co************ *****@nospam.co m> wrote in message
news:OE******** ******@tk2msftn gp13.phx.gbl...
Gregory,

I hope you mean WriteXML with the XmlMode = WriteSchema?? Just
clarifying/making sure/checking my own feet here. :)

Why not just DataAdapter.Fil lSchema then?

I agree with your assessment - there is no tool to do this directly, and
even for FillSchema to work, you need permissions to hit all those

tables -
even in SQL Server.

- Sahil Malik
Independent Consultant
You can reach me thru my blog -

http://dotnetjunkies.com/WebLog/sahilmalik/

"Cowboy (Gregory A. Beamer) [MVP]" <No************ @comcast.netNoS pamM>

wrote
in message news:uP******** ******@TK2MSFTN GP09.phx.gbl...
If you already have the DataAdapters set up, you can use WriteXML from the DataSet. You will have to be filling the same DataSet with all of the
adapters, of course.

Now, create a new DataSet object and copy the XML from the .xsd you

created
with WriteXML. Then, you only need to change the DataSet declaration from DataSet to your new name, like so:

DataSet DataSet1 = new DataSet();

MyStName DataSet1 = new DataSet();

There is no tool to do all of this, however. If you wanted to create a

tool,
there is a table in oracle called ALL_ALL_TABLES to get table names.
If
you
want to figure out sprocs in the database, ALL_SOURCE is your baby.

NOTE: You will have to have perms to hit these tables.
--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

*************** *************** *************** ***
Think Outside the Box!
*************** *************** *************** ***
"Tim Smith" <ti*******@hotm ail.com> wrote in message
news:a7******** *************** ***@posting.goo gle.com...
> Hi,
>
> Is it possible to create a progam to mimic the following action
>
> a) drag oledbadapter to form1.cs
> b) select my oracle ole connection
> c) enter 'select * from mytable'
> d) create adapter for select only (no updates)
> e) repeat for all my tables
> f) generate dataset for all the those adapters/tables
>
> Doing by hand is going to be a little tedious for my 500 tables...
> I need the typed dataset
>
> thanks!
>
> Tim



Nov 16 '05 #8

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

Similar topics

0
1421
by: Bj?rn Mor?n | last post by:
I am consuming a web service that returns arrays of classes which can contain other classes (a hierarchy of data). Is there a simple way to move the data into a typed DataSet without writing too much additional code? Observe that this web service does not return a DataSet explicitly, but I still want to handle the data as a DataSet at the consumer end. I havn't found any source of information on how SoapHttpClientProtocol.Invoke works...
3
3711
by: R Reyes | last post by:
Just wondering if anyone knows the pros/cons between creating a database programmatically vs using the application's tool windows/features that come with SQLServer, Access, Oracle, etc... Is it the same? Does it really matter? I have created databases with .NET programmatically and it works fine, but why would anyone want to do all this typing when they can easily point and click inside the program? It took a few hours of typing for...
7
1797
by: Bob | last post by:
Hi, I have a typed unbound dataset that is passed to a datahandling class to be filled. The datahandling class fills it from a sproc using an oledbDataAdapter (SQLAnywhere database) The only table in the dataset has two int32 columns. There is one row of data and as expected, column 0 contains an int and column 1 contains a null. I want to update column1. The following code executes but the row cell remains unchanged.
4
9920
by: Ronald S. Cook | last post by:
I've always used untyped datasets. In a Microsoft course, it walks through creating typed datasets and harps on the benefits. It has you drag all these things around ..wizard, wizard, wizard... code gen, code gen, code gen. What's at the end looks slick, but then there's a ton of generated code that I'm going to have to maintain now. I.e. I like typing things myself (don't like wizards) so I can know exactly what I've done.
3
2496
by: Mike | last post by:
Hi, I'm delevloping a webservice that returns typed datasets with visual studio 2005. The problem is, that the typed data set in the client app is not the same as in the webservice. If I change the property 'NullValue' of the row to (empty) the dataset on the client does still throw an exception. I added a column to see if the project updates the reference.cs - and it does! This is the generated code from the original dataset:
13
8159
by: Bill Nguyen | last post by:
Is it possible to create your won XSD to use with .NET based on an XML content? For example the one below: <?xml version="1.0"?> <pcats:FuelsDoc xmlns="http://www.naxml.org/Retail-EDI/Vocabulary/2003-10-16" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="NAXML-FuelPrice15.xsd"> <pcats:TransmissionHeader>
2
10619
by: DC | last post by:
Hi, I can easily create an xsd from an xml file in Visual Studio 2005. But I want a typed DataSet, so is there an option to create that typed DataSet from the xsd or the xml file? I need many such typed DataSets so I don't want to create them from scratch. On a sidenote: I am loading the XML from http, I transform it via xslt and then load the result into a typed DataSet. I think I am doing a lot of inefficient things. I am always...
4
3111
by: Rachana | last post by:
Hi, I have understood Data Sets but what is meant by typed/untyped/ strongly typed datasets. Can any one explain me or suggest any site/ article, to get these concepts (and their comparisions) cleared? Thanks, Rachana
12
3601
by: BillE | last post by:
I'm trying to decide if it is better to use typed datasets or business objects, so I would appreciate any thoughts from someone with more experience. When I use a business object to populate a gridview, for example, I loop through a datareader, populating an array list with instances of a custom class in the middle tier, and then send the array list up to the presentation layer and bind the gridview to it. If I use a typed dataset, I...
0
9476
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9335
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...
1
9263
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9208
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8210
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...
0
4570
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4825
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2745
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2193
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.