Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Populating Dataset with Table-Valued Function
Message
 
To
04/08/2010 10:15:32
Timothy Bryan
Sharpline Consultants
Conroe, Texas, United States
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Miscellaneous
Thread ID:
01475027
Message ID:
01475205
Views:
28
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));
>>>}
>>>
Previous
Reply
Map
View

Click here to load this message in the networking platform