I definitely bristled at sticking SQL code into my app like that, even if it's just a call to a function that's stored in the database. I reckon I'll have to set aside purity for pragmatism.
Thanks,
Eric
>Hi Eric,
>
>I see you got something that works, and it makes sense. The only other suggestion I have is by using SQL like this you have removed your ability to be database independant. You could also call your getCommitteMembers() method from within a stored procedure I believe. That would get you back to still using stored procedures and keeping your SQL specific code out. Just something to think about.
>Tim
>
>>Ah, thanks Rob. It wasn't quite there but put me on the right track to make this work:
>>
>>
>> public DataSet getCommitteeMembers(int iComId)
>> {
>> SqlCommand cCmd = new SqlCommand(String.Format("SELECT * FROM CommitteeMembers({0})",iComId));
>> return this.GetDataSet(cCmd, "crsCommitteMembers");
>> }
>>
>>
>>Works like a charm.
>>
>>Thanks!
>>
>>Eric
>>
>>>Try this:
>>>
>>>
>>>public DataSet getCommitteesById(int iComId)
>>>{
>>> return this.GetDataSet("SELECT * FROM getCommitteeMembers(@ComId)", this.CreateParameter("@ComId", iComId));
>>>}
>>>