C# Corner
Tech
News
Videos
Forums
Jobs
Books
Events
More
Interviews
Live
Learn
Training
Career
Members
Blogs
Challenges
Certification
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Refer
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
.NET
ADO.NET
Android
ASP.NET
C#
Databases & DBA
Design Patterns & Practices
iOS
Java
OOP/OOD
SharePoint
Software Testing
Web Development
WPF
View All
2
Reply
What is using keyword in C#?
Mohan Gupta
12y
1.6k
0
Reply
Delete Row
Delete Column
Insert Link
×
Insert
Cancel
Embed YouTube Video
×
Width (%)
Height (%)
Insert
Cancel
Table Options
×
Rows
Columns
First row as header
Create Table
Insert Image
×
Selected file:
Alignment
Left
Center
Right
Select an image from your device to upload
Upload to Server
Cancel
Submit
using keyword is used Remove unused memory form the objectUsing(SqlConnection objConn=new SqlConnection()) { }
Ananth G
9y
0
There are two usage of "using" keyword 1. to import namespaces e.g using System;using System.IO; 2. to handle unmanaged resourcesAn object inside or outside the .NET Framework, which uses external code (For example: file handles, streams, DB connections). The Garbage Collector can't handle unmanaged resources, so we need to release them manually. e.g using (Stream input = File.OpenRead(filename)) {... } This can only be used with types that implement IDisposable.
Smita Jagtap
12y
0
What are properties in C#?
What is difference between Enum and Struct?
Message