Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SqlDataReader in a Data Class
Message
De
27/10/2004 10:17:05
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
27/10/2004 10:04:00
Information générale
Forum:
ASP.NET
Catégorie:
Formulaires Web
Versions des environnements
Environment:
ASP.NET
OS:
Windows 2000 SP3
Network:
Windows 2000 Server
Database:
MS SQL Server
Divers
Thread ID:
00954589
Message ID:
00954858
Vues:
16
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
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform