Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Fill a list view
Message
De
15/07/2005 18:14:00
 
Information générale
Forum:
ASP.NET
Catégorie:
Formulaires
Versions des environnements
Environment:
C# 1.1
OS:
Windows Server 2003
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01033186
Message ID:
01033224
Vues:
20
>>I'm doing it in the click event, but after the connection is closed, should i do it before the connection is closed?<

No, the connection has absolutely nothing to do with it. Remember, DataSets in .NET are totally disconnected from the backend data. Also, I hope you only have all the connection stuff in your click event just because you're playing around with seeing how things work. In actuality, you should have separate data access classes that contain this kind of code.

However, I think I see what the problem is. You've defined your DataSet in the Click event. It's scope remains in that event handler and that's it. You need to define it as a member of the Form (at the very beginnning of your code for the form, where all the variables are declared). Then it will stay in scope for the whole form and your ListBox can then see it and use it.

~~Bonnie
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform