Search Results

Search found 1402 results on 57 pages for 'dataset'.

Page 6/57 | < Previous Page | 2 3 4 5 6 7 8 9 10 11 12 13  | Next Page >

  • C# Dataset usage necessary before passing to GridView datasource?

    - by Goober
    Scenario Lets say for example I have a series of events that fire continually every half second presenting me with an object containing some bits of information. There are always between 10 and 15 objects that are being updated constantly. Since these bits of information are changing continually I want to display them in a GridView. When I do so, I want the user to see the data displayed in the gridview and actually be updated as opposed to just a continually extending list being printed and incrementing (like writeline on the console). Question Is the best way to achieve this to map my objects to a dataset and have the dataset mapped to the gridview? Thoughts Will this allow the gridview to just be "UPDATED" as opposed to being added to? Any implementation suggestions would be greatly appreciated. EDIT: it MUST be windows forms (I use DevExpress too)

    Read the article

  • How to store data to Excel from DataSet without going cell-by-cell?

    - by Jason Barnwell
    Duplicate of: What’s the simplest way to import a System.Data.DataSet into Excel? Using c# under VS2008, we can create an excel app, workbook, and then worksheet fine by doing this: Application excelApp = new Application(); Workbook excelWb = excelApp.Workbooks.Add(template); Worksheet excelWs = (Worksheet)this.Application.ActiveSheet; Then we can access each cell by "excelWs.Cells[i,j]" and write/save without problems. However with large numbers of rows/columns, we are expecting a loss in efficiency. Is there a way to "data bind" from a DataSet object into the worksheet without using the cell-by-cell approach? Most of the methods we have seen at some point revert to the cell-by-cell approach. Thanks for any suggestions.

    Read the article

  • Get Dataset returned from an ajax enabled wcf service....

    - by Pandiya Chendur
    I call an ajax enabled wcf service method , <script type="text/javascript"> function GetEmployee() { Service.GetEmployeeData('1','5',onGetDataSuccess); } function onGetDataSuccess(result) { Iteratejsondata(result) } </script> and my method is , [OperationContract] public string GetEmployeeData(int currentPage,int pageSize) { DataSet ds = GetEmployeeViewData(currentPage,pageSize); return GetJSONString(ds.Tables[0]); } My Dataset ds contains three datatable but i am using the first one for my records... Other two datatables have values how can i get them in result... function onGetDataSuccess(result) { Iteratejsondata(result) } Any suggestion...

    Read the article

  • How does the dataset determine the return type of a scalar query?

    - by Tobias Funke
    I am attempting to add a scalar query to a dataset. The query is pretty straight forward, it's just adding up some decimal values in a few columns and returning them. I am 100% confident that only one row and one column is returned, and that it is of decimal type (SQL money type). The problem is that for some reason, the generated method (in the .designer.cs code file) is returning a value of type object, when it should be decimal. What's strange is that there's another scalar query that has the exact same SQL but is returning decimal like it should. How does the dataset designer determine the data type, and how can I tell it to return decimal?

    Read the article

  • How does the dataset designer determine the return type of a scalar query?

    - by Tobias Funke
    I am attempting to add a scalar query to a dataset. The query is pretty straight forward, it's just adding up some decimal values in a few columns and returning them. I am 100% confident that only one row and one column is returned, and that it is of decimal type (SQL money type). The problem is that for some reason, the generated method (in the .designer.cs code file) is returning a value of type object, when it should be decimal. What's strange is that there's another scalar query that has the exact same SQL but is returning decimal like it should. How does the dataset designer determine the data type, and how can I tell it to return decimal?

    Read the article

  • How to efficiently convert DataSet.Tables to List<DataTable>?

    - by Soenhay
    I see many posts about converting the table(s) in a DataSet to a list of DataRows or other row data but I was unable to find anything about this question. This is what I came up with using in .Net 3.0: internal static List<DataTable> DataSetToList(DataSet ds) { List<DataTable> result = new List<DataTable>(); foreach (DataTable dtbl in ds.Tables) { result.Add(dtbl); } return result; } Is there a better way, excluding an extension method? Thanks

    Read the article

  • vant view dataset with microsoft report viewer

    - by Tan
    I have a dataset, the dataset is using a stored procedur to fetch data. i have filled the dataset and everythings is okej.When iam using the debug i can se that the dataset is not empty. but i cant view it with the microsoft report viewer. here is my code please help. private void frmPrint_Load(object sender, EventArgs e) { this.reportViewer1.RefreshReport(); reportViewer1.LocalReport.DataSources.Clear(); GetCauseMachineMatrixTableAdapter adapter = new GetCauseMachineMatrixTableAdapter(); QpNibrolDataSet dataset = new QpNibrolDataSet(); adapter.Fill(dataset.GetCauseMachineMatrix, this.start, this.end); DataTable DT = dataset.Tables[0]; ReportDataSource reportdatasource = new ReportDataSource(); reportdatasource.Name = "RDS_NAME"; reportdatasource.Value = DT; reportViewer1.LocalReport.DataSources.Add(reportdatasource); reportViewer1.LocalReport.Refresh(); reportViewer1.RefreshReport(); } the form is saying "The source of the report definition is not been specified" what im i doing wrong. Idont use a rdlc because when iam trying to view my dataset no columms name show because the Stored procedur i am using requires Parameters. please advice and help my thank you

    Read the article

  • using .NET web service (Dataset) from progress OpenEdge 4GL

    - by jasperdmx
    I created web service in C# .net with input parameter : DataSet in other side, i need to use this web service from progress OpenEdge 4GL 10.1 (not 10.2) the problem is Dataset in OpenEdge cant match with DataSet in .net. always return 0 in the result I'm C# programmer, so dont have deep knowledge in porgress. I did research in progress forum, but not a good result. any help ? thanks in advance. *codes***** //web service : C# .net [webmethod] public int getResult(DataSet ds) { DataTable tbl = ds.Tables["datas"]; int result=0; foreach (DataRow dr in tbl.Rows){ //only 1 record = 1 row result = Convert.toInt32(dr["field1"]); } return result; } //progress OpenEdge 10.1 --- create and fill temp-table : field1 = 30 and only 1 record --- create dataset and bind to temp-table --- connect to web service --- call webmethod : define variable result as integer no-undo. RUN getResult IN hPortType(INPUT dataset,OUTPUT result). message result view-as alert-box info button ok. --- RESULT ALWAYS 0 /****/ anyone know how to "bridge" dataset in progress openedge to .net dataset ? note: this web service works well if called from .net

    Read the article

  • Sending changes from multiple tables in disconnected dataset to SQLServer...

    - by Stecy
    We have a third party application that accept calls using an XML RPC mechanism for calling stored procs. We send a ZIP-compressed dataset containing multiple tables with a bunch of update/delete/insert using this mechanism. On the other end, a CLR sproc decompress the data and gets the dataset. Then, the following code gets executed: using (var conn = new SqlConnection("context connection=true")) { if (conn.State == ConnectionState.Closed) conn.Open(); try { foreach (DataTable table in ds.Tables) { string columnList = ""; for (int i = 0; i < table.Columns.Count; i++) { if (i == 0) columnList = table.Columns[0].ColumnName; else columnList += "," + table.Columns[i].ColumnName; } var da = new SqlDataAdapter("SELECT " + columnList + " FROM " + table.TableName, conn); var builder = new SqlCommandBuilder(da); builder.ConflictOption = ConflictOption.OverwriteChanges; da.RowUpdating += onUpdatingRow; da.Update(ds, table.TableName); } } catch (....) { ..... } } Here's the event handler for the RowUpdating event: public static void onUpdatingRow(object sender, SqlRowUpdatingEventArgs e) { if ((e.StatementType == StatementType.Update) && (e.Command == null)) { e.Command = CreateUpdateCommand(e.Row, sender as SqlDataAdapter); e.Status = UpdateStatus.Continue; } } and the CreateUpdateCommand method: private static SqlCommand CreateUpdateCommand(DataRow row, SqlDataAdapter da) { string whereClause = ""; string setClause = ""; SqlConnection conn = da.SelectCommand.Connection; for (int i = 0; i < row.Table.Columns.Count; i++) { char quoted; if ((row.Table.Columns[i].DataType == Type.GetType("System.String")) || (row.Table.Columns[i].DataType == Type.GetType("System.DateTime"))) quoted = '\''; else quoted = ' '; string val = row[i].ToString(); if (row.Table.Columns[i].DataType == Type.GetType("System.Boolean")) val = (bool)row[i] ? "1" : "0"; bool isPrimaryKey = false; for (int j = 0; j < row.Table.PrimaryKey.Length; j++) { if (row.Table.PrimaryKey[j].ColumnName == row.Table.Columns[i].ColumnName) { if (whereClause != "") whereClause += " AND "; if (row[i] == DBNull.Value) whereClause += row.Table.Columns[i].ColumnName + "=NULL"; else whereClause += row.Table.Columns[i].ColumnName + "=" + quoted + val + quoted; isPrimaryKey = true; break; } } /* Only values for column that is not a primary key can be modified */ if (!isPrimaryKey) { if (setClause != "") setClause += ", "; if (row[i] == DBNull.Value) setClause += row.Table.Columns[i].ColumnName + "=NULL"; else setClause += row.Table.Columns[i].ColumnName + "=" + quoted + val + quoted; } } return new SqlCommand("UPDATE " + row.Table.TableName + " SET " + setClause + " WHERE " + whereClause, conn); } However, this is really slow when we have a lot of records. Is there a way to optimize this or an entirely different way to send lots of udpate/delete on several tables? I would really much like to use TSQL for this but can't figure a way to send a dataset to a regular sproc. Additional notes: We cannot directly access the SQLServer database. We tried without compression and it was slower.

    Read the article

  • C# Convert Excel Range to Dataset or Datatable, etc.

    - by htbrady
    I have an Excel spreadsheet that will sit out on a network share drive. It needs to be accessed by my Winforms C# 3.0 application (many users could be using the app and hitting this spreadsheet at the same time). There is a lot of data on one worksheet. This data is broken out into areas that I have named as ranges. I need to be able to access these ranges individually, return each range as a dataset, and then bind it to a grid. I have found examples that use OLE and have got these to work. However, I have seen some warnings about using this method, plus at work we have been using Microsoft.Office.Interop.Excel as the standard thus far. I don't really want to stray from this unless I have to. Our users will be using Office 2003 on up as far as I know. I can get the range I need with the following code: MyDataRange = (Microsoft.Office.Interop.Excel.Range)MyWorkSheet.get_Range("MyExcelRange", Type.Missing); The OLE way was nice as it would take my first row and turn those into columns. My ranges (12 total) are for the most part different from each other in number of columns. Didn't know if this info would affect any recommendations. Is there any way to use Interop and get the returned range back into a dataset? Thanks for your help.

    Read the article

  • Strongly Typed DataSet column requires custom type to implement IXmlSerializable?

    - by Phil
    I have a strongly typed Dataset with a single table with three columns. These columns all contain custom types. DataColumn1 is of type Parent DataColumn2 is of type Child1 DataColumn3 is of type Child2 Here is what these classes look like: [Serializable] [XmlInclude(typeof(Child1)), XmlInclude(typeof(Child2))] public abstract class Parent { public int p1; } [Serializable] public class Child1 :Parent { public int c1; } [Serializable] public class Child2 : Parent { public int c1; } now, if I add a row with DataColumn1 being null, and DataColumns 2 and 3 populated and try to serialize it, it works: DataSet1 ds = new DataSet1(); ds.DataTable1.AddDataTable1Row(null, new Child1(), new Child2()); StringBuilder sb = new StringBuilder(); using (StringWriter writer = new StringWriter(sb)) { ds.WriteXml(writer);//Works! } However, if I try to add a value to DataColumn1, it fails: DataSet1 ds = new DataSet1(); ds.DataTable1.AddDataTable1Row(new Child1(), new Child1(), new Child2()); StringBuilder sb = new StringBuilder(); using (StringWriter writer = new StringWriter(sb)) { ds.WriteXml(writer);//Fails! } Here is the Exception: "Type 'WindowsFormsApplication4.Child1, WindowsFormsApplication4, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' does not implement IXmlSerializable interface therefore can not proceed with serialization." I have also tried using the XmlSerializer to serialize the dataset, but I get the same exception. Does anyone know of a way to get around this where I don't have to implement IXmlSerializable on all the Child classes? Alternatively, is there a way to implement IXmlSerializable keeping all default behavior the same (ie not having any class specific code in the ReadXml and WriteXml methods)

    Read the article

  • Convert Excel Range to ADO.NET DataSet or DataTable, etc.

    - by htbrady
    I have an Excel spreadsheet that will sit out on a network share drive. It needs to be accessed by my Winforms C# 3.0 application (many users could be using the app and hitting this spreadsheet at the same time). There is a lot of data on one worksheet. This data is broken out into areas that I have named as ranges. I need to be able to access these ranges individually, return each range as a dataset, and then bind it to a grid. I have found examples that use OLE and have got these to work. However, I have seen some warnings about using this method, plus at work we have been using Microsoft.Office.Interop.Excel as the standard thus far. I don't really want to stray from this unless I have to. Our users will be using Office 2003 on up as far as I know. I can get the range I need with the following code: MyDataRange = (Microsoft.Office.Interop.Excel.Range) MyWorkSheet.get_Range("MyExcelRange", Type.Missing); The OLE way was nice as it would take my first row and turn those into columns. My ranges (12 total) are for the most part different from each other in number of columns. Didn't know if this info would affect any recommendations. Is there any way to use Interop and get the returned range back into a dataset?

    Read the article

  • How can I include DBNull as a value in my strongly typed dataset?

    - by Beska
    I've created a strongly typed dataset (MyDataSet) in my .NET app. For the sake of simplicity, we'll say it has one DataTable (MyDataTable), with one column (MyCol). MyCol has its DataType property set to "System.Int32", and its AllowDBNull property set to "true". I'd like to manually create a new row, and add it to this dataset. I create the row without a problem, with something like: MyDataSet.MyDataTableRow myRow = MySimpleDataSet.MyDataTable.NewItemRow(); Fine. However, when I try to set the value to DBNull: myRow.MyCol = DBNull.Value; I'm told that I can't do it...that it can't cast that to an int. This makes sense, in a way, since I've defined it to be an int...but then how can I get DBNull in there? Am I not supposed to be able to have DBNull in there? Isn't that what the AllowDBNull property is for? I'm obviously missing something fundemental. Can someone help explain what it is? EDIT: I also tried entering "int?" as the DataType, but Visual Studio throws an error when I enter it, saying that "Column requires a valid DataType."

    Read the article

  • How to delete a row from a typed dataset and save it to a database?

    - by Zingam
    I am doing this as a small project to learn about disconnected and connected models in .NET 4.0 and SQL Server 2008 R2. I have three tables: Companies (PK CompanyID) Addresses (PK AddressID, FK CompanyID) ContactPersons (PK ContactPersonID, FK CompanyID) CompanyID is assigned manually by the users. The other IDs are auto-generated. Companies has a one-to-many relationship with ContactPerson. I have set any changes to cascade. I display all records in Companies in a DataGridView and when a row is clicked, the corresponding records in ContactPersons are displayed in a second DataGridView. I have successfully implemented updating and inserting new records but I completely fail in my attempts to delete rows and save the changes to the database. I us a typed dataset. If I use this: DataRow[] contactPersonRows = m_SoldaCompaniesFileDataSet.ContactPersons.Select("ContactPersonID = " + this.m_CurrentContactPerson.ContactPersonID); m_SoldaCompaniesFileDataSet.ContactPersons.Rows.Remove(contactPersonRows[0]); The records are displayed properly in the DataGridView but are not saved in the database later. If I use this: DataRow row = m_SoldaCompaniesFileDataSet.ContactPersons.Rows.Find(this.m_CurrentContactPerson.ContactPersonID); row.Delete(); The records are set but I get an exeception: DeletedRowInaccessibleException, when I try to refresh the DataGridView. The exception pop-s up in the auto-generated dataset.design file. I am pretty much stuck at this point since yesterday. I cannot find anything anywhere that remotely resembles my problem. And I cannot understand actually what is going on.

    Read the article

  • How can i return dataset perfectly from sql?

    - by Phsika
    i try to write a winform application: i dislike below codes: DataTable dt = new DataTable(); dt.Load(dr); ds = new DataSet(); ds.Tables.Add(dt); Above part of codes looks unsufficient.How can i best loading dataset? public class LoadDataset { public DataSet GetAllData(string sp) { return LoadSQL(sp); } private DataSet LoadSQL(string sp) { SqlConnection con = new SqlConnection(ConfigurationSettings.AppSettings["ConnectionString"].ToString()); SqlCommand cmd = new SqlCommand(sp, con); DataSet ds; try { con.Open(); cmd.CommandType = CommandType.StoredProcedure; SqlDataReader dr = cmd.ExecuteReader(); DataTable dt = new DataTable(); dt.Load(dr); ds = new DataSet(); ds.Tables.Add(dt); return ds; } finally { con.Dispose(); cmd.Dispose(); } } }

    Read the article

  • How to open DataSet in Visual Studio 2008 faster?

    - by Ekkapop
    When I open DataSet in Visual Studio 2008 to design or modify it, it always take a very long time (more than five minutes) before I can continue to do my job. While I'm waiting I can't do anything on Visual Studio, moreover CPU and memory usage is growth dramatically. I want to know, Is it has anyway to reduce this waiting time? Hardware - Desktop CPU: Intel Q6600 Memory: 4 GB HDD: 320 GB 7200 rpm OS: Windows XP 32 bit with Service Pack 3

    Read the article

  • What method should be used for searching this mysql dataset?

    - by GeoffreyF67
    I've got a mysql dataset that contains 86 million rows. I need to have a relatively fast search through this data. The data I'll be searching through is all strings. I also need to do partial matches. Now, if I have 'foobar' and search for '%oob%' I know it'll be really slow - it has to look at every row to see if there is a match. What methods can be used to speed queries like this up? G-Man

    Read the article

  • Updating a Data Source with a Dataset

    - by Paul
    Hi, I need advice. I have asp.net web service and winforms client app. Client call this web method and get dataset. 1. [WebMethod] 2. public DataSet GetSecureDataSet(string id) 3. { 4. 5. 6. SqlConnection conn = null; 7. SqlDataAdapter da = null; 8. DataSet ds; 9. try 10. { 11. 12. string sql = "SELECT * FROM Tab1"; 13. 14. string connStr = WebConfigurationManager.ConnectionStrings["Employees"].ConnectionString; 15. 16. conn = new SqlConnection(connStr); 17. conn.Open(); 18. 19. da = new SqlDataAdapter(sql, conn); 20. 21. ds = new DataSet(); 22. da.Fill(ds, "Tab1"); 23. 24. return ds; 25. } 26. catch (Exception ex) 27. { 28. throw ex; 29. } 30. finally 31. { 32. if (conn != null) 33. conn.Close(); 34. if (da != null) 35. da.Dispose(); 36. } 37. } After he finish work he call this update web method. He can add, delete and edit rows in table in dataset. [WebMethod] public bool SecureUpdateDataSet(DataSet ds) { SqlConnection conn = null; SqlDataAdapter da = null; SqlCommand cmd = null; try { DataTable delRows = ds.Tables[0].GetChanges(DataRowState.Deleted); DataTable addRows = ds.Tables[0].GetChanges(DataRowState.Added); DataTable editRows = ds.Tables[0].GetChanges(DataRowState.Modified); string sql = "UPDATE * FROM Tab1"; string connStr = WebConfigurationManager.ConnectionStrings["Employees"].ConnectionString; conn = new SqlConnection(connStr); conn.Open(); cmd = new SqlCommand(sql, conn); da = new SqlDataAdapter(sql, conn); if (addRows != null) { da.Update(addRows); } if (delRows != null) { da.Update(delRows); } if (editRows != null) { da.Update(editRows); } return true; } catch (Exception ex) { throw ex; } finally { if (conn != null) conn.Close(); if (da != null) da.Dispose(); } } Code on client side 1. //on client side is dataset bind to datagridview 2. Dataset ds = proxy.GetSecureDataSet(""); 3. ds.AcceptChanges(); 4. 5. //edit dataset 6. 7. 8. //get changes 9. DataSet editDataset = ds.GetChanges(); 10. 11. //call update webmethod 12. proxy.SecureUpdateDataSet(editDataSet) But it finish with this error : System.Web.Services.Protocols.SoapException: Server was unable to process request. --- System.InvalidOperationException: Update requires a valid UpdateCommand when passed DataRow collection with modified rows. at WebService.Service.SecureUpdateDataSet(DataSet ds) in D:\Diploma.Work\WebService\Service1.asmx.cs:line 489 Problem is with SQL Commad, client can add, delete and insert row, how can write a corect SQL command.... any advice please? Thank you

    Read the article

  • Where can I download a free, text-rich dataset?

    - by blee
    I want to do a bit of lightweight testing and bench-marking for full-text search, so the dataset should have the qualities: 10,000 - 100,000 records. good dispersion of English words. In CSV or Excel format--i.e. I don't want to access it via API. Something like books or movies with title and description fields would be perfect. I browsed the UCI Machine Learning Repo, but it was too number-oriented. Thanks!

    Read the article

  • dataset to List<T>using linq

    - by bharat
    I have the dataset and I want to convert the dataset into List<T> T - type object How do I do it my dataset? It has 10 columns, with all 10 properties my object has and it's returning over 15000 rows. I want to return that dataset into List<obj> and loop it how do I do that?

    Read the article

  • How to convert many-to-one XML data to DataSet?

    - by TruMan1
    I have an XML document that has a collection of objects. Each object has a key/value pair of label and value. I am trying to convert this into a DataSet, but when I do ds.ReadXml(xmlFile), then it creates two columns: label and value. What I would like is to have a column for each "label" and the value to be part of the row. here is my sample of the XML: <responses> <response> <properties id="1" Form="Account Request" Date="Tuesday, March 16, 2010 5:04:26 PM" Confirmation="True" /> <fields> <field> <label>Name</label> <value>John</value> </field> <field> <label>Email</label> <value>[email protected]</value> </field> <field> <label>Website</label> <value>http://domain1.com</value> </field> <field> <label>Phone</label> <value>999-999-9999</value> </field> <field> <label>Place of Birth</label> <value>Earth</value> </field> <field> <label>Misc</label> <value>Misc</value> </field> <field> <label>Comments</label> <value /> </field> <field> <label>Agree to Terms?</label> <value>True</value> </field> </fields> </response> <response> <properties id="2" Form="Account Request" Date="Tuesday, March 17, 2010 5:04:26 PM" Confirmation="True" /> <fields> <field> <label>Name</label> <value>John2</value> </field> <field> <label>Email</label> <value>[email protected]</value> </field> <field> <label>Website</label> <value>http://domain2.com</value> </field> <field> <label>Phone</label> <value>999-999-9999</value> </field> <field> <label>Place of Birth</label> <value>Earth</value> </field> <field> <label>Misc</label> <value>Misc</value> </field> <field> <label>Comments</label> <value /> </field> <field> <label>Agree to Terms?</label> <value>True</value> </field> </fields> </response> <response> <properties id="3" Form="Account Request" Date="Tuesday, March 18, 2010 5:04:26 PM" Confirmation="True" /> <fields> <field> <label>Name</label> <value>John3</value> </field> <field> <label>Email</label> <value>[email protected]</value> </field> <field> <label>Website</label> <value>http://domain3.com</value> </field> <field> <label>Phone</label> <value>999-999-9999</value> </field> <field> <label>Place of Birth</label> <value>Earth</value> </field> <field> <label>Misc</label> <value>Misc</value> </field> <field> <label>Comments</label> <value /> </field> <field> <label>Agree to Terms?</label> <value>True</value> </field> </fields> </response> <response> <properties id="4" Form="Account Request" Date="Tuesday, March 19, 2010 5:04:26 PM" Confirmation="True" /> <fields> <field> <label>Name</label> <value>John</value> </field> <field> <label>Email</label> <value>[email protected]</value> </field> <field> <label>Website</label> <value>http://domain4.com</value> </field> <field> <label>Phone</label> <value>999-999-9999</value> </field> <field> <label>Place of Birth</label> <value>Earth</value> </field> <field> <label>Misc</label> <value>Misc</value> </field> <field> <label>Comments</label> <value /> </field> <field> <label>Agree to Terms?</label> <value>True</value> </field> </fields> </response> </responses> How would I convert this to a DataSet so that I can load it into a gridview with the columns: Name, Email, Website, Phone, Place of Birth, Misc, Comments, and Agree to Terms? Then row 1 would be: John, [email protected], http://domain1.com, 999-999-9999, Earth, Misc, , True How can I do this with the XML provided?

    Read the article

  • Deserialization of a DataSet... deal with column name changes? how to migrate data from one column to another?

    - by Brian Kennedy
    So, we wanted to slightly generalize a couple columns in our typed dataset... basically dropped a foreign key constraint and then wanted to change a couple column names to better reflect their new state. All that is easy. The problem is that our users may have serialized out the old version of the DataSet as XML. We want to be able to read those old XML files and deserialize them into the revised DataSet. It seems that would be a fairly common desire... but I haven't yet figured out the right thing to search the internet for. One possible solution would seem to be some way to give a DataColumn an alias or alternate name such that when it reads the old column name, it knows that data can be read into the column with the new column name. I can find no support for any such thing. Another approach would seem to be an "after deserialization" method of some sort... so, I would let it read in the old column values into a normal DataColumn with that name, and then in the "after deserialization" method I would just move the data from the obsolete column into the new column, and then delete the old columns. That would seem to generalize to many other situations... and having such events or hooks is pretty common in ADO.NET. But I have looked for such a hook and haven't yet found it. If no "after deserialization" hook, it would seem I ought to be able to override ReadXml or ReadXmlSerializable methods to call the base and then do my "after" stuff to fix up old data into new. But it does not appear that is possible. Soooo, I have to think backward compatibility with old serialized DataSets and simple data migration would be a well-solved problem... so, trying to reinvent that wheel seems silly. But so far, I haven't seemed to find any documentation on doing those things. Suggestions? What is best practice for this?

    Read the article

  • MVVM Good Design. DataSet or a RowViewModel

    - by LnDCobra
    I have just started learning MVVM and having a dilemna. If I have a a main ViewModel and inside this model I have a number of datasets. Now should I be creating a new ViewModel for each row inside the dataset? Or expose the DataSet itself as a DependencyProperty? For now the dataset has about 20 rows inside it, and the thought of iterating through each row to create a ViewModel binding to each row.... might not be the best option for performance reasons and memory reasons in the future, like when there are 1000+ rows. Should I still go ahead and create a RowViewModel and iterate through the dataset? And have an ObservableCollection of it or just expose the dataset? Any help would be greatly appreciated.

    Read the article

  • DataSet XML export is empty

    - by Shaine
    I've got in-memory dataset with couple of tables that is populated in code. Data-bound grids on the gui show table contents without a problem. Then I try to export the dataset into XML: ds.WriteXml(fdSave.FileName, XmlWriteMode.WriteSchema); and get empty XML (with couple of lines regarding dataset names but without any tables) If I export table directly I've got all the data but dataset name is obviously wrong: ds.Fields.WriteXml(fdSave.FileName, XmlWriteMode.WriteSchema); What am I missing? Is there any reasonable way to write the whole dataset into file?

    Read the article

< Previous Page | 2 3 4 5 6 7 8 9 10 11 12 13  | Next Page >