|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
scope - integerdisposed and thereby not in scope further down in the method. But how do you "make scope" within a method for an int This is not possible ' i is unknown Using i as integer ...... end using ' i is unkopwn you can do ' i is unknown if true dim i as integer ..... end if ' i is unknown but thats stupid. How can you make "scope" in a method - it would be nice if this was possible Scope .... ... End Scope Am I missing something? Thanks My understanding of the Using statement in VB.Net 2005 is that it
ensures that an object is disposed when you exit the block Using sqc As New System.Data.SqlClient.SqlConnection(s) ' do something End Using is the same as dim sqc as System.Data.SqlClient try sqc = New System.Data.SqlClient.SqlConnection(s) ' do something finally sqc.Dispose end try You cannot use 'Using' with something that does not implement IDisposable. Within C# you can have an 'anonymous' block e.g. { int i = 19; } // i is not visible here but I have not seen anything like that in VB.Net. hth, Alan.
SQL query on Datatables [VB 2005]
Datagridview cell background color? simple thread question arraylist to use in another form Disable objectdatasource-control Textbox Click Event needed. 'System.Security.SecurityException' with .NET 2005 Only Class Instantiation Creating Multiple Listviews in Code Validating Data in a DataGrid |
|||||||||||||||||||||||