CFF KB - Carrz-Fox-Fire Promotions Knowledge Base
CFF KB is all about 1 thing: The Sharing of Knowledge and the Power we gain from it.Knowledge Base
- Breadrumbs:
CS0103: The Name 'New' Does not exist in the current context.
- Article ID:
6258 - Date Created
Tuesday, August 2, 2022 - This Article Has been Viewed
463 times - Short Desc
The name 'New' does not exist in the current context. This Will happen if one of the following is true in C#. - Details
The code below uses New SqlParameter, but it is not properly formatted in both C# and VB.NET. - Recreate Issue
C# differs from VB.NET regarding lower or capital letters used for different types of key words.
In the below example, we have an upper case letter for the word 'New.'
This is only possible for VB.NET, not for C#.<%
getDD.Parameters.Add(New SqlParameter("@ddID", getID));
%>
So, in VB.NET, you cannot use a lower case letter.<%
getDD.Parameters.Add(new SqlParameter("@ddID", getID));
%> - Resolve Issue
Ensure you are not using upper case letters for certain words in C#.
This is because, in C#, we will use a lower case letter.<%
getDD.Parameters.Add(New SqlParameter("@ddID", getID));
%>
In VB.NET, we will use an upper case letter.<%
getDD.Parameters.Add(New SqlParameter("@ddID", getID));
%>
Share With Friends (Updated 6-8-2010)
Recent Articles
All Topics
- Coming Soon - Knowledge Exchange
Trending Articles
- Microsoft VBScript runtime error '800a0046' Permission denied FileSystemObject 24695
- Microsoft OLE DB Provider for SQL Server error '80040e57' String or binary data would be truncated. or The field is too small to accept the amount of data you attempted to add. Try inserting or pasting less data. 21297
- ADODB.Parameters error '800a0e7c' Parameter object is improperly defined 19544
- After Effects warning: Audio conforming failed for the following file .cfa. Perhaps due to disk space 17785
- The backup set holds a backup of a database other than the existing 16825