PC Review


Reply
Thread Tools Rate Thread

Adding a Datacolumn to MS Access file not working

 
 
Sagaert Johan
Guest
Posts: n/a
 
      22nd Oct 2008
Hi

When i add a datacolumn to a dataset and then call Update on the dataset
then my MS Access datbase does not reflect the changes.(no coumn was added
to the table)



DataColumn newcolumn = new DataColumn("NewlyAdded",
System.Type.GetType("System.Int32"));


string mySelectQuery = "SELECT * FROM mytable";


DataSet mds = new DataSet();

OleDbDataAdapter mda = new OleDbDataAdapter(mySelectQuery, dbconnection);

mda.Fill(mds,"mytable");

mds.Tables["mytable"].Columns.Add(newcolumn);

mds.Tables["mytable"].AcceptChanges();


mds.Update(mdt2, "mytable");

dbconnection.Close();



What am i missing ?


 
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
Problem adding aggregate datacolumn to datatable Trygve Lorentzen Microsoft ADO .NET 3 30th Nov 2006 08:43 PM
after dataset.merge(..) datacolumn.expression is not working? Giedrius Microsoft ADO .NET 1 12th Aug 2005 03:41 PM
Adding ExtendedProperties to a DataColumn in a DataSet Picho Microsoft C# .NET 1 8th May 2005 08:15 AM
Adding datacolumn to filled datatable VMI Microsoft C# .NET 1 2nd Nov 2004 08:20 PM
Adding a DataColumn William Ryan Microsoft ADO .NET 0 26th Aug 2003 03:43 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:52 AM.