473,320 Members | 1,961 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Update table SQL Express & VS 2005

OK, I hate myself for asking this, it's the worst question I have ever asked
but it's worse not to ask:

¿How do I update a datatable in vs 2005? I mean, I am using a typed dataset,
a datagridview control and SQL express. I tried this code on a separate
button to commit changes to the database:

Private Sub cmdOK_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles cmdOK.Click
If Not Me.DataSet.DataTable.GetChanges Is Nothing Then
Me.DataTableTableAdapter.Update(Me.DataSet.DataTab le.GetChanges)
End If
End Sub

It seems to work fine, no exception is thrown, the update method returns 1,
the datagridview shows just the right modified data, and if I clear the
dataset and fill it again with the tableadapter it keeps the same data. But
it's not working, when I open this SQL Express datatable from the visual
studio server explorer it has the original unedited data and I can't change
that.

I have event tried to run a simple sqlcommand with an insert query, but I
get the same results. Am I doing anything wrong? Maybe I must configure
something on SQL Express or in VS? Call some method of the dataset, the
tableadapter, the bindingsource or the datagridview before changes can be
sent to the database?

Just to add some more info, I tried to update, insert and delete data from
the Server Explorer and it works fine.
Jan 3 '06 #1
1 3104
Hi,

"Joaquin" <Jo*****@discussions.microsoft.com> wrote in message
news:B6**********************************@microsof t.com...
OK, I hate myself for asking this, it's the worst question I have ever
asked
but it's worse not to ask:

¿How do I update a datatable in vs 2005? I mean, I am using a typed
dataset,
a datagridview control and SQL express. I tried this code on a separate
button to commit changes to the database:

Private Sub cmdOK_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles cmdOK.Click
If Not Me.DataSet.DataTable.GetChanges Is Nothing Then
Me.DataTableTableAdapter.Update(Me.DataSet.DataTab le.GetChanges)
End If
End Sub

It seems to work fine, no exception is thrown, the update method returns
1,
the datagridview shows just the right modified data, and if I clear the
dataset and fill it again with the tableadapter it keeps the same data.
But
it's not working, when I open this SQL Express datatable from the visual
studio server explorer it has the original unedited data and I can't
change
that.
Maybe this can help you:
http://tinyurl.com/c3lvw

Greetings


I have event tried to run a simple sqlcommand with an insert query, but I
get the same results. Am I doing anything wrong? Maybe I must configure
something on SQL Express or in VS? Call some method of the dataset, the
tableadapter, the bindingsource or the datagridview before changes can be
sent to the database?

Just to add some more info, I tried to update, insert and delete data from
the Server Explorer and it works fine.

Jan 3 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: amber | last post by:
Hello, I've just upgraded to VS.NET 2005 and SQL Server Express 2005. I converted my 2003 project into 2005. Now, when I try to run it, I get the error message: A first chance exception of...
3
by: rola | last post by:
Hi Group! I am having a problem of using SUM under UPDATE statement. I understand that SQL does not allow me to use SUM in UPDATE, but unfortunately, I can not find a way to get around it. Can...
3
by: Morten Dahl | last post by:
My database won't update?? I'm using VB.NET 2005 and SQL Server 2005 Express. I Create a Form and a database. Using the wizard draging the DatabaseDataSet Table on the form. Everything works...
3
by: mosscliffe | last post by:
I created a new table in Visual Web Developer for SQL Server Express 2005. I created a 'gridview' by dragging the table onto an empty web form in Visual Developer Express. Clicked on the smart...
3
by: Steve | last post by:
Hi All I downloaded Sql server 2005 express SP2 and attempted to modify the Bootstrapper package files as I did with SP1 When i try to install SQL server as part of my VS 2005 deployment app I...
0
by: shef | last post by:
Hi, I'm trying to build a database application in Visual Studio 2005 express Edition. Using Visual Basic, and a sample Access database, I created a new Windows Application, added a database,...
16
by: ARC | last post by:
Hello all, So I'm knee deep in this import utility program, and am coming up with all sorts of "gotcha's!". 1st off. On a "Find Duplicates Query", does anyone have a good solution for...
5
by: TheSteph | last post by:
Using : MS-SQL 2005 / .NET 2.0 / VS2005 I have two server with the same database def but different data. I would like to import data from Server2.TableA to Server1.TableA. If a row doesn't...
5
by: Chris Kennedy | last post by:
Hi all I'm running SQL Server 2005 Express Edition. One database One table called Sites Fields as follows: id (bigint, Identity, Primary Key) SiteName (varchar(50), allows nulls) Generation...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

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.