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

nested query and dataset

Hi,

i am using the following query

string query = "SELECT *"+
"FROM DataSet"+
"WHERE Param_ID =(Select Data1 from testcases
where TestCaseID='TC001')
DataAdapter da=new DataAdapter();
mycommand = new OleDbCommand(query, mycon);
myds = new System.Data.DataSet();
da = new OleDbDataAdapter();
da.SelectCommand = mycommand;
===============PROBLEM================
//da.TableMappings.Add("Table", "testcases");
da.TableMappings.Add("Table", "DataSet");

if i add both the tables compiler gives error.
Apr 7 '08 #1
3 2313
I doubt that the *compiler* would complain about that. The runtime might
throw an exception - firstly because you have duplicated the
table-name, and second because you only seem to be returning a single
grid of data...

Perhaps post the actual error text?

Marc
Apr 7 '08 #2
capture the error with
try
{
da.TableMappings.Add("Table", "DataSet");
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}

Apr 7 '08 #3
Nannu,

As Marc wrote already will your code forever only returning one row.

As you want to retrieve two resultsets in one fill, you need at least to map
table and table1 (or any tablename you start with your fill).

Cor

"nannu" <na********@gmail.comschreef in bericht
news:d2**********************************@s33g2000 pri.googlegroups.com...
Hi,

i am using the following query

string query = "SELECT *"+
"FROM DataSet"+
"WHERE Param_ID =(Select Data1 from testcases
where TestCaseID='TC001')
DataAdapter da=new DataAdapter();
mycommand = new OleDbCommand(query, mycon);
myds = new System.Data.DataSet();
da = new OleDbDataAdapter();
da.SelectCommand = mycommand;
===============PROBLEM================
//da.TableMappings.Add("Table", "testcases");
da.TableMappings.Add("Table", "DataSet");

if i add both the tables compiler gives error.

Apr 7 '08 #4

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

Similar topics

0
by: Chi | last post by:
This is a problem that has been nagging me for a while, and I cannot figure out how to best solve the problem: I have a stored procedure that returns multi-level "nested" XML and inline XDR. My...
2
by: James Ankrom | last post by:
Why does this fail? Dim relResources As New Data.DataRelation("Application_Resources", ..Tables("User_Applications").Columns("Application_id"),...
4
by: Steve Klett | last post by:
(I posted this in ADO group, but I think this group will be better) Hi- I need to develop an FAQ section for our website. We would like to break up the FAQ by products, then categories with...
0
by: George Durzi | last post by:
I have a DataSet with 3 tables, and two DataRelations dsSubs.Tables.TableName = "Subscriptions" dsSubs.Tables.TableName = "AccountManagers" dsSubs.Relations.Add "AccountManagers_Subscriptions",...
1
by: Thu | last post by:
Hi, I create a Dataset to link three tables in my Access database. E.g. The three tables are , , . I then create 2 DataRelations, 1st relation (Order_Cust_Rel) links and using CustomerID field...
1
by: Steve C | last post by:
Hi, I'm having problems constructing a nested join. It's quite complex, so here's a simplfied example of the problem. Any thoughts on what I'm doig wrong - or if I've got the whole approach...
0
by: rupalirane07 | last post by:
Both grids displays fine. But the problem is only parent datagrid sorting works fine but when i clik on child datagrid for sorting it gives me error: NullReferenceException error Any...
0
by: wadesharp | last post by:
I would like to write a query to return nested data. The data has a master, child relationshiop and teh child is linked to the master record through the 3 column (LinkedKey). The reason this is all...
0
petepell
by: petepell | last post by:
Hello all, I am developing an application in VB 2008 that works with a SQL2005 DB to store and manipulate employee data. In one section of the app I want to be able to show a treeview of the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
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,...
0
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...
0
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,...
0
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...
0
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...
0
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,...

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.