943,923 Members | Top Members by Rank

Ad:
  • C# Discussion Thread
  • Unsolved
  • Views: 7340
  • C# RSS
Dec 8th, 2008
0

Data collection from dataset using query

Expand Post »
hi,

i am doing a project using C#.
in my project, i stroed the database information into the dataset.
i do't know how to collect the data from dataset using query.

i know collect data from dataset using datarow method, but task is collect data from dataset by using query. if any body know please send ur information.

Thanks and Regards,

Karthikeyan S
Last edited by karthi_selva; Dec 8th, 2008 at 12:22 am.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Junior Poster in Training
karthi_selva is offline Offline
65 posts
since Oct 2008
Dec 10th, 2008
0

Re: Data collection from dataset using query

You have to use a DbDataAdapter for that. It has properties like SelectCommand. A DataSet is what it's says : a DataSet.
Reputation Points: 2035
Solved Threads: 645
Senior Poster
ddanbe is offline Offline
3,740 posts
since Oct 2008
Dec 10th, 2008
0

Re: Data collection from dataset using query

Click to Expand / Collapse  Quote originally posted by ddanbe ...
You have to use a DbDataAdapter for that. It has properties like SelectCommand. A DataSet is what it's says : a DataSet.
hi just explain briefly.

i not understand what u saying, if possible please send the code.
Reputation Points: 10
Solved Threads: 0
Junior Poster in Training
karthi_selva is offline Offline
65 posts
since Oct 2008
Dec 11th, 2008
0

Re: Data collection from dataset using query

You declare a dataAdapter or anything like that for example

C# Syntax (Toggle Plain Text)
  1. string sql = "Select * from Products"
  2. DbDataAdapter daProducts = new DbdataAdapter(sql, theNameOfyourConnection)
  3.  
  4. daProducts.Fill(dataset, "TableName")

This depends on your Database provider cos if you use SQL Provider U will have your dataAdapter declared as SqlDataAdapter if you use Jet 4.0....and all u will use OleDBDataAdapter hope that makes sense though
Reputation Points: 26
Solved Threads: 19
Posting Whiz in Training
Traicey is offline Offline
283 posts
since Mar 2008
Dec 11th, 2008
0

Re: Data collection from dataset using query

hi ,
this is for store the DB result into the Dataset.

ok after the execution of the aboue code. i like collect data from that dataset by using query not using datarow...


i think u understand

(my doupt is how to collects the data from dataset by using query no using datarow. for avoiding comparision operation i like to execute the query inside the dataset table. most of them told it is possible. but no body know the details.)
Reputation Points: 10
Solved Threads: 0
Junior Poster in Training
karthi_selva is offline Offline
65 posts
since Oct 2008
Dec 11th, 2008
0

Re: Data collection from dataset using query

Im trying to understand this... The above code is retrieving data from DataBase and store it on the dataSet using DataAdapter and dataset and a quiry which at the moment is Select statement, Now what kinda query wud u like to use to collect ur data from dataset, or maybe let me ask it this way, U wana read data from dataset and do what with it, maybe display it, using which control, I will have to admit I dont think I understand what ur asking
Reputation Points: 26
Solved Threads: 19
Posting Whiz in Training
Traicey is offline Offline
283 posts
since Mar 2008
Jan 7th, 2009
0

Re: Data collection from dataset using query

hi actually i stored some information in dataset.

i like to access that information from dataset using DML (query). this is a task.

currently we reterive the data from dataset by using datarow.

instead of process each element. i like to give dml query into dataset. that query reterive the data from dataset.

i think u understand my task.



i stored db informations in dataset because avoiding again and again access the db.

so from that dataset using dml query and collect the information.



if u understand please try to give idea, notes, sample code.


Regards,
Karthikeyan s
Reputation Points: 10
Solved Threads: 0
Junior Poster in Training
karthi_selva is offline Offline
65 posts
since Oct 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C# Forum Timeline: How to refresh Combobox items
Next Thread in C# Forum Timeline: What kind of aplication Can I create to test myself???





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC