All I had to do was to remove the space. Replace
x:Class ="SabarimalaiAyyapa.Page2"
with
x:Class="SabarimalaiAyyapa.Page2"
Visual Studio .NET Tips and Tricks, VB.NET Code Samples, C# Code Snippets, ASP.NET Code Samples, .NET Tips and Tricks, C# Tips & Tricks, Visual Studio 2010, .NET Framework Code Samples, VB.NET Tips & Tricks
if (value.Length <> 0)
if (value.Length != 0)
or
if (value.Length > 0)
Solution : The type or namespace name 'XElement' could not be found (are you missing a using directive or an assembly reference?)
Error Code
using System;
using System.Collections.Generic;
using System.Linq;
XElement Inv = new XElement("Invoice",
from items in FileContent
let fields = items.Split(',')
select new XElement("Item",
new XElement("ID", fields[0]),
new XElement("Name", fields[1]),
new XElement("Price", fields[2]),
new XElement("Availability", fields[3])
Solution
Inclusion of using System.Xml.Linq directive will solve the problem
System.Xml.Linq, C# Error codes, .Net Error codes, 'XElement' in C#, 'XElement' in .NET
Solution : "The ' ' character, hexadecimal value 0x20, cannot be included in a name."
XML Tag should not contain any white spaces.
Change
new XElement("Total Price", fields[4])
to
new XElement("TotalPrice", fields[4])
The best overloaded method match for 'System.Windows.Forms.MessageBox.Show(string)' has some invalid arguments
Solution : One possible solution is to check if the ‘ToString’ has braces
System.Text.StringBuilder CompleteAddress1 = new
System.Text.StringBuilder();
CompleteAddress1.Append( "105, Annanagar ");
CompleteAddress1.Append( "Chennai ");
CompleteAddress1.Append( "Tamil Nadu ");
‘ Error Line
MessageBox.Show(CompleteAddress1.ToString );
‘ Solution
MessageBox.Show(CompleteAddress1.ToString() );
Argument '1': cannot convert from 'method group' to 'string'
Function '
The error Function '
You can return a value from a Function procedure in any of the following ways:
· Assign the value to the Function procedure name and then perform an Exit Function statement.
· Assign the value to the Function procedure name and then perform the End Function statement.
· Include the value in a Return Statement (Visual Basic).
If control passes to Exit Function or End Function and you have not assigned any value to the procedure name, the procedure returns the default value of the return data type.
Error ID: BC42105
· Check your control flow logic and make sure you assign a value before every statement that causes a return.
It is easier to guarantee that every return from the procedure returns a value if you always use the Return statement. If you do this, the last statement before End Function should be a Return statement.
Most often this kind of error happens when the return is missed in the Catch block. It would be advisable to return a value for the error too as shown below
Function ReturnSomeVal() As String
Try
Dim Svalue As String
' Processing
Return sValue
Catch ex As Exception
Return vbNullString
Finally
End Try
End Function
Late bound resolution; runtime errors could occur
This error (Error ID: BC42017) occurs because an object is assigned to a variable declared to be of the Object Data Type.
When you declare a variable as Object, the compiler must perform late binding, which causes extra operations at run time. It also exposes your application to potential run-time errors. For example, if you assign a Form to the Object variable and then try to access the XmlDocument..::.NameTable property, the runtime throws a MemberAccessException because the Form class does not expose a NameTable property.
If you declare the variable to be of a specific type, the compiler can perform early binding at compile time. This results in improved performance, controlled access to the members of the specific type, and better readability of your code.
To avoid this error it is better to declare the data type of the variable
Private app As Excel.Application
Instead of
Private app As Object