.Net/SQL Drop Table Problem
- From: "The VanDerbeck Group" <TheVanDerbeckGroup@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 23 Aug 2005 07:51:23 -0700
The code below generates the indicated error. As a newbie to vb and SQL I
have no idea how to track this down. I did verify that the connection state
is open. My suspicion is that I have to connect to a seperate "sysobjects"
database???
THE CODE:
Dim oSQLConnection As New SqlConnection("data source =" _
& "psi-sbs2k3 ;" _
& "initial catalog = 'JHH PRODUCT DATA' ;" _
& "Integrated Security=SSPI;" _
& "persist security info =True;")
oSQLConnection.Open()
Dim osqlCommand As New SqlCommand("if exists (select * from
dbo.sysobjects where id = object_id(N'[dbo].[dsdprod]') and
OBJECTPROPERTY(id, N'IsUserTable') = 1)" _
& " drop table [dbo].[dsdprod] ")
osqlCommand.ExecuteNonQuery()
ERROR GENERATED IS...
An unhandled exception of type 'System.InvalidOperationException' occurred
in system.data.dll
Additional information: ExecuteNonQuery: Connection property has not been
initialized.
.
- Follow-Ups:
- Re: .Net/SQL Drop Table Problem
- From: Siva M
- Re: .Net/SQL Drop Table Problem
- From: Marina
- RE: .Net/SQL Drop Table Problem
- From: The VanDerbeck Group
- Re: .Net/SQL Drop Table Problem
- Prev by Date: Re: System.IO.FileNotFoundException
- Next by Date: Help, I can't catch this exception
- Previous by thread: weird string problem
- Next by thread: RE: .Net/SQL Drop Table Problem
- Index(es):