see my code pls

Imports System.Data.SqlClient
Inherits System.Windows.Forms.Form
Dim myConnection As SqlConnection
Dim myCommand As SqlCommand
Dim dr As SqlDataReader

' the database we'll be connecting to
myConnection= New SqlConnection("Data Source=MSALAMEEN;Initial Catalog=Biometric;Integrated Security=True")

I am having declaration in the last line above(myConnection)

Recommended Answers

All 2 Replies

"Inherits System.Windows.Forms.Form" did you intend inherits or did you mean "import"? Also use System.Windows.Forms and dont repeat the last class name.

"Inherits System.Windows.Forms.Form" did you intend inherits or did you mean "import"? Also use System.Windows.Forms and dont repeat the last class name.

I think it's part of a form where he discarded the class name but left the inheritance modifier. :confused:

To the OP, do you get the same error when you initiliaze without the connection string? I.e.: myConnection= New SqlConnection()

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.