hey all,
i have 2 tableadapters. is there any way to have 1 generic routine that will
return the correct datatable if i passed in a parm indicating which
tableadapter i want instanced, filled, and returned?
thanks,
rodchar 2 929
public enum Type {
FirstTable, SecondTable
}
public DataTable FillTable(Type type) {
DataTable datatable = new DataTable();
if (type==Type.FirstTable) { adapter1.Fill(datatable); }
else if (type==Type.SecondTable) { adapter2.Fill(datatable); }
return datatable;
}
rodchar wrote:
hey all,
i have 2 tableadapters. is there any way to have 1 generic routine that will
return the correct datatable if i passed in a parm indicating which
tableadapter i want instanced, filled, and returned?
thanks,
rodchar
thank you Steven. This helped.
"Steven Nagy" wrote:
>
public enum Type {
FirstTable, SecondTable
}
public DataTable FillTable(Type type) {
DataTable datatable = new DataTable();
if (type==Type.FirstTable) { adapter1.Fill(datatable); }
else if (type==Type.SecondTable) { adapter2.Fill(datatable); }
return datatable;
}
rodchar wrote:
hey all,
i have 2 tableadapters. is there any way to have 1 generic routine that will
return the correct datatable if i passed in a parm indicating which
tableadapter i want instanced, filled, and returned?
thanks,
rodchar
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: John J. Lee |
last post by:
I'm trying define a class to act as a Mock "handler" object for
testing urllib2.OpenerDirector.
OpenerDirector (actually, my copy of it) does dir(handler.__class__)
to find out what methods a...
|
by: Jim Jewett |
last post by:
Normally, I expect a subclass to act in a manner consistent
with its Base classes. In particular, I don't expect to
*lose* any functionality, unless that was the whole point of
the subclass. ...
|
by: Peter Kleiweg |
last post by:
I'm still new to Python. All my experience with OO programming
is in a distant past with C++. Now I have written my first class
in Python. The class behaves exactly as I want, but I would like
to...
|
by: Pierre Fortin |
last post by:
This quest for understanding started very innocently...
A simple error on my part, passing on args as "args" instead of "*args" to
os.path.join() led me to wonder why an error wasn't raised...
...
|
by: Stefan Behnel |
last post by:
Hi!
I'm trying to do this in Py2.4b1:
-------------------------------
import logging
values = {'test':'bla'}
logging.log(logging.FATAL, 'Test is %(test)s', values)...
|
by: Steven Bethard |
last post by:
So, as I understand it, in Python 3000, zip will basically be replaced
with izip, meaning that instead of returning a list, it will return an
iterator. This is great for situations like:
zip(*)...
|
by: Andreas Beyer |
last post by:
Hi,
If an exception gets raised while I am parsing an input file I would
like to know where (in which line) the error occured. I do not want to
create my own exception class for that purpose and...
|
by: TheDD |
last post by:
Hello all,
right now, i'm using the following macro to automatically add informations
to exceptions:
#define THROW(Class, args...) throw Class(__FILE__, __LINE__, ## args)
but AFAIK, it's...
|
by: Joel Hedlund |
last post by:
Hi!
The question of type checking/enforcing has bothered me for a while, and
since this newsgroup has a wealth of competence subscribed to it, I
figured this would be a great way of learning...
|
by: Guillermo |
last post by:
Hi,
This must be very basic, but how'd you pass the same *args several
levels deep?
def func2(*args)
print args # ((1, 2, 3),)
# i want this to output (1, 2, 3) as func1!
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
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...
|
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...
|
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...
|
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)...
|
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...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
by: Shællîpôpï 09 |
last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
| |