Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

SQL Command Question

Posted on 2004-09-05
3
Medium Priority
?
211 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 22

Accepted Solution

by:
Mohammed Nasman earned 200 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 Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Suggested Courses

730 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