problem about SqlDataDapator.insertcommand

  • Thread starter Thread starter Agnes
  • Start date Start date
A

Agnes

I want to insert a record into a tables by using dataadaptor
With cmdSeaExBL
.Connection = conSea.GetDbConnection("SEA")
.CommandText = "INSERT
dbo.billladingheader(number,jobno) values(@number,@jobno)"

With .Parameters
.Add("@number", SqlDbType.VarChar, 20,
Trim(Me.txtHBLNo.Text))
'.Add("@jobno", SqlDbType.VarChar, 20,
Trim(Me.txtJobNo.Text))
endwith
endwith

Now, I don't know what steps I should go on.
Can anyone teach me or give me a little bit ?
thanks
 
* "Agnes said:
I want to insert a record into a tables by using dataadaptor
With cmdSeaExBL
.Connection = conSea.GetDbConnection("SEA")
.CommandText = "INSERT
dbo.billladingheader(number,jobno) values(@number,@jobno)"

With .Parameters
.Add("@number", SqlDbType.VarChar, 20,
Trim(Me.txtHBLNo.Text))
'.Add("@jobno", SqlDbType.VarChar, 20,
Trim(Me.txtJobNo.Text))
endwith
endwith

Now, I don't know what steps I should go on.
Can anyone teach me or give me a little bit ?

Just FYI:

<URL:
Web interface:

<URL:http://msdn.microsoft.com/newsgroups/?dg=microsoft.public.dotnet.framework.adonet>

:-)
 
Agnes said:
I want to insert a record into a tables by using dataadaptor
With cmdSeaExBL
.Connection =
conSea.GetDbConnection("SEA") .CommandText = "INSERT
dbo.billladingheader(number,jobno) values(@number,@jobno)"

With .Parameters
.Add("@number", SqlDbType.VarChar,
20,
Trim(Me.txtHBLNo.Text))
'.Add("@jobno", SqlDbType.VarChar,
20,
Trim(Me.txtJobNo.Text))
endwith
endwith

Now, I don't know what steps I should go on.
Can anyone teach me or give me a little bit ?
thanks

http://msdn.microsoft.com/library/en-us/cpguide/html/cpconaccessingdatawithadonet.asp

http://msdn.microsoft.com/library/en-us/vbcon/html/vboriIntegratingDataVB.asp


--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html
 
thanks Cor ,
I read several textbox about ado.net , I found there are different ways to
insert the record.
e.g data row, data adaptor, or store procedure. I am loss about it.
some said, store procedure is faster and secure. However, the new way of
ado.net is data adatpor.
 
Hi Agnes,

About your sentenses.
Dataadapter/dataset is the new way where it replaces the recordset.

For batch inserting of rows is the command.executenonquerry still the one,
that last instruction is used by the dataadapter too.

The stored procedure is faster and more secure the one who wrote that to
your message in the ADONET group was me. However you can better first make
it without that, making a stored procedure from a normale procedure is not a
big deal and without it is easier testing.

I hope this helps?

Cor
 
Back
Top