Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ObjectDataSource and SqlDataSource parameters

Reply
Thread Tools

ObjectDataSource and SqlDataSource parameters

 
 
tshad
Guest
Posts: n/a
 
      02-04-2010
I have a GridView that has both SqlDataSources and ObjectDataSources. I use
to only have 3 SqlDataSources and I usually set my parameters in a method
where I pass the SqlDataSource as a parameter and set the parameters based
on which parameter is passed.

***************************************
protected void SetData(SqlDataSource sds)
{
string exceptionTypes = "";
string jobs = "";
JobBucketList jobsList = new JobBucketList();

// Set up the parameters

sds.SelectParameters.Clear();

if (sds == SqlDataSource3)
...
}
***************************************

This worked fine until I added ObjectDataSource. I now need to pass either
an ObjectDataSource or SqlDataSource but they are different
They both are DataSourceControls, but DataSourceControl doesn't have a
SelectParameters parameter like the others do.

How can I use the method for both?

Thanks,

Tom


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problems with Parameters and SQLDataSource =?Utf-8?B?RGFuaWVsIFIuIEgu?= ASP .Net 6 12-31-2009 11:31 AM
Moving SqlDataSource to ObjectDataSource. need help Raja ASP .Net 2 03-14-2008 09:12 PM
ObjectDataSource method as another ObjectDataSource David Thielen ASP .Net Web Controls 3 03-23-2006 01:50 AM
ObjectDataSource, SqlDataSource, DataSet osh ASP .Net 0 01-18-2006 03:06 PM
ObjectDataSource feeding off a SqlDataSource Keith Patrick ASP .Net Web Controls 0 12-16-2005 12:08 AM



Advertisments