Link to home
Start Free TrialLog in
Avatar of mubama0n
mubama0n

asked on

SQL Command Question

Hi , I tried to Define The (Sqlcommand) Class On my application , But It gives me an erro in the difinition , I do like this :

Imports System.Data
Imports System.Data.OleDb
Imports System.Data.OleDb.OleDbDataAdapter
Imports System.Data.SqlClient.SqlCommand
---
Dim Cmd as SqlCommand '---> Here It gives me a blue line under the (SqlCommand).
ASKER CERTIFIED SOLUTION
Avatar of Mohammed Nasman
Mohammed Nasman
Flag of Palestine, State of image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Kaarthick
Kaarthick

Hi mubama0n,
 
The Imports statement is not a requirement it is simply for coding convenience so that shorter names can be used.
In your sample if you change the Dim part as following it might work:

Dim Cmd as System.Data.SqlClient.SqlCommand

If you start declaring all the variables as like the above one then the code might be too messy, so it is better to Import the Namespace and then proceed.
Avatar of mubama0n

ASKER

Thanlks for your recommendation.