It only helps me to be confused understanding what a multitiered app is.
If this code is in a user control that a web page uses and data layer is SQL server I count it as multiple layers/tiers.
I don't know, show me multitiered version of this so I can comment:)
Cetin
>Unfortunately, this isn't multi-tiered, Cetin, since you have your DataAccess directly in your UI. Tom was looking for a multi-tiered solution.
>
>~~Bonnie
>
>
>>>I have a multi tiered application I am working on and want to know the following:
>>>
>>>Using C#, can you create procedure in your data class using a SqlDataReader? I want to fill a drop down list. This is easy to due with a DataSet. Can anyone give me or point me to an example of using a SqlDataReader in a data class?
>>>
>>>Thank you.
>>>
>>>Tom
>>
>>IMHO it's also a correct way for static lists.
>>
>>private void fillMyCombo()
>>{
>> SqlConnection cn = new SqlConnection(
>> "Persist Security Info=False;Integrated Security=SSPI;database=pubs;server=localhost");
>> cn.Open() ;
>> SqlDataReader rdr = new
>> SqlCommand("select * from authors",cn).ExecuteReader(CommandBehavior.CloseConnection);
>> while (rdr.Read())
>> {
>> myCombo.Items.Add(String.Format("{0},{1}",rdr["au_fname"],rdr["au_lname"]));
>> }
>> cn.Close();
>>}
>>
Cetin