Solved

SQL Command Question

Posted on 2004-09-05
3
202 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:
mnasman 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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
This video discusses moving either the default database or any database to a new volume.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

705 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now