Solved

vb.net command builder

Posted on 2006-07-07
3
1,885 Views
Last Modified: 2008-09-12
I know that vb.net command builder is created automatically through dataAdapter, I would like to know in which circumstance I should create a command builder through the code.

an example might help.

thanks

0
Comment
Question by:jskfan
  • 2
3 Comments
 
LVL 7

Accepted Solution

by:
dttri earned 200 total points
ID: 17060074
Greetings!
This article contains an example on how to use SQLCommandBuilder class:
http://www.developer.com/lang/other/article.php/963511
0
 
LVL 5

Assisted Solution

by:Davidshc76
Davidshc76 earned 50 total points
ID: 17063296
OleDbCommandBuilder can be use to generate the command for insert, update, delete ....
But your table must have primary key generated. Below are the sample code ........

DaUserList = New OleDbDataAdapter()
DaUserList.SelectCommand = New OleDbCommand(SelectString, g_objconn)

Dim CB As OleDbCommandBuilder
CB = New OleDbCommandBuilder(DaUserList)
DaUserList.InsertCommand = CB.GetInsertCommand()
DaUserList.UpdateCommand = CB.GetUpdateCommand()
DaUserList.DeleteCommand = CB.GetDeleteCommand()

DsUserList = New DataSet()
DaUserList.Fill(DsUserList, "USERMASTER")
0
 
LVL 7

Expert Comment

by:dttri
ID: 17063405
There are many different CommandBuilder versions for different database system, eg OleDBCommandBuilder, SQLCommandBuilder, OracleCommandBuilder... but the general syntax is the same.
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

919 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now