473,657 Members | 2,351 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

data adapter update error

5 New Member
hi,

I tried to update record using data table and dataadapter

but I get error for line (in edit case)
daadapter1.upda te(dtTable1)

the error is
"Dynamic SQL generation for the UpdateCommand is not supported against a SelectCommand that does not return any key column information."

can any one help me out from this.


Regards

Mustak
Mar 26 '07 #1
3 964
kenobewan
4,871 Recognized Expert Specialist
Have you tried using fill instead? Please provide more info. Thanks.
Mar 27 '07 #2
channaJ
67 New Member
Have you tried using fill instead? Please provide more info. Thanks.
Fill() and Update() methods of the DataAdapter are used for different purposses. You use Fill() method to get a DataSet or a DataTable filled, where as Update() method is used to Update() the database.
Mar 27 '07 #3
channaJ
67 New Member
hi,

I tried to update record using data table and dataadapter

but I get error for line (in edit case)
daadapter1.upda te(dtTable1)

the error is
"Dynamic SQL generation for the UpdateCommand is not supported against a SelectCommand that does not return any key column information."

can any one help me out from this.


Regards

Mustak
Hi,

I think the problem here is you have not set the Update command of the data adapter properly. Check the UpdateCommand of your DataAdapter and the CommandText of your UpdateCommand.
Mar 27 '07 #4

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

Similar topics

1
1706
by: Terry Knight | last post by:
hey, i've created a data adpater called 'dabvscores' i've created a dataset called 'dsvbscores' now i've greated a private sub to populate the data adpater and then i fill the dataset and this private is called on form load, i have an update command button with the following code in it: daVBScores.Update(dsVBScores)
2
1184
by: Parveen | last post by:
I have a data grid that's bound to a table in my dataset. After inserting a new row into the grid and populating it with data, I go to save my changes. My data adapter update command returns an error telling me that the last field that I populated has a value of NULL. If I wait a few seconds and try to save my changes again, then everything works fine. Somehow, now the adapter sees the populated data in this field. Does anyone know why...
4
2486
by: Agnes | last post by:
I am confused about these two things 1st)As form load I new a data adapter programmicaly , and I can use stored procedure to 'select sth ' and then fill into the dataset.by using binding context, my form can display the correct data. 2nd) I want to new a record, so. dsinvocie.addnew(), I can type the new data. 3rd) I want to use the store procedure to insert this new record. my store procedure runs very well However, as i rund...
4
1828
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)
1
8068
by: languy | last post by:
Hi there I'm having a problem when using the SqlDataAdapter. When calling the Update(DataSet, string) method I get the following error message "String or binary data would be truncated". The rows neither have data that exceeds 8000 chars nor contain any LOB fields. Furthermore the data is transferred between two tables that are bitwise identical. -- snip -- System.Data.SqlClient.SqlCommand command =
6
3794
by: Suresh | last post by:
Hi All, I am fetching a dataset from the database under some condition. After this I create a data table. Traverse in the original dataset & add each row to created data table as it is through LoadDataRow method. After adding the row I just update 4-5 columns out of 20 columns in the row. After entire looping I fire the AcceptChanges method on data table. After this I am trying to update this data back to database in two ways - 1) Merge...
0
3969
by: mwenz | last post by:
I am trying to update an Access table using OLEDB in VB.Net 2005. I can add rows but I cannot update them. Code to instantiate the Access database and table... Dim conn As New OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & db.Name) conn.Open() Dim oda As New OleDb.OleDbDataAdapter("select " & sqlCols & " from ;", conn) Dim cb As New OleDb.OleDbCommandBuilder(oda) cb.QuotePrefix = "" oda.UpdateCommand =...
9
2729
by: SAL | last post by:
Hello, I have a Dataset that I have table adapters in I designed using the designer (DataLayer). I have a business logic layer that immulates the DataLayer which may/may not have additional logic in. My business classes are, of course, decorated with the: <System.ComponentModel.DataObject() attribute. So, I drop a GridView on a webform and set its datasource to an ObjectDatasource which in turn is using one of my business logic...
7
1515
by: Kevin | last post by:
I'm new to ADO.NET--trying to make the switch from ADO, which I've been using in my VB2005 apps up until now. Here's what I have: Sub Save_Record() Dim OldRecord as DataTable Dim NewRecord as DataTable Using testConnection As SqlConnection = New SqlConnection(SQLConnectionString) Dim testCommand As SqlCommand = testConnection.CreateCommand() testCommand.CommandText = "SELECT * FROM MasterRoster WHERE MR_StudentNumber = '" &...
6
2938
by: insirawali | last post by:
Hi all, I have this problem, i need to know is there a way i cn use the data adapter's update method in this scenario. i have 3 tables as below create table table1{ id1 int identity(1,1) Constraint pk_table1 Primary Key,
0
8399
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
8827
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...
1
8504
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
8606
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7337
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
5632
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4159
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
4318
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2732
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

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.