Click here to Skip to main content
15,928,207 members
Home / Discussions / C#
   

C#

 
GeneralRe: Completely OT request Pin
Heath Stewart21-Jun-04 2:42
protectorHeath Stewart21-Jun-04 2:42 
GeneralRe: Completely OT request Pin
Jeremy Kimball21-Jun-04 2:47
Jeremy Kimball21-Jun-04 2:47 
GeneralRe: C# Load a form into a Panel? Pin
Ronni Marker21-Jun-04 3:17
Ronni Marker21-Jun-04 3:17 
GeneralRe: C# Load a form into a Panel? Pin
Heath Stewart21-Jun-04 3:27
protectorHeath Stewart21-Jun-04 3:27 
GeneralSimple Question: Get Time from terminal Pin
Stuggo21-Jun-04 1:17
Stuggo21-Jun-04 1:17 
GeneralRe: Simple Question: Get Time from terminal Pin
Colin Angus Mackay21-Jun-04 1:19
Colin Angus Mackay21-Jun-04 1:19 
GeneralCasting DataSet problem Pin
marspd21-Jun-04 1:00
marspd21-Jun-04 1:00 
GeneralRe: Casting DataSet problem Pin
Heath Stewart21-Jun-04 2:26
protectorHeath Stewart21-Jun-04 2:26 
First, it is not CLS-compliant to have more than one method with the same name that differs only by the return type. Instead, rename one or both of your methods, such as GetTestSupplierList or something more suitable.

Second, your DataAdapter (or however you're filling your TestDS) should actually fill an instance of that TestDS class. So, perhaps add a Type parameter to your Factory.GetDataSet method, something like this:
public static DataSet GetDataSet(string storedProc, IDictionary parms, Type dsType)
{
  // Do some argument checking...
 
  if (dsType != typeof(DataSet) || dsType.BaseType != typeof(DataSet))
    throw new ArgumentException("Not a valid DataSet type.", "dsType");
 
  DataSet ds = (DataSet)Activator.CreateInstance(dsType);
 
  // You're got your generic or typed DataSet - now just fill and return it...
}
You should be able to cast it, since the return of GetDataSet still returns a DataSet. Such a method works fine in our enterprise application.

 

Microsoft MVP, Visual C#
My Articles
GeneralCommunication with a Unix box Pin
eif21-Jun-04 0:23
eif21-Jun-04 0:23 
GeneralRe: Communication with a Unix box Pin
Heath Stewart21-Jun-04 3:35
protectorHeath Stewart21-Jun-04 3:35 
Generalread only DataGridColumn Pin
vcorn21-Jun-04 0:12
vcorn21-Jun-04 0:12 
GeneralRe: read only DataGridColumn Pin
vcorn21-Jun-04 0:17
vcorn21-Jun-04 0:17 
GeneralBind arraylist to Datagrid Pin
uyenchi21-Jun-04 0:09
uyenchi21-Jun-04 0:09 
GeneralRe: Bind arraylist to Datagrid Pin
Heath Stewart21-Jun-04 3:43
protectorHeath Stewart21-Jun-04 3:43 
QuestionHow to lock Clipboard? Pin
sachinkalse20-Jun-04 23:10
sachinkalse20-Jun-04 23:10 
AnswerRe: How to lock Clipboard? Pin
Heath Stewart21-Jun-04 3:23
protectorHeath Stewart21-Jun-04 3:23 
GeneralRe: How to lock Clipboard? Pin
sachinkalse22-Jun-04 15:26
sachinkalse22-Jun-04 15:26 
GeneralRe: How to lock Clipboard? Pin
Heath Stewart22-Jun-04 15:37
protectorHeath Stewart22-Jun-04 15:37 
GeneralEnum's in different assemblies Pin
Simon_uk20-Jun-04 22:31
Simon_uk20-Jun-04 22:31 
GeneralRe: Enum's in different assemblies Pin
Colin Angus Mackay21-Jun-04 0:12
Colin Angus Mackay21-Jun-04 0:12 
GeneralRe: Enum's in different assemblies Pin
Simon_uk21-Jun-04 0:44
Simon_uk21-Jun-04 0:44 
GeneralRe: Enum's in different assemblies Pin
Colin Angus Mackay21-Jun-04 1:17
Colin Angus Mackay21-Jun-04 1:17 
GeneralRe: Enum's in different assemblies Pin
Simon_uk21-Jun-04 2:27
Simon_uk21-Jun-04 2:27 
Questionhow to get machine constats in .NET Pin
Daniel Zaharia20-Jun-04 22:24
Daniel Zaharia20-Jun-04 22:24 
AnswerRe: how to get machine constats in .NET Pin
Stefan Troschuetz20-Jun-04 22:37
Stefan Troschuetz20-Jun-04 22:37 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.