Solved

the type sqlcommandbuilder is not deffined

Posted on 2007-11-21
2
509 Views
Last Modified: 2012-06-27
hi you guys
Im brand new at visual 2003
how i need to define sqlcommandbuilder in this code?
**********************
 Dim myBuilder As SqlCommandBuilder = New SqlCommandBuilder(OleDbDataAdapter1)

        myBuilder.GetUpdateCommand()

        OleDbDataAdapter1.UpdateCommand = myBuilder.GetUpdateCommand()

        OleDbDataAdapter1.Update(objjsm, "jsmfiles")
****************************************************
0
Comment
Question by:edo60
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 51

Accepted Solution

by:
Ted Bouskill earned 500 total points
ID: 20330667
Are you including the namespace System.Data.SqlClient?

Also, you will get MUCH better performance if you use the SqlDataAdapter instead of the OleDbDataAdapter which is generic and slow.
0
 
LVL 63

Expert Comment

by:Fernando Soto
ID: 20330766
Hi edo60;

You do not waht to mix OleDb objects with SQL object. The following sample code doest what you need with a Contacts Database so that you have something to work with.

        Dim conn As New OleDbConnection("Server=localhost; Provider=SQLOLEDB; Initial Catalog=Contacts;" _
            & "Integrated Security=SSPI")
        Dim da As New OleDbDataAdapter
        da.SelectCommand = New OleDbCommand("SELECT * FROM Contacts", conn)
        Dim myBuilder As OleDbCommandBuilder = New OleDbCommandBuilder(da)
        Dim ds As New DataSet
        da.Fill(ds, "Contacts")

        ' Add, Update Datatable here and then do your Update.
        da.Update(ds, "Contacts")

Fernando
0

Featured Post

Percona Live Europe 2017 | Sep 25 - 27, 2017

The Percona Live Open Source Database Conference Europe 2017 is the premier event for the diverse and active European open source database community, as well as businesses that develop and use open source database software.

Question has a verified solution.

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

For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
A Stored Procedure in Microsoft SQL Server is a powerful feature that it can be used to execute the Data Manipulation Language (DML) or Data Definition Language (DDL). Depending on business requirements, a single Stored Procedure can return differe…
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

630 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