Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

the type sqlcommandbuilder is not deffined

Posted on 2007-11-21
2
Medium Priority
?
511 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:Ernesto
[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 1000 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 64

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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
I have a large data set and a SSIS package. How can I load this file in multi threading?
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.

704 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