Solved

SQL Command Question

Posted on 2004-09-05
3
208 Views
Last Modified: 2010-04-23
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).
0
Comment
Question by:mubama0n
3 Comments
 
LVL 22

Accepted Solution

by:
Mohammed Nasman earned 50 total points
ID: 11983469
use
Imports System.Data.SqlClient

then

Dim cmd as SqlCommand
0
 
LVL 4

Expert Comment

by:Kaarthick
ID: 11990625
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.
0
 

Author Comment

by:mubama0n
ID: 11990672
Thanlks for your recommendation.
0

Featured Post

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question