?
Solved

vb.net command builder

Posted on 2006-07-07
3
Medium Priority
?
1,932 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 800 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 200 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…
Progress

749 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