Skip to main content

All Questions

Filter by
Sorted by
Tagged with
1 vote
1 answer
77 views

C# Razor using statements inconsistently require explicit curly brackets

I have a .NET Framework 4.7.2 web application. I am receiving the following yellow screen error from some of my Views and Partial Views but not all of them: Expected a "{" but found a "...
bowserm's user avatar
  • 1,056
0 votes
0 answers
29 views

Is there any way to use the same shortcut for two commands in visual studio 2015?

I'm using Visual Studio 2015 and I want to press (Ctrl + K, Ctrl + D) and, then have my code formated and using directives sorted and remove unsued ones. In summary, Pressing (Ctrl + K, Ctrl + D) ...
Horno's user avatar
  • 36
-2 votes
1 answer
3k views

"using static" throwing error [closed]

I'm trying to use using static System.Console; rather than using System; so I only have to type out WriteLine("bla") vs Console.WriteLine("bla"). My code is as follows: using static System.Console; ...
georgie__'s user avatar
2 votes
2 answers
684 views

Having to use a fully qualified class name

For some reason, after adding a reference to MySql.Data and adding using MySql.Data;, I'm unable to type new MySqlConnection() - instead I'm having to type new MySql.Data.MySqlClient.MySqlConnection();...
Danny Beckett's user avatar
3 votes
2 answers
3k views

what is the VBA for the USING statement

In csharp or vb.net we use the using statement for reasons that we know: One can open the database and close it automatically without writing it explicitly. I would like to do the samething in VBA ...
Bellash's user avatar
  • 8,257
2 votes
1 answer
259 views

What using directive can I implement in my .cs file that will let me use the "WebPageExecutingBase.Href()" Method?

I have a .cs file that generates HTML. Within it, I would like to make this code a little more fool proof by using the WebPageExecutingBase.Href() method, which I have done in many cshtml files before ...
VoidKing's user avatar
  • 6,432
533 votes
16 answers
1.1m views

The type or namespace name could not be found [duplicate]

I have a C# solution with several projects in Visual Studio 2010. One is a test project (I'll call it "PrjTest"), the other is a Windows Forms Application project (I'll call it "PrjForm"). There is ...
Anders's user avatar
  • 15.4k
7 votes
7 answers
5k views

Global "using" directives in VS2010/C#?

I'm pretty sure I know the answer but I'm wondering if there's a way to define a global "using" directive in my C# projects so that I don't have to repeat the directive on top of every code file. My ...
SonOfPirate's user avatar
  • 5,504