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..

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'.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.