Solved

vb.net command builder

Posted on 2006-07-07
3
1,894 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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article will show, step by step, how to integrate R code into a R Sweave document
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
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…

856 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