473,573 Members | 2,866 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Inserts into a DB with a Command

Teo
Hi! Sorry for my many postings on this Newsgroup. I am new to ADO.NET and I
got Sceppa's book on ADO.NET. It's a great book but covers a lot on the
DataAdapter and Offline Data. Now, if I want to Insert Data into my MSDE
Database, can I do it without using the DataAdapter?
Here are the steps I use to insert the data.
Open Connection
Add Parameters, set direction and specify value.
Call my connection.Exec uteNonQuery()
Close the Connection.

Now, I keep getting this error on the Execute reader. I am in no point
calling a Reader for the table. I just specify my stored procedure (that
only have INSERT statements) and I just want to insert the values, not
retrieve anything.
This is the error I get "Additional information: ExecuteReader: Connection
property has not been initialized."
Do you know what might be causing this? I am using a SQLConnection and
SQLCommand. That's all.

Teo
Nov 19 '05 #1
5 1770
I believe all those methods use the ExecuteReader method in the background,
so that is why the top level in the stack has that.

If you post some specific code, we can be more helpful. It sounds like your
are not setting the Connectio property of your command.

"Teo" <no********@hom sany.net> wrote in message
news:u$******** ******@TK2MSFTN GP12.phx.gbl...
Hi! Sorry for my many postings on this Newsgroup. I am new to ADO.NET and I got Sceppa's book on ADO.NET. It's a great book but covers a lot on the
DataAdapter and Offline Data. Now, if I want to Insert Data into my MSDE
Database, can I do it without using the DataAdapter?
Here are the steps I use to insert the data.
Open Connection
Add Parameters, set direction and specify value.
Call my connection.Exec uteNonQuery()
Close the Connection.

Now, I keep getting this error on the Execute reader. I am in no point
calling a Reader for the table. I just specify my stored procedure (that
only have INSERT statements) and I just want to insert the values, not
retrieve anything.
This is the error I get "Additional information: ExecuteReader: Connection
property has not been initialized."
Do you know what might be causing this? I am using a SQLConnection and
SQLCommand. That's all.

Teo

Nov 19 '05 #2
Teo
Hey Marina, sure, here's my VB code below, I am trying to just do a
ExecuteNonQuery , so all the values I assign before that go into the DB with
the stored procedure.
Here is the code.
Thanks so much,
Teo

Private Sub btnagregar_Clic k(ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles btnagregar.Clic k

Dim cedula, nombre, apellido, direccion, ciudad, estado, zip, apostal As
String

Dim estudiante, privada, comercial, instrumentos, multimotor, instructor,
atp As Boolean

Dim fechanacimiento As Date

Dim param As SqlParameter





'Asignar valores

cedula = txtid.Text

apellido = txtapellido.Tex t

nombre = txtnombre.Text

direccion = txtdireccion.Te xt

ciudad = txtciudad.Text

estado = txtestado.Text

zip = txtzip.Text

apostal = txtapostal.Text

fechanacimiento = CDate(dtpfechan acimiento.Value )

estudiante = chkestudiante.C heckState

privada = chkprivada.Chec kState

comercial = chkcomercial.Ch eckState

instrumentos = chkinstrumentos .CheckState

multimotor = chkmulti.CheckS tate

instructor = chkinstructor.C heckState

atp = chkatp.CheckSta te

cn.Open()

param = cm.Parameters.A dd("@id", SqlDbType.Char, 15)

param.Value = cedula

param.Direction = ParameterDirect ion.Input

param = cm.Parameters.A dd("@apellido" , SqlDbType.VarCh ar, 50)

param.Value = apellido

param.Direction = ParameterDirect ion.Input

param = cm.Parameters.A dd("@nombre", SqlDbType.VarCh ar, 50)

param.Value = nombre

param.Direction = ParameterDirect ion.Input

param = cm.Parameters.A dd("@direccion" , SqlDbType.VarCh ar, 200)

param.Value = direccion

param.Direction = ParameterDirect ion.Input

param = cm.Parameters.A dd("@ciudad", SqlDbType.VarCh ar, 50)

param.Value = ciudad

param.Direction = ParameterDirect ion.Input

param = cm.Parameters.A dd("@estado", SqlDbType.VarCh ar, 50)

param.Value = estado

param.Direction = ParameterDirect ion.Input

param = cm.Parameters.A dd("@zip", SqlDbType.VarCh ar, 10)

param.Value = zip

param.Direction = ParameterDirect ion.Input

param = cm.Parameters.A dd("@apostal", SqlDbType.VarCh ar, 200)

param.Value = apostal

param.Direction = ParameterDirect ion.Input

param = cm.Parameters.A dd("@fechanacim iento", SqlDbType.DateT ime, 8)

param.Value = fechanacimiento

param.Direction = ParameterDirect ion.Input

param = cm.Parameters.A dd("@estudiante ", SqlDbType.Char, 10)

param.Value = estudiante

param.Direction = ParameterDirect ion.Input

param = cm.Parameters.A dd("@privada", SqlDbType.Char, 10)

param.Value = privada

param.Direction = ParameterDirect ion.Input

param = cm.Parameters.A dd("@comercial" , SqlDbType.Char, 10)

param.Value = comercial

param.Direction = ParameterDirect ion.Input

param = cm.Parameters.A dd("@instrument os", SqlDbType.Char, 10)

param.Value = instrumentos

param.Direction = ParameterDirect ion.Input

param = cm.Parameters.A dd("@multi", SqlDbType.Char, 10)

param.Value = multimotor

param.Direction = ParameterDirect ion.Input

param = cm.Parameters.A dd("@instructor ", SqlDbType.Char, 10)

param.Value = instructor

param.Direction = ParameterDirect ion.Input

param = cm.Parameters.A dd("@atp", SqlDbType.Char, 10)

param.Value = atp

param.Direction = ParameterDirect ion.Input

cm.ExecuteNonQu ery()



MsgBox("Su entrada ha sido procesada...")

cn.Close()

End Sub

"Marina" <zl*******@nosp am.hotmail.com> wrote in message
news:%2******** ********@tk2msf tngp13.phx.gbl. ..
I believe all those methods use the ExecuteReader method in the background, so that is why the top level in the stack has that.

If you post some specific code, we can be more helpful. It sounds like your are not setting the Connectio property of your command.

"Teo" <no********@hom sany.net> wrote in message
news:u$******** ******@TK2MSFTN GP12.phx.gbl...
Hi! Sorry for my many postings on this Newsgroup. I am new to ADO.NET and
I
got Sceppa's book on ADO.NET. It's a great book but covers a lot on the
DataAdapter and Offline Data. Now, if I want to Insert Data into my MSDE
Database, can I do it without using the DataAdapter?
Here are the steps I use to insert the data.
Open Connection
Add Parameters, set direction and specify value.
Call my connection.Exec uteNonQuery()
Close the Connection.

Now, I keep getting this error on the Execute reader. I am in no point
calling a Reader for the table. I just specify my stored procedure (that
only have INSERT statements) and I just want to insert the values, not
retrieve anything.
This is the error I get "Additional information: ExecuteReader:

Connection property has not been initialized."
Do you know what might be causing this? I am using a SQLConnection and
SQLCommand. That's all.

Teo


Nov 19 '05 #3
Where is the cm object being instantiated? That is what's important.

"Teo" <no********@hom sany.net> wrote in message
news:e2******** ******@tk2msftn gp13.phx.gbl...
Hey Marina, sure, here's my VB code below, I am trying to just do a
ExecuteNonQuery , so all the values I assign before that go into the DB with the stored procedure.
Here is the code.
Thanks so much,
Teo

Private Sub btnagregar_Clic k(ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles btnagregar.Clic k

Dim cedula, nombre, apellido, direccion, ciudad, estado, zip, apostal As
String

Dim estudiante, privada, comercial, instrumentos, multimotor, instructor,
atp As Boolean

Dim fechanacimiento As Date

Dim param As SqlParameter





'Asignar valores

cedula = txtid.Text

apellido = txtapellido.Tex t

nombre = txtnombre.Text

direccion = txtdireccion.Te xt

ciudad = txtciudad.Text

estado = txtestado.Text

zip = txtzip.Text

apostal = txtapostal.Text

fechanacimiento = CDate(dtpfechan acimiento.Value )

estudiante = chkestudiante.C heckState

privada = chkprivada.Chec kState

comercial = chkcomercial.Ch eckState

instrumentos = chkinstrumentos .CheckState

multimotor = chkmulti.CheckS tate

instructor = chkinstructor.C heckState

atp = chkatp.CheckSta te

cn.Open()

param = cm.Parameters.A dd("@id", SqlDbType.Char, 15)

param.Value = cedula

param.Direction = ParameterDirect ion.Input

param = cm.Parameters.A dd("@apellido" , SqlDbType.VarCh ar, 50)

param.Value = apellido

param.Direction = ParameterDirect ion.Input

param = cm.Parameters.A dd("@nombre", SqlDbType.VarCh ar, 50)

param.Value = nombre

param.Direction = ParameterDirect ion.Input

param = cm.Parameters.A dd("@direccion" , SqlDbType.VarCh ar, 200)

param.Value = direccion

param.Direction = ParameterDirect ion.Input

param = cm.Parameters.A dd("@ciudad", SqlDbType.VarCh ar, 50)

param.Value = ciudad

param.Direction = ParameterDirect ion.Input

param = cm.Parameters.A dd("@estado", SqlDbType.VarCh ar, 50)

param.Value = estado

param.Direction = ParameterDirect ion.Input

param = cm.Parameters.A dd("@zip", SqlDbType.VarCh ar, 10)

param.Value = zip

param.Direction = ParameterDirect ion.Input

param = cm.Parameters.A dd("@apostal", SqlDbType.VarCh ar, 200)

param.Value = apostal

param.Direction = ParameterDirect ion.Input

param = cm.Parameters.A dd("@fechanacim iento", SqlDbType.DateT ime, 8)

param.Value = fechanacimiento

param.Direction = ParameterDirect ion.Input

param = cm.Parameters.A dd("@estudiante ", SqlDbType.Char, 10)

param.Value = estudiante

param.Direction = ParameterDirect ion.Input

param = cm.Parameters.A dd("@privada", SqlDbType.Char, 10)

param.Value = privada

param.Direction = ParameterDirect ion.Input

param = cm.Parameters.A dd("@comercial" , SqlDbType.Char, 10)

param.Value = comercial

param.Direction = ParameterDirect ion.Input

param = cm.Parameters.A dd("@instrument os", SqlDbType.Char, 10)

param.Value = instrumentos

param.Direction = ParameterDirect ion.Input

param = cm.Parameters.A dd("@multi", SqlDbType.Char, 10)

param.Value = multimotor

param.Direction = ParameterDirect ion.Input

param = cm.Parameters.A dd("@instructor ", SqlDbType.Char, 10)

param.Value = instructor

param.Direction = ParameterDirect ion.Input

param = cm.Parameters.A dd("@atp", SqlDbType.Char, 10)

param.Value = atp

param.Direction = ParameterDirect ion.Input

cm.ExecuteNonQu ery()



MsgBox("Su entrada ha sido procesada...")

cn.Close()

End Sub

"Marina" <zl*******@nosp am.hotmail.com> wrote in message
news:%2******** ********@tk2msf tngp13.phx.gbl. ..
I believe all those methods use the ExecuteReader method in the

background,
so that is why the top level in the stack has that.

If you post some specific code, we can be more helpful. It sounds like

your
are not setting the Connectio property of your command.

"Teo" <no********@hom sany.net> wrote in message
news:u$******** ******@TK2MSFTN GP12.phx.gbl...
Hi! Sorry for my many postings on this Newsgroup. I am new to ADO.NET and
I
got Sceppa's book on ADO.NET. It's a great book but covers a lot on the DataAdapter and Offline Data. Now, if I want to Insert Data into my MSDE Database, can I do it without using the DataAdapter?
Here are the steps I use to insert the data.
Open Connection
Add Parameters, set direction and specify value.
Call my connection.Exec uteNonQuery()
Close the Connection.

Now, I keep getting this error on the Execute reader. I am in no point
calling a Reader for the table. I just specify my stored procedure (that only have INSERT statements) and I just want to insert the values, not
retrieve anything.
This is the error I get "Additional information: ExecuteReader:

Connection property has not been initialized."
Do you know what might be causing this? I am using a SQLConnection and
SQLCommand. That's all.

Teo



Nov 19 '05 #4
Teo
Hey Marina, I usually do that on the object itself, not in code. I actually
added the cm.connection = cn where I initialize the connection. But now I
get a System error.

Teo
"Marina" <zl*******@nosp am.hotmail.com> wrote in message
news:eR******** ******@TK2MSFTN GP10.phx.gbl...
Where is the cm object being instantiated? That is what's important.

"Teo" <no********@hom sany.net> wrote in message
news:e2******** ******@tk2msftn gp13.phx.gbl...
Hey Marina, sure, here's my VB code below, I am trying to just do a
ExecuteNonQuery , so all the values I assign before that go into the DB

with
the stored procedure.
Here is the code.
Thanks so much,
Teo

Private Sub btnagregar_Clic k(ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles btnagregar.Clic k

Dim cedula, nombre, apellido, direccion, ciudad, estado, zip, apostal As
String

Dim estudiante, privada, comercial, instrumentos, multimotor, instructor,
atp As Boolean

Dim fechanacimiento As Date

Dim param As SqlParameter





'Asignar valores

cedula = txtid.Text

apellido = txtapellido.Tex t

nombre = txtnombre.Text

direccion = txtdireccion.Te xt

ciudad = txtciudad.Text

estado = txtestado.Text

zip = txtzip.Text

apostal = txtapostal.Text

fechanacimiento = CDate(dtpfechan acimiento.Value )

estudiante = chkestudiante.C heckState

privada = chkprivada.Chec kState

comercial = chkcomercial.Ch eckState

instrumentos = chkinstrumentos .CheckState

multimotor = chkmulti.CheckS tate

instructor = chkinstructor.C heckState

atp = chkatp.CheckSta te

cn.Open()

param = cm.Parameters.A dd("@id", SqlDbType.Char, 15)

param.Value = cedula

param.Direction = ParameterDirect ion.Input

param = cm.Parameters.A dd("@apellido" , SqlDbType.VarCh ar, 50)

param.Value = apellido

param.Direction = ParameterDirect ion.Input

param = cm.Parameters.A dd("@nombre", SqlDbType.VarCh ar, 50)

param.Value = nombre

param.Direction = ParameterDirect ion.Input

param = cm.Parameters.A dd("@direccion" , SqlDbType.VarCh ar, 200)

param.Value = direccion

param.Direction = ParameterDirect ion.Input

param = cm.Parameters.A dd("@ciudad", SqlDbType.VarCh ar, 50)

param.Value = ciudad

param.Direction = ParameterDirect ion.Input

param = cm.Parameters.A dd("@estado", SqlDbType.VarCh ar, 50)

param.Value = estado

param.Direction = ParameterDirect ion.Input

param = cm.Parameters.A dd("@zip", SqlDbType.VarCh ar, 10)

param.Value = zip

param.Direction = ParameterDirect ion.Input

param = cm.Parameters.A dd("@apostal", SqlDbType.VarCh ar, 200)

param.Value = apostal

param.Direction = ParameterDirect ion.Input

param = cm.Parameters.A dd("@fechanacim iento", SqlDbType.DateT ime, 8)

param.Value = fechanacimiento

param.Direction = ParameterDirect ion.Input

param = cm.Parameters.A dd("@estudiante ", SqlDbType.Char, 10)

param.Value = estudiante

param.Direction = ParameterDirect ion.Input

param = cm.Parameters.A dd("@privada", SqlDbType.Char, 10)

param.Value = privada

param.Direction = ParameterDirect ion.Input

param = cm.Parameters.A dd("@comercial" , SqlDbType.Char, 10)

param.Value = comercial

param.Direction = ParameterDirect ion.Input

param = cm.Parameters.A dd("@instrument os", SqlDbType.Char, 10)

param.Value = instrumentos

param.Direction = ParameterDirect ion.Input

param = cm.Parameters.A dd("@multi", SqlDbType.Char, 10)

param.Value = multimotor

param.Direction = ParameterDirect ion.Input

param = cm.Parameters.A dd("@instructor ", SqlDbType.Char, 10)

param.Value = instructor

param.Direction = ParameterDirect ion.Input

param = cm.Parameters.A dd("@atp", SqlDbType.Char, 10)

param.Value = atp

param.Direction = ParameterDirect ion.Input

cm.ExecuteNonQu ery()



MsgBox("Su entrada ha sido procesada...")

cn.Close()

End Sub

"Marina" <zl*******@nosp am.hotmail.com> wrote in message
news:%2******** ********@tk2msf tngp13.phx.gbl. ..
I believe all those methods use the ExecuteReader method in the

background,
so that is why the top level in the stack has that.

If you post some specific code, we can be more helpful. It sounds like

your
are not setting the Connectio property of your command.

"Teo" <no********@hom sany.net> wrote in message
news:u$******** ******@TK2MSFTN GP12.phx.gbl...
> Hi! Sorry for my many postings on this Newsgroup. I am new to ADO.NET
and
I
> got Sceppa's book on ADO.NET. It's a great book but covers a lot on

the > DataAdapter and Offline Data. Now, if I want to Insert Data into my MSDE > Database, can I do it without using the DataAdapter?
> Here are the steps I use to insert the data.
> Open Connection
> Add Parameters, set direction and specify value.
> Call my connection.Exec uteNonQuery()
> Close the Connection.
>
> Now, I keep getting this error on the Execute reader. I am in no
point > calling a Reader for the table. I just specify my stored procedure

(that > only have INSERT statements) and I just want to insert the values, not > retrieve anything.
> This is the error I get "Additional information: ExecuteReader:

Connection
> property has not been initialized."
> Do you know what might be causing this? I am using a SQLConnection and > SQLCommand. That's all.
>
> Teo
>
>



Nov 19 '05 #5
Teo
Nevermind, it's working now!!! It's a good feeling when you get something to
work!!! I'll throw a party now ;-)
Thanks so much Marina!

Teo
"Marina" <zl*******@nosp am.hotmail.com> wrote in message
news:Oc******** ******@tk2msftn gp13.phx.gbl...
What is a 'System' error? That really doesn't tell us much.

"Teo" <no********@hom sany.net> wrote in message
news:en******** ******@TK2MSFTN GP11.phx.gbl...
Hey Marina, I usually do that on the object itself, not in code. I actually
added the cm.connection = cn where I initialize the connection. But now I
get a System error.

Teo
"Marina" <zl*******@nosp am.hotmail.com> wrote in message
news:eR******** ******@TK2MSFTN GP10.phx.gbl...
Where is the cm object being instantiated? That is what's important.

"Teo" <no********@hom sany.net> wrote in message
news:e2******** ******@tk2msftn gp13.phx.gbl...
> Hey Marina, sure, here's my VB code below, I am trying to just do a
> ExecuteNonQuery , so all the values I assign before that go into the DB with
> the stored procedure.
> Here is the code.
> Thanks so much,
> Teo
>
> Private Sub btnagregar_Clic k(ByVal sender As System.Object, ByVal e As > System.EventArg s) Handles btnagregar.Clic k
>
> Dim cedula, nombre, apellido, direccion, ciudad, estado, zip, apostal As > String
>
> Dim estudiante, privada, comercial, instrumentos, multimotor,

instructor,
> atp As Boolean
>
> Dim fechanacimiento As Date
>
> Dim param As SqlParameter
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> 'Asignar valores
>
> cedula = txtid.Text
>
> apellido = txtapellido.Tex t
>
> nombre = txtnombre.Text
>
> direccion = txtdireccion.Te xt
>
> ciudad = txtciudad.Text
>
> estado = txtestado.Text
>
> zip = txtzip.Text
>
> apostal = txtapostal.Text
>
> fechanacimiento = CDate(dtpfechan acimiento.Value )
>
> estudiante = chkestudiante.C heckState
>
> privada = chkprivada.Chec kState
>
> comercial = chkcomercial.Ch eckState
>
> instrumentos = chkinstrumentos .CheckState
>
> multimotor = chkmulti.CheckS tate
>
> instructor = chkinstructor.C heckState
>
> atp = chkatp.CheckSta te
>
>
>
> cn.Open()
>
>
>
> param = cm.Parameters.A dd("@id", SqlDbType.Char, 15)
>
> param.Value = cedula
>
> param.Direction = ParameterDirect ion.Input
>
>
>
> param = cm.Parameters.A dd("@apellido" , SqlDbType.VarCh ar, 50)
>
> param.Value = apellido
>
> param.Direction = ParameterDirect ion.Input
>
> param = cm.Parameters.A dd("@nombre", SqlDbType.VarCh ar, 50)
>
> param.Value = nombre
>
> param.Direction = ParameterDirect ion.Input
>
> param = cm.Parameters.A dd("@direccion" , SqlDbType.VarCh ar, 200)
>
> param.Value = direccion
>
> param.Direction = ParameterDirect ion.Input
>
> param = cm.Parameters.A dd("@ciudad", SqlDbType.VarCh ar, 50)
>
> param.Value = ciudad
>
> param.Direction = ParameterDirect ion.Input
>
> param = cm.Parameters.A dd("@estado", SqlDbType.VarCh ar, 50)
>
> param.Value = estado
>
> param.Direction = ParameterDirect ion.Input
>
> param = cm.Parameters.A dd("@zip", SqlDbType.VarCh ar, 10)
>
> param.Value = zip
>
> param.Direction = ParameterDirect ion.Input
>
> param = cm.Parameters.A dd("@apostal", SqlDbType.VarCh ar, 200)
>
> param.Value = apostal
>
> param.Direction = ParameterDirect ion.Input
>
> param = cm.Parameters.A dd("@fechanacim iento", SqlDbType.DateT ime, 8)
>
> param.Value = fechanacimiento
>
> param.Direction = ParameterDirect ion.Input
>
> param = cm.Parameters.A dd("@estudiante ", SqlDbType.Char, 10)
>
> param.Value = estudiante
>
> param.Direction = ParameterDirect ion.Input
>
> param = cm.Parameters.A dd("@privada", SqlDbType.Char, 10)
>
> param.Value = privada
>
> param.Direction = ParameterDirect ion.Input
>
> param = cm.Parameters.A dd("@comercial" , SqlDbType.Char, 10)
>
> param.Value = comercial
>
> param.Direction = ParameterDirect ion.Input
>
> param = cm.Parameters.A dd("@instrument os", SqlDbType.Char, 10)
>
> param.Value = instrumentos
>
> param.Direction = ParameterDirect ion.Input
>
> param = cm.Parameters.A dd("@multi", SqlDbType.Char, 10)
>
> param.Value = multimotor
>
> param.Direction = ParameterDirect ion.Input
>
> param = cm.Parameters.A dd("@instructor ", SqlDbType.Char, 10)
>
> param.Value = instructor
>
> param.Direction = ParameterDirect ion.Input
>
> param = cm.Parameters.A dd("@atp", SqlDbType.Char, 10)
>
> param.Value = atp
>
> param.Direction = ParameterDirect ion.Input
>
>
>
>
>
> cm.ExecuteNonQu ery()
>
>
>
>
>
>
>
>
>
>
>
> MsgBox("Su entrada ha sido procesada...")
>
>
>
> cn.Close()
>
> End Sub
>
> "Marina" <zl*******@nosp am.hotmail.com> wrote in message
> news:%2******** ********@tk2msf tngp13.phx.gbl. ..
> > I believe all those methods use the ExecuteReader method in the
> background,
> > so that is why the top level in the stack has that.
> >
> > If you post some specific code, we can be more helpful. It sounds like > your
> > are not setting the Connectio property of your command.
> >
> > "Teo" <no********@hom sany.net> wrote in message
> > news:u$******** ******@TK2MSFTN GP12.phx.gbl...
> > > Hi! Sorry for my many postings on this Newsgroup. I am new to

ADO.NET
> and
> > I
> > > got Sceppa's book on ADO.NET. It's a great book but covers a lot on the
> > > DataAdapter and Offline Data. Now, if I want to Insert Data into my MSDE
> > > Database, can I do it without using the DataAdapter?
> > > Here are the steps I use to insert the data.
> > > Open Connection
> > > Add Parameters, set direction and specify value.
> > > Call my connection.Exec uteNonQuery()
> > > Close the Connection.
> > >
> > > Now, I keep getting this error on the Execute reader. I am in no

point
> > > calling a Reader for the table. I just specify my stored
procedure (that
> > > only have INSERT statements) and I just want to insert the

values, not
> > > retrieve anything.
> > > This is the error I get "Additional information: ExecuteReader:
> Connection
> > > property has not been initialized."
> > > Do you know what might be causing this? I am using a
SQLConnection and
> > > SQLCommand. That's all.
> > >
> > > Teo
> > >
> > >
> >
> >
>
>



Nov 19 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
1615
by: Oasis | last post by:
Hello, I'm new to c#. I have situation where I want to execute a number of insert statements that differ only in a few dynamic values. When I was a Java programmer, I would do this with a PreparedStatement, which will supposedly improve performance as well as make the setting of the dynamic values much more convenient than building a long...
1
1876
by: Craig Stadler | last post by:
Using mysql 4.0.23- What is the best way to execute several (hundreds of) inserts and updates? Rather than issuing tons of individual inserts and updates, can I send the strings to a text file and then have mysql do them all?? IE : query.txt insert into table1 (col1,col2) values (1,2);
7
4221
by: Steven D.Arnold | last post by:
How good is Postgres' performance for massive simultaneous insertions into the same heavily-indexed table? Are there any studies or benchmarks I can look at for that? I understand Postgres uses MVCC rather than conventional locking, which makes it easier to do parallel inserts. In my environment, I will have so many inserts that it is...
3
1958
by: deathyam | last post by:
Hi, I have an Excel 97 app in which I'm using SQL INSERTs to insert data into an Access 97 database table. The table structure is as follows: VersionID (PK) (Long) MetricID (PK) (Long) MetricNumber (Double) MetricText (Memo)
0
1111
by: Steve - DND | last post by:
Is there a way to perform multiple inserts and updates to SQL Server with stored procedures and the Command object's named parameters all at once? The only way to do this that I'm gathering so far is to either run each insert/update individually, or to write out each SP execution string with it's parameters separated by semi-colons, and run it...
1
2105
by: Brian Maguire | last post by:
Background Info: I have a table with a approx 2.5 million rows. The table often gets 200-300 inserts per second. We are see that the database (7.4.1 Red Hat Enterprise ED 4 way Xeon) will periodically lock up all of a sudden and force the database to queue up hundreds of queries. The database comes to complete halt until eventually it...
3
2258
by: zelnaga | last post by:
according to the mysql manual, multiple inserts can be sped up by locking the table before doing them and unlocking the table afterwards. is the same true of multiple inserts in mysql? if so, how would the table be locked? any insights would be appreciated - thanks!
0
1061
by: poe | last post by:
Hello, I have a large database table running on SQL Server 8.0. It currently has nearly 98 million records on it's ways to 125 million. I am doing inserts as quickly as the server can handle it, but after a while the server simply refuses to process the insert statements. According to SQL Management Studio, the insert statements are being...
2
2222
by: sangam56 | last post by:
Greetings. I suppose people out there can help in my problem. I am using sql server of microsoft visual studio 2005 itself. I have created a stored procedure which is give below. It works fine but it always inserts two records into the database. All columns of the two rows are same but the primary key is different which is no surprise. Please...
9
3205
by: lenygold via DBMonster.com | last post by:
I have the following trigger: --#SET TERMINATOR ! CREATE TRIGGER CROSS_REFF_TRIG AFTER INSERT ON NEW_CATALOG REFERENCING NEW AS nnn FOR EACH ROW MODE DB2SQL BEGIN ATOMIC DECLARE reason VARCHAR(70); DECLARE OUT_SQLCODE1 INTEGER;
0
8032
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7796
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...
0
8074
tracyyun
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...
0
6424
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5601
isladogs
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...
0
3734
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3739
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1310
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1044
bsmnconsultancy
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...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.