PC Review


Reply
Thread Tools Rate Thread

adapter.Update question ??

 
 
=?Utf-8?B?Y2FsZGVyYXJh?=
Guest
Posts: n/a
 
      17th Oct 2007
Dear all,

I have an application sQL statement which call an SQL view. The return
dataset from the View is bind to a WinForm datagriview control.
From this datcontrol, data can be edited and updated.

What I woul like to get is that this modification goes back to the View at
SQL server side which will then update proper table.

The call method which will get that modification back is done as follow :
=====>

public static Boolean UpdateAlarm(string ConnectionString,DataSet dsSource)
{

//Connection definition
using (SqlConnection sqlConnection = new
SqlConnection(ConnectionString))
{
// Request Definition
using (SqlCommand sqlcommand = new SqlCommand())
{
sqlcommand.Connection = sqlConnection;
sqlcommand.CommandType = System.Data.CommandType.Text;
sqlcommand.CommandText = "Select * from
v_Current_Alarm";

try
{
sqlConnection.Open();
SqlDataAdapter adapter = new
SqlDataAdapter(sqlcommand);

adapter.Update(dsSource,dsSource.Tables[0].TableName);
sqlConnection.Close();

}
<===

What is strange from that is that if I Watch the dsSource object,
modification are seen inside Rows.ItemArray, but the RowsState is set to
"Unchanged"

Then my Update function of Adapter seems to not modiy anything on the back
end database.

Any ideas what I do wrong ?

regards
serge
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
he Catalyst Control Center is not supported by the driver version of your enabled graphics adapter. Please update your ATI graphics driver, or enable your ATI adapter using the Displays Manager. Keith Windows Vista General Discussion 23 5th Aug 2009 08:59 PM
Data adapter.Update with fields that are part of the update condit =?Utf-8?B?Um9nZXIgVHJhbmNoZXo=?= Microsoft ADO .NET 3 27th Feb 2007 11:31 PM
Adapter.Update() =?Utf-8?B?Sm9obg==?= Microsoft VB .NET 1 18th Sep 2005 08:19 PM
Another adapter.update not working LornaDoone Microsoft ADO .NET 6 25th Nov 2003 03:31 PM
Adapter Update help!!!!!!!!! sujatha Microsoft ADO .NET 2 18th Jul 2003 06:07 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:17 PM.