none
Unable to Update/Insert a new row into the database... RRS feed

  • Question

  • I am working on a windows project. I created a data base "EAE.mdf" from MS VC# EE, one of the tables of this DataBase is "XmlData". i have created a dataset "EAEDataSet" with the tableadapter "XmlDataTableAdapter" to access the contents of this table. In the project I wanted to insert a few rows from the an XML file. So I have created a data row "xmlDataRow" filled all the columns of this row with the the required data. then added the row to the dataTable "XmlData" using

    this.DataSet.XmlData.Rows.Add(xmlDataRow);

    Then called on the update method on the table adapter "XmlDataTableAdapter" table.

    rowUpdates = this.XmlDataTableAdapter.Update(this.DataSet.XmlData);

    The above row updates return the exact number of rows added to the XmlData table. I can access and view the data from the dataset in another form. but the update method is not saving the data in the dataBase. Once after closing the program the database table is still empty!
     
    I also changed the copy settings of the database but nothing seems to work and my database is always empty.
     
    After looking into the MSDN documentation for the update method of a table adapter i understand that it is supposed to save all the changes in the datatable into the database but this is not what is happening in my case. I am using Microsoft Visual C# Express Edition. Thanks.
     
    Regards,
    Raj.
     
    Friday, September 1, 2006 11:16 AM

Answers

  • Hi,

    Yes you can still use the SqlServer running on a network. THough you can only access this through your code and not through your designer. This would prohibit you to use Typed Datasets. THis is the limitation of VC# Express. If you have a copy of VS.Net 2003 you'll just have to make an upgrade to get the full features of VS2005.

    Here's the site if you want to make an upgrade.

    http://msdn.microsoft.com/vstudio/howtobuy/renewal/default.aspx

     

     

    cheers,

    Paul June A. Domag

    Friday, September 1, 2006 2:22 PM

All replies

  • Ok I have found the answer!! Now I have decided to not to use a local DB but to use an instance of SQL server running on the network Server. But I am unable to connect to this. Is it because I am using MS VC# 2005 Express Edition? Do I have to use the full enterprise version of VS? I do have a full license for VS.Net 2003. Can I just use that instead of VC#2005 express Edition and still get the same advantages of all the latest .NET features? Thank you.
    Friday, September 1, 2006 1:41 PM
  • Hi,

    Yes you can still use the SqlServer running on a network. THough you can only access this through your code and not through your designer. This would prohibit you to use Typed Datasets. THis is the limitation of VC# Express. If you have a copy of VS.Net 2003 you'll just have to make an upgrade to get the full features of VS2005.

    Here's the site if you want to make an upgrade.

    http://msdn.microsoft.com/vstudio/howtobuy/renewal/default.aspx

     

     

    cheers,

    Paul June A. Domag

    Friday, September 1, 2006 2:22 PM
  • Thanks Paul will try that now and if I get stuck up then will get back to you. Cheers!!
    Friday, September 1, 2006 2:36 PM