473,612 Members | 2,331 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

data entry form update using command builder

4 New Member
Hi,

I am trying to create a simple dataentry form that will modify a sequel database table. I am using BindingSource and BindingNavigato r to display the data from the table. Then the use would add/delete/change data which I wanna write back to the table. I am having trouble updating the rows! Please help. The commandBuilder created commands for adapter. do i have to pass parameters? how do i do that?

SQL_Command = New SqlCommand
SQL_Command.Con nection = gCn
SQL_Command.Com mandText = "SELECT Model, DocType, Document FROM tblQuality "

DataAdapter1 = New SqlDataAdapter( SQL_Command)
DataSet1.Clear( )

cmdBuilder = New SqlCommandBuild er(DataAdapter1 )
DataAdapter1 .Fill(DataSet1, "Table1")

BindingSrc1.Dat aSource = DataSet1
BindingSrc1.Dat aMember = "QualityDoc "
BindingNav1.Bin dingSource = BindingSrc1

txtModel.DataBi ndings.Add(New Binding("Text", BindingSrc1, "Q_Model"))
cmbDocumentType .DataBindings.A dd(New Binding("Text", BindingSrc1, "Q_DocType" ))
txtDocumentName .DataBindings.A dd(New Binding("Text", BindingSrc1, "Q_Document "))


Public Sub SaveChanges()

DataAdapter1.Up date(DataSet1, "Table1")
DataSet1.Accept Changes()

End Sub
Sep 26 '07 #1
0 944

Sign in to post your reply or Sign up for a free account.

Similar topics

7
3414
by: Jack | last post by:
Hi, I am trying to test a sql statement in Access which gives me the error as stated in the heading. The sql statement is built as a part of asp login verification, where the userid and password are input in login screen. The password in the database is a number field. I am writing the dynamic sql statement as follows below. I believe I am going wrong in the password section of the code. I appreciate any help. Thanks. Regards.
12
2277
by: Nhmiller | last post by:
When I start to type the data for a new record, I would like a dropdown box to open next to it from which I can choose the data from a previously entered record that starts with the same letter. This is the way my previous database, Approach, worked. I have tried using the form design toolbox wizard for this but have had no success. I perused the Help menus and found some deficient instructions on List, Combo and Dropdown. The dropdown icon...
5
8290
by: Jason Huang | last post by:
Hi, The SqlParameter myPM =new SqlParameter("@Address", txtAddress.Text) is working for update, but SqlParameter myPM =new SqlParameter ("@Address",SqlDbType.NVarChar,90,txtAddress.Text) is not working. The Address column is DataType NVarChar 90, no problem. Any idea?
10
2336
by: Trevor | last post by:
Hey, I am trying to do this tutorial on the microsoft site : http://msdn.microsoft.com/library/default.asp? url=/library/en-us/dndotnet/html/usingadonet.asp I can get everything to work up to the DataAdd part (Section heading is Adding Rows to a DataSet) I dont really know what to do after i have added all the
8
1896
by: rriness | last post by:
I'm getting an inconsistent failure when trying to save data in ADO.Net. I'm using an Access database with a simple query - SELECT StudentID, FirstName, LastName FROM Students - and have no other users in the database. I keep getting the message 'Operation must use an updateable query.' Process seems to work on some PC's, not others. Is there a difference in .Net framework versions? Or some other
17
3811
by: Benoit Martin | last post by:
I'm working on a project in VB.net connecting to a SQL Server 2000 database that I can't modify I created a dataset with a schema identical to the DB. When trying to update the DB from the dataset using the dataAdapter.update sub, I get an error. The problem seems to be that one of the fields was named 'desc' which is a reserved word for SQL. I've been able to work around this design flaw 'till now but it looks like the update sub can't...
4
1827
by: William | last post by:
After much frustration I was able to update my data store via code only. Using the data adapter was the only way I was able to set up all the objects written in my code. Basically, I cheated by creating an adapter and then copy, paste, modify it's code to suite my needs. This was the end result: Private sub updateTable( ) Dim myData As DataSet 'Command is a form level oledbcommand object Dim Adapter1 As New OleDbDataAdapter(Command)
4
2305
by: George | last post by:
Hi all, I am having trouble with updating my data in an Access database. here is my code: Imports System.Data.OleDb Dim AppPath As String = Mid(Application.ExecutablePath, 1, Len(Application.ExecutablePath) - 14)
3
1333
by: iKiLL | last post by:
Hi all The Code is below but i will give you a brief over view first. I am using C#, SQL Mobile and the CF2.0 with Merge Replication. My Primary Keys are all "uniqueidentifier" types with default value of
0
8173
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8617
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8568
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8254
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7044
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4047
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4111
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2555
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
1416
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.