Hi,
when do i need this: Imports System.Data
and when this: Imports System.Data.Sql Client?
More specifically, when i want to perform a select or update of a table
using:
connection = New SqlConnection(c onnectionstr)
comd = New SqlCommand()
do i need both?
Thanks
Albert 4 5182
Imports statement supplies references to all definitions in the namespace.
So, if you use any classes from the System.Data namespaces, use Imports
System.Data. In your example both SqlConnection and SqlCommand belong to the
System.Data.Sql Client namespace, so use Imports System.Data.Sql Client.
In fact, you can always use full names like
connection = New System.Data.Sql Client.SqlConne ction(connectio nstr)
In this case you don't need to use Imports statement.
--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET] http://msmvps.com/blogs/egoldin http://usableasp.net
"Albert" <wx***@sss.sdwr ote in message
news:%2******** ********@TK2MSF TNGP03.phx.gbl. ..
Hi,
when do i need this: Imports System.Data
and when this: Imports System.Data.Sql Client?
More specifically, when i want to perform a select or update of a table
using:
connection = New SqlConnection(c onnectionstr)
comd = New SqlCommand()
do i need both?
Thanks
Albert
Thanks,
can you give me an example where i need imports.system. data, or with other
words, what are the classes from System.Data namespaces?
Thanks
"Eliyahu Goldin" <RE************ **************@ mMvVpPsS.orgsch reef in
bericht news:%2******** ********@TK2MSF TNGP02.phx.gbl. ..
Imports statement supplies references to all definitions in the namespace.
So, if you use any classes from the System.Data namespaces, use Imports
System.Data. In your example both SqlConnection and SqlCommand belong to
the System.Data.Sql Client namespace, so use Imports System.Data.Sql Client.
In fact, you can always use full names like
connection = New System.Data.Sql Client.SqlConne ction(connectio nstr)
In this case you don't need to use Imports statement.
--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET] http://msmvps.com/blogs/egoldin http://usableasp.net
"Albert" <wx***@sss.sdwr ote in message
news:%2******** ********@TK2MSF TNGP03.phx.gbl. ..
>Hi,
when do i need this: Imports System.Data and when this: Imports System.Data.Sql Client?
More specifically, when i want to perform a select or update of a table using: connection = New SqlConnection(c onnectionstr) comd = New SqlCommand()
do i need both? Thanks Albert
Sure. http://msdn.microsoft.com/en-us/libr...stem.data.aspx
--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET] http://msmvps.com/blogs/egoldin http://usableasp.net
"Albert" <wx***@sss.sdwr ote in message
news:%2******** ********@TK2MSF TNGP06.phx.gbl. ..
Thanks,
can you give me an example where i need imports.system. data, or with other
words, what are the classes from System.Data namespaces?
Thanks
"Eliyahu Goldin" <RE************ **************@ mMvVpPsS.orgsch reef in
bericht news:%2******** ********@TK2MSF TNGP02.phx.gbl. ..
>Imports statement supplies references to all definitions in the namespace. So, if you use any classes from the System.Data namespaces, use Imports System.Data. In your example both SqlConnection and SqlCommand belong to the System.Data.Sql Client namespace, so use Imports System.Data.Sq lClient.
In fact, you can always use full names like connection = New System.Data.Sql Client.SqlConne ction(connectio nstr)
In this case you don't need to use Imports statement.
-- Eliyahu Goldin, Software Developer Microsoft MVP [ASP.NET] http://msmvps.com/blogs/egoldin http://usableasp.net
"Albert" <wx***@sss.sdwr ote in message news:%2******* *********@TK2MS FTNGP03.phx.gbl ...
>>Hi,
when do i need this: Imports System.Data and when this: Imports System.Data.Sql Client?
More specifically, when i want to perform a select or update of a table using: connection = New SqlConnection(c onnectionstr) comd = New SqlCommand()
do i need both? Thanks Albert
Thanks
"Eliyahu Goldin" <RE************ **************@ mMvVpPsS.orgsch reef in
bericht news:Ok******** ******@TK2MSFTN GP06.phx.gbl...
Sure.
http://msdn.microsoft.com/en-us/libr...stem.data.aspx
--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET] http://msmvps.com/blogs/egoldin http://usableasp.net
"Albert" <wx***@sss.sdwr ote in message
news:%2******** ********@TK2MSF TNGP06.phx.gbl. ..
>Thanks,
can you give me an example where i need imports.system. data, or with other words, what are the classes from System.Data namespaces? Thanks
"Eliyahu Goldin" <RE************ **************@ mMvVpPsS.orgsch reef in bericht news:%2******** ********@TK2MSF TNGP02.phx.gbl. ..
>>Imports statement supplies references to all definitions in the namespace. So, if you use any classes from the System.Data namespaces, use Imports System.Data. In your example both SqlConnection and SqlCommand belong to the System.Data.Sql Client namespace, so use Imports System.Data.S qlClient.
In fact, you can always use full names like connection = New System.Data.Sql Client.SqlConne ction(connectio nstr)
In this case you don't need to use Imports statement.
-- Eliyahu Goldin, Software Developer Microsoft MVP [ASP.NET] http://msmvps.com/blogs/egoldin http://usableasp.net
"Albert" <wx***@sss.sdwr ote in message news:%2****** **********@TK2M SFTNGP03.phx.gb l... Hi,
when do i need this: Imports System.Data and when this: Imports System.Data.Sql Client?
More specifically, when i want to perform a select or update of a table using: connection = New SqlConnection(c onnectionstr) comd = New SqlCommand()
do i need both? Thanks Albert This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: David Lozzi |
last post by:
I'm trying to do this:
<%@ Page Language="VB" %>
<script runat="server">
Imports System.Data
Imports System.Data.SqlClient
But i get this error on line 4:
|
by: Chris Langston |
last post by:
I have a Web Server running IIS 5 or 6 on Windows 2K and Windows 2003 Server
that is experiencing strange shutdown problems. We are using ASP.NET v1.1
and our application is written in VB.NET
Here's the scenario:
1. .NET Windows Client on a remote machine makes a web service call to
update tables on a Web Server running SQL Server...
|
by: |
last post by:
I'm picking up an 'IMPORTS' error for a simple database insert based on two
input entry boxes in my form?
It says an 'Imports' statement must preceede any declarations....... is this
perahps the '@' symbol??
Any help appreciated!
Thanks
Jason
|
by: Shapper |
last post by:
Hello,
I am working in a web site where all the code is placed in aspx.vb
files.
After a while I realized that many functions included in my aspx.vb
files where common to all pages.
I created a new file named common.vb where I created a class named
common and where I place all common functions:
|
by: danthman |
last post by:
Can someone tell me why the following VB.NET code doesn't work?
-----
Imports System.Data.SqlClient
Partial Class PageHeader
Inherits System.Web.UI.UserControl
Public ConnectionObjG As SqlConnection = New SqlConnection()
| |
by: chilli |
last post by:
Imports System.Data.SqlClient
Imports CrystalDecisions.Shared
Imports CrystalDecisions.CrystalReports
imports system.data.sqlclient
imports system.data.oledb
|
by: BillE |
last post by:
Does a subclass have to import namespaces which were already imported by the
superclass?
I have a base class which imports the System.Data.SQLClient namespace to use
the dataset member.
When I inherit this base class, the subclass must also import the
System.Data.SQLClient namespace to use its members.
I thought that a subclass would...
|
by: weird0 |
last post by:
This is the exception that I get when i create a webserivce obj and
call. The error comes on the webmethod call, when it opens a
connection to the db.
How do I fix it? What is the solution to this?
System.Web.Services.Protocols.SoapException: Server was unable to
process request. ---System.Data.SqlClient.SqlException: An attempt
to...
|
by: Pedro Dinis |
last post by:
i have this class library that connects to the database(see appconfig below)
compiling 0 errors but when its running i amhaving this error
An unhandled exception of type 'System.NullReferenceException' occurred in
my_deepot_common.dll Object reference not set to an instance of an obj
int this line
public...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...
| |