Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Fill a list view
Message
From
15/07/2005 18:14:00
 
General information
Forum:
ASP.NET
Category:
Forms
Environment versions
Environment:
C# 1.1
OS:
Windows Server 2003
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01033186
Message ID:
01033224
Views:
18
>>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform