473,320 Members | 1,922 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

problem about SqlDataDapator.insertcommand

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
Nov 20 '05 #1
5 1015
* "Agnes" <ag***@dynamictech.com.hk> scripsit:
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:news://news.microsoft.com/microsoft.public.dotnet.framework.adonet>

Web interface:

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

:-)

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #2
Hi Agnes,

I did not want to answer you because this is so in between.
You said you are new, have a look at the commandbuilder with the
dataadapter.

http://msdn.microsoft.com/library/de...classtopic.asp

Then you do not need to write that insert command for your dataadapter.

http://msdn.microsoft.com/library/de...querytopic.asp

When you use OleDb change SQL for OleDb

I hope this helps a little bit, however this is yet the start?

Cor
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

Nov 20 '05 #3
"Agnes" <ag***@dynamictech.com.hk> schrieb
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...withadonet.asp

http://msdn.microsoft.com/library/en...tingDataVB.asp
--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #4
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.

"Cor Ligthert" <no**********@planet.nl> ¦b¶l¥ó
news:O3*************@tk2msftngp13.phx.gbl ¤¤¼¶¼g...
Hi Agnes,

I did not want to answer you because this is so in between.
You said you are new, have a look at the commandbuilder with the
dataadapter.

http://msdn.microsoft.com/library/de...classtopic.asp
Then you do not need to write that insert command for your dataadapter.

http://msdn.microsoft.com/library/de...querytopic.asp
When you use OleDb change SQL for OleDb

I hope this helps a little bit, however this is yet the start?

Cor
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


Nov 20 '05 #5
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
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.

Nov 20 '05 #6

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

Similar topics

2
by: http://www.visual-basic-data-mining.net/forum | last post by:
All, I am attempting to insert a new row into an MS Access database using VB.NET. This is an existing access database that I did not create, so I do not know all of the field properties. I have...
2
by: Krishna | last post by:
Hi, I have developed a for dataentry by using datagird in C# windows application, I am using combocolumns, textbox columns for the same, two readonly textboxcolumns for those readonly columns i...
3
by: Rich | last post by:
What is the diffeence bewtween a dataAdapter.InsertCommand and dataAdapter.SelectCommand (and dataAdapter.UpdateCommand for that matter)? Dim da As SqlDataAdapter conn.Open da.SelectCommand =...
1
by: explode | last post by:
I made a oledbdataadapter with this code Public Sub Novo(ByVal nova1 As String, ByVal nova2 As String) Dim i As Integer Dim nova As OleDb.OleDbDataAdapter = New OleDb.OleDbDataAdapter Dim veza...
15
by: yzlin04 | last post by:
Hello, I'm new in vb.net. I have a problem in inserting a new row to a MS Access database table. There is no error message comes out when i run my program, but when i check my MS Access table,...
1
by: chonthy | last post by:
Hello! I'm in trouble with the ASP.NET and OLEDB.JET connector. When I put the data into an XLS file from a dataset of my webpage, everything's OK, but in the destination file there is an...
2
Elnath
by: Elnath | last post by:
im connecting to a DataBase tru ODBC, i need to insert new records (rows) therefore i want the InsertCommand to be generated by my CommbadBuilder. This solution however is aint working, the...
1
by: adsdldsfasd | last post by:
Hi guys. I have an Access DB that has a Course table with a primery key CourseSignature which has a validation rule Like "###". For example CSCB343. When I try to enter a value in the DB...
2
by: BobLewiston | last post by:
I can read in an SQL table ("Person.Contact") from AdventureWorks and step through it one row at a time, but when I try to save a record, either one I'm inserting or one I'm editting, I get the...
3
by: aartinair | last post by:
hii everybdy.Act now i have removed the data source and added this code,still the data is noty getting inserted Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.