0

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
1
Contributor
1
Reply
3
Views
8 Years
Discussion Span
Last Post by sonia sardana
0

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

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.