Linked Questions
97 questions linked to/from What are the uses of "using" in C#?
2 votes
1 answer
54 views
Encapsulating data objects from a class [closed]
Hello everyone I am fairly new to C# and programming. I'm learning some bits and bytes about good practices when it comes to programming and declaring variables. I'm developing a POS system in C# and ...
-3 votes
4 answers
97 views
confusion in understanding using syntax [closed]
i am unable to understand the using syntax of c#. i have seen many code snippets using code like. using (StreamReader rdr = File.OpenText("file.txt")) { //do stuff } What is the meaning of that ...
-3 votes
1 answer
82 views
What is the difference between the using statement and not storing a object
How do these two different implementations effect performance or how objects are allocated in memory? using (ICryptoTransform encryptor = AES.CreateEncryptor()) { byte[] cipherBytes = encryptor....
-1 votes
3 answers
74 views
A few problems with c# : the program doesn't read files from my array, having trouble with line.split
so I'm having trouble with the program recognizing the values of my array elements (The name 'a' does not exist in the current context) , plus i can't get line.split to work(I need it to read the next ...
1 vote
1 answer
55 views
CA2202 Do not dispose objects multiple times, How to Solve?
private string GetFileContent(string path) { if(File.Exists(HttpContext.Current.Server.MapPath(path))) { FileStream fs=null; try { fs = new FileStream(...
1 vote
1 answer
67 views
Can't add JSON connection in if statement
I am working on website and I want upload data to a database that I have connected to in app.aspx.cs I am encountering the below error every time I start the app: Error CS0149 Method name ...
0 votes
2 answers
44 views
Is my logic correct? I'm trying to get data from combobox(dropdownlist) and use that data to search and display information in checkedlistbox
I keep getting this error whenever I do the search: Invalid column name 'datafromcombobox' I tried hardcode the data in my SQL query and it works. Any idea what's wrong with my code? Here's the ...