473,320 Members | 2,111 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,320 software developers and data experts.

Generate DataSet rename tables

I have a few SQLDataAdapters which select a MAX() value from a few
different tables.

Here is a sample of the SQL statement:
SELECT MAX(startdate) AS startdate
FROM some_table1
WHERE (startdate <= GETDATE())

The problem I have is this: When I select a few of those SQLDataAdapters
to generate a DataSet from them the list of DataAdapters shows:

Table (daSomeTable1)
Table (daSomeTable2)

Other (normally selected) tables show up in the list like this:
AnotherTable (daAnotherTable)

If I add the daSomeTable* DataAdapters I get the following error:
"Cannot generate a dataset that contains multiple tables with the same
name (Table)."

Changing the SQL statement to the following code didn't work:
SELECT MAX(startdate) AS startdate
FROM some_table1 AS some_table1
WHERE (startdate <= GETDATE())

Does someone have the solution to this problem? I prefer to put all
those DataAdapters in one DataSet, if possible.

Thanks in advance
Nov 19 '05 #1
1 1630
I found it. I could change the DataSet table name from the table mappings
collection. :)

"ASP.Net programmer" <me@none.com> wrote in news:42a02d1e$0$29627
$e*******@news.xs4all.nl:
I have a few SQLDataAdapters which select a MAX() value from a few
different tables.

Here is a sample of the SQL statement:
SELECT MAX(startdate) AS startdate
FROM some_table1
WHERE (startdate <= GETDATE())

The problem I have is this: When I select a few of those SQLDataAdapters to generate a DataSet from them the list of DataAdapters shows:

Table (daSomeTable1)
Table (daSomeTable2)

Other (normally selected) tables show up in the list like this:
AnotherTable (daAnotherTable)

If I add the daSomeTable* DataAdapters I get the following error:
"Cannot generate a dataset that contains multiple tables with the same
name (Table)."

Changing the SQL statement to the following code didn't work:
SELECT MAX(startdate) AS startdate
FROM some_table1 AS some_table1
WHERE (startdate <= GETDATE())

Does someone have the solution to this problem? I prefer to put all
those DataAdapters in one DataSet, if possible.

Thanks in advance


Nov 19 '05 #2

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

Similar topics

8
by: Nikhilesh Mehendale | last post by:
I have written a web service in C#, .NET 1.1 which reads a XML file into a dataset. This is just a plain XML file. First I use the Dataset.ReadXmlScheme function and pass the XML file to it. Then...
1
by: Ook | last post by:
I think I'm being bitten by holes in the documentation - documentation that assumes a certain knowledge of how dotnet works, knowledge that I lack :-) I downloaded and installed odbc.net. I...
6
by: Lars Netzel | last post by:
I have a VB.NET application based on MS access 2000 db. I have a 1 to many relation between 4 tables... tbl1 -> tbl2 -> tbl3 -> tbl4 (all with "one to many" relations) I need to create a...
6
by: Mark | last post by:
I'm trying to add a table to a dataset but get the error: "A DataTable named 'BordDates0040' already belongs to this DataSet." Code: Dim dtBordDates As DataTable dtBordDates =...
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...
6
by: Laura K | last post by:
This is probably a simple question but I want to make sure I am doing it right. I have a spoc with two select statements which results in two tables. Very Basic ...
11
by: Alan Mailer | last post by:
A project I'm working on is going to use VB6 as a front end. The back end is going to be pre-existing MS Access 2002 database tables which already have records in them *but do not have any...
1
by: Carl Pearson | last post by:
Howdy, All, Was trying to modify all tables in a particular database starting with the same prefix, i.e., "tbl_". Decided I'd rather have them all start with "_tbl_" instead. Being lazy,...
1
by: unsichtbar | last post by:
Sorry, but I'm pretty new to .NET/XML etc... I have the current code which I'm trying to output dynamically so it can be read into a flash file. The only issue is, it doesn't seem to actually do...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.