Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: .NET3.5
Helloo ,
 
Can anyone help me i got this issue ,how solve this
Posted 5-Feb-13 2:09am
Mamtha7436
Comments
gagan sawaliya at 5-Feb-13 7:13am
   
post some code
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

If you need to return a DataSet, and all you have is a DataTable, you can add the DataTable to a dummy DataSet and return that. Here's an example:
public DataSet DoSomething()
{
  DataTable people = GetPeopleWhoMatchSomeCriteria();
  DataSet dummySet = new DataSet();
  dummySet.Tables.Add(people);
  return dummySet;
}
The alternative is to change the return type from DataSet to DataTable.
  Permalink  
Comments
thatraja at 5-Feb-13 13:59pm
   
5
 
Hi Pete!
Pete O'Hanlon at 5-Feb-13 14:08pm
   
How do mate? How are you doing?
thatraja at 5-Feb-13 14:29pm
   
I'm OK, It's been long time, hope you're doing great. I come back here today....(I was inactive here)
Pete O'Hanlon at 5-Feb-13 14:51pm
   
I'm fine thanks. Busy busy. Hope you're keeping well.
Sergey Alexandrovich Kryukov at 5-Feb-13 23:53pm
   
Answered without repeating what the compiler already told to him :-), a 5.
—SA
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

you can't cast a DataTable to DataSet.
  Permalink  
Comments
Pete O'Hanlon at 5-Feb-13 7:43am
   
That doesn't really help solve the issue though, does it? You're just telling him what the compiler already told him.
sarahnimy at 5-Feb-13 23:12pm
   
actually, im completely new to Asp.Net...so my knowledge is limited....but thanks anyway for your solution.
No one told me the alternate method

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 406
1 /\jmot 180
2 Suraj Sahoo | Coding Passion 170
3 Afzaal Ahmad Zeeshan 159
4 BillWoodruff 154
0 OriginalGriff 8,344
1 Sergey Alexandrovich Kryukov 7,407
2 DamithSL 5,634
3 Maciej Los 5,024
4 Manas Bhardwaj 4,986


Advertise | Privacy | Mobile
Web03 | 2.8.1411023.1 | Last Updated 5 Feb 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100