ObjectDataSource and SqlDataSource parameters

T

tshad

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,021
Latest member
AkilahJaim

Latest Threads

Top