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 7 2557
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
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
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
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
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
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
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
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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...
|
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...
|
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.
|
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.
|
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:
| |
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>
|
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...
|
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
|
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...
|
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
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...
| |
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...
|
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,...
|
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 then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
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...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
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...
| |