A component that I'm using expects the tables within it to be accessed as
properties (DataSetName.Ta bleName). I have created a DataSet like this:
dsTaskActivitie s = new DataSet();
odbcDA_TaskActi vities.FillSche ma(dsTaskActivi ties, SchemaType.Sour ce,
"Tasks");
My DataAdabpter contains the necessary SQL to retrieve the table, "Tasks",
and the new table ends up in the Tables property of the DataSet but not as
an individual property of the DataSet.
Can anyone tell me how to create the DataTable such that it becomes a
property of the DataSet? 3 1651
you have to create the property yourself,
write a class MyDataSet e.g. that inherits from DataSet and just add the
property
e.g.
public DataTable Tasks
{
get { return this.Tables["Tasks"]; }
}
Christopher Weaver schreef: A component that I'm using expects the tables within it to be accessed as properties (DataSetName.Ta bleName). I have created a DataSet like this:
dsTaskActivitie s = new DataSet(); odbcDA_TaskActi vities.FillSche ma(dsTaskActivi ties, SchemaType.Sour ce, "Tasks");
My DataAdabpter contains the necessary SQL to retrieve the table, "Tasks", and the new table ends up in the Tables property of the DataSet but not as an individual property of the DataSet.
Can anyone tell me how to create the DataTable such that it becomes a property of the DataSet?
Thanks for writing back.
This didn't work for me. But what I found did work was this:
I used the IDE to create a new DataSet with a DataAdapter. I then renamed
the default table "Table" to "Tasks" by editing the xsd definition of the
table schema using the DataSet's local menu choice "View Schema...".
I'm wondering if there isn't some way to rename the table within the
"DataSet Properties..." dialog. It seems like there ought to be.
"Rudderius" <dr***@bestopia .be> wrote in message
news:11******** *******@seven.k ulnet.kuleuven. ac.be... you have to create the property yourself,
write a class MyDataSet e.g. that inherits from DataSet and just add the property
e.g. public DataTable Tasks { get { return this.Tables["Tasks"]; } }
Christopher Weaver schreef: A component that I'm using expects the tables within it to be accessed as properties (DataSetName.Ta bleName). I have created a DataSet like this:
dsTaskActivitie s = new DataSet(); odbcDA_TaskActi vities.FillSche ma(dsTaskActivi ties, SchemaType.Sour ce, "Tasks");
My DataAdabpter contains the necessary SQL to retrieve the table, "Tasks", and the new table ends up in the Tables property of the DataSet but not as an individual property of the DataSet.
Can anyone tell me how to create the DataTable such that it becomes a property of the DataSet?
Christopher,
All you need to do it to create a typed dataset. This way all of the
code will be autogenerated for you, and not only for the table, but
also nested classes for the table itself and for the table's rows. The
row class, in turn, will expose properties and methods for each of the
columns.
There are 2 similar ways of doing so:
1) Simply create a new dataset, open it in Design mode, and then drag
a table (or as many tables as you want) from the Server Explorer tab
in IDE. You must have a link to the database in the Server Explorer.
2) Design your dataset yourself, by adding elements, attributes of
proper types and relations in the designer.
If you do like shown above, you shouldn't be messinng with XSD
directly. Also do not touch the code behind, because it's re-generated
every time you touch the Designer or XSD.
Typed datasets are very poverful and encapsulate you database tables
and views schema almost completely, down to every column and its
properties.
On Sat, 27 Aug 2005 15:22:17 -0700, "Christophe r Weaver"
<we*****@nospam verizon.net> wrote: Thanks for writing back.
This didn't work for me. But what I found did work was this: I used the IDE to create a new DataSet with a DataAdapter. I then renamed the default table "Table" to "Tasks" by editing the xsd definition of the table schema using the DataSet's local menu choice "View Schema...".
I'm wondering if there isn't some way to rename the table within the "DataSet Properties..." dialog. It seems like there ought to be. "Rudderius" <dr***@bestopia .be> wrote in message news:11******* ********@seven. kulnet.kuleuven .ac.be... you have to create the property yourself,
write a class MyDataSet e.g. that inherits from DataSet and just add the property
e.g. public DataTable Tasks { get { return this.Tables["Tasks"]; } }
Christopher Weaver schreef: A component that I'm using expects the tables within it to be accessed as properties (DataSetName.Ta bleName). I have created a DataSet like this:
dsTaskActivitie s = new DataSet(); odbcDA_TaskActi vities.FillSche ma(dsTaskActivi ties, SchemaType.Sour ce, "Tasks");
My DataAdabpter contains the necessary SQL to retrieve the table, "Tasks", and the new table ends up in the Tables property of the DataSet but not as an individual property of the DataSet.
Can anyone tell me how to create the DataTable such that it becomes a property of the DataSet? This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Liam3 |
last post by:
I'm having a problem with a table that accidently had a column added
whose type is the same as the table. This is seriously creating a
problem as I cannot delete the table and I really don't have the
ability to destroy the database (with all the other tables) just to
get rid of this. Does anyone know of a way to get the database to
allow a drop of a table that has this sort of situation.
Here's a sample of what I get...
Any thoughts...
|
by: Christian Höhener |
last post by:
Hi
I have a given attributvalue of a specific attribut (sys_obid=81653) which
occurs in multiple tables. Now, I should know the tablename of the table in
which this attribut occurs.
Which possiblities do I have to find it out?
-> "find tablename where sys_obid=81653 ....?"
|
by: N E |
last post by:
hello
I am trying to do a procedure that :
1 - Take a table name, a field name and a value as parameter
2 - check if the fieldname=value in the tablename table
3 - returns 1 if so, 0 if not
A -
I tried :
|
by: Antonio Ooi |
last post by:
Hi,
I get a DataTable based on this simple query:
SELECT * FROM Customers
Later, I want to know just the table name because I do not want to play with
the string within the SELECT statement. I expect DataTable.TableName to give
me an exact name, i.e. "Customers", but it gives me "Table" regardless of
what query from what table. Can someone gives me some clarifications on the
TabeName property? Thanks in advance.
|
by: Kruno Milicevic |
last post by:
I want to fill DataGrid with some table from my database. I usual use
something like this:
string sqlString ="SELECT * FROM TableName";
OleDbCommand myOleDbCommand = new OleDbCommand(sqlString , OleDbConn);
OleDbDataAdapter myOleDbDataAdapter = new OleDbDataAdapter();
myOleDbDataAdapter.SelectCommand=myOleDbCommand;
DataSet myDataSet=new DataSet();
myOleDbDataAdapter.Fill(myDataSet);
DataGrid1.DataSource = myDataSet;
| |
by: Dag-Erling Smørgrav |
last post by:
The PL/PGSQL documentation contains at least two examples of functions
which take an argument of type "tablename", which then serves as a
table name in a query. Here's one of those examples:
> CREATE FUNCTION concat_selected_fields(tablename) RETURNS text AS '
> DECLARE
> in_t ALIAS FOR $1;
> BEGIN
> RETURN in_t.f1 || in_t.f3 || in_t.f5 || in_t.f7;
> END;
|
by: Ying Lu |
last post by:
Hello,
Under mysql, we have "desc tablename" to get the detail information
about a table. My question is about to get column name, and column type
for a specific table under PostgreSQL through JDBC.
Assume we have a table named "test". Under PSQL, we can input "\d test"
to see the details about table "test" successufully. However, my main
purpose is trying to get column name, column name of a table through JDBC.
|
by: JF |
last post by:
I would like to automate a Union query going through the tables of my
dataset using VBA:
I have this code:
-------------------------------------------------------------------
Sub ssql()
Dim rs As Recordset
Dim ssql As String
Set rs = CurrentDb("SELECT * FROM Merge;")
|
by: Adrien Reboisson |
last post by:
I'm trying to build a basic DB explorer using C# & Visual Studio 2005. I
installed SQL Server 2005 Express, created a blank project, dropped a
TreeView, a ListView and a DataGridView : DB objects (Databases, tables,
SPs, and so on) are displayed in the tree, table colums definitions in
the list and I want to display the selected table content in the
DataGridView. So far so good. Currently, I succedded in loading the
treeview and the...
|
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: 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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
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: 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...
|
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...
|
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
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: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |