Question 'SqlConnection' is ambiguous in the namespace 'System.Data.SqlClient'.

sonia.sardana

Active member
Joined
Jan 25, 2009
Messages
35
Programming Experience
Beginner
hey frnds,I have imports namespace System.Data.SqlClient.I just create object of SqlConnection,But error is there-
'SqlConnection' is ambiguous in the namespace 'System.Data.SqlClient'.

.I know its a silly Question i m asking,But its not working..Plz help me out..
VB.NET:
Imports System.Data.SqlClient
Public Class Form1
    Dim conn As New SqlConnection
End Class
 
Its solved Frnds..No need to reply..

Solution--
Hi,

Did you include a reference to the assembly "System.Data.SqlClient" in a VisualStudio.NET project,

If So, then remove it from refrence of your project. it is only necessary to have a reference to System.Data. If you reference both assemblies like
(1. Reference : System.Data.SqlClient, 2.Imports System.Data.SqlClient(Direct Code)) , you get this error in VisualStudio:

'SqlConnection' is ambiguous in the namespace 'System.Data.SqlClient'.
 
Back
Top