Solved

SQL Command Question

Posted on 2004-09-05
3
205 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Paging GridView 7 48
Get list of word ducuments in a folder 10 35
Saveas need to save a copy 16 26
Trying to get PDF to open as "Open,Save,Cancel" instead of as a pop-up. 6 31
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 …
Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

911 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

20 Experts available now in Live!

Get 1:1 Help Now