Search Results

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

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

  • Draw chart for every row of the dataset in SSRS. Loop through dataset rows

    - by Rushme
    Hi, Could anyone help me with how can we create chart for every row of the dataset in SSRS (rdl) ! Suppose the dataset has the following data Name Age ------- ------- A 25 B 26 C 22 3 chart needs to be drawn for the x-axis/y-axis combination of A/25, B/26, C/22. How can I loop through rows of the dataset. And how can I restrict the chart to that particular data point. What would be the xsl expression corresponding to this functionality.

    Read the article

  • Use LINQ to insert data from dataset to SQL

    - by Mayo
    Let's say I have a dataset in an ASP.NET website (.NET 3.5) with 5 tables, each has roughly 30,000 rows and an average of 12 columns. I want to insert all of the data from the dataset into 5 very-similar-but-not-quite-identical tables in SQL Server 2008. I also want to use LINQ (personal preference - trying to learn something new). Is it as simple as iterating through the dataset and, for each row, creating a new instance of the associated class, initializing its data with the dataset's row, adding it to the data model, and then doing one giant SubmitChanges at the end? Are there better ways of doing this with LINQ? Or is this the de-facto standard?

    Read the article

  • Backup and Restore a SQLCE .sdf database

    - by Ruben Trancoso
    My application needs to backup and restore .sdf files. There is a single dataSet the the whole application and some bindngSource and table adapters on forms using this same dataset. Just for a sake of test I tryied to copy the .sdf in runtime for a backup folder and back to restore it and I got my application not finding the file like it was not there anymore. How should I manage connections to open and close the database since the dataSet do it automaticaly at begin and end of my application?

    Read the article

  • Reading DBF with VFPOLEDB driver problem.

    - by John Sheares
    I am using VFPOLEDB driver to read DBF files and I keep getting this error and I am not sure why and how to fix the problem: The provider could not determine the Decimal value. For example, the row was just created, the default for the Decimal column was not available, and the consumer had not yet set a new Decimal value. Here is the code. I call this routine to return a DataSet of the DBF file and display the data in a DataGridView. public DataSet GetDBFData(FileInfo fi, string tbl) { using (OleDbConnection conn = new OleDbConnection( @"Provider=VFPOLEDB.1;Data Source=" + fi.DirectoryName + ";")) { conn.Open(); string command = "SELECT * FROM " + tbl; OleDbDataAdapter da = new OleDbDataAdapter(command, conn); DataSet ds = new DataSet(); da.Fill(ds); return ds; } }

    Read the article

  • Binding Programatically Generated Datasets To Report Viewer

    - by mavera
    Today I researched about reportviewer to use it in my project. As I see the samples and tutorials in the web, We should create an dataset file to Solution Explorer and bind it to report viewer to show data. However I want to create dataset programatically like sample code below. And I want to bind it. Dim ds As New DataSet DB_Gateway.myDataSet("select * from users", ds, "users") How can I do it?

    Read the article

  • How to do binding programmically?

    - by user175908
    Hello, Could anyone identify the problem in this code? (I'm kinda newbie in WPF bindings.) This code executes after chart is loaded when I click a button: I get this error: Update: I dont get that error anymore. Thanks to Tomas. Now no error occur but chart looks completely blank (no columns) Update: Code now looks like this: // create a very simple DataSet var dataSet = new DataSet("MyDataSet"); var table = dataSet.Tables.Add("MyTable"); table.Columns.Add("Name"); table.Columns.Add("Price"); table.Rows.Add("Brick", 1.5d); table.Rows.Add("Soap", 4.99d); table.Rows.Add("Comic Book", 0.99d); // chart series var series = new ColumnSeries() { IndependentValueBinding = new Binding("[Name]"), // How to deal with DependentValueBinding = new Binding("[Price]"), // these two? ItemsSource = dataSet.Tables[0].DefaultView // or maybe I do mistake here? }; // ---------- set additional binding as adviced ------------------ series.SetBinding(ColumnSeries.ItemsSourceProperty, new Binding()); // chart stuff MyChart.Series.Add(series); MyChart.Title = "Names 'n Prices"; // some code to remove legend var style = new Style(typeof(Control)); style.Setters.Add(new Setter(LegendItem.TemplateProperty, null)); MyChart.LegendStyle = style; XAML: <Window x:Class="BindingzTest.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="MainWindow" Height="606" Width="988" xmlns:charting="clr-namespace:System.Windows.Controls.DataVisualization.Charting;assembly=System.Windows.Controls.DataVisualization.Toolkit"> <Grid Name="LayoutRoot"> <charting:Chart Name="MyChart" Margin="0,0,573,0" Height="289" VerticalAlignment="Top" /> <Button Content="Button" Height="23" HorizontalAlignment="Left" Margin="272,361,0,0" Name="button1" VerticalAlignment="Top" Width="75" Click="chart1_Loaded" /> </Grid> Thanks for help in advance once more.

    Read the article

  • Run SQL Queries on DataTables, or similar, in .Net, without an RDBMS

    - by FastAl
    I'd like to have a dataset or datatables, and be able to run SQL statements on them, without using any external RDBMS. For Example, to take take 2 datatables in a dataset and just join them outright with a SQL statement and Where clause, the result being a new datatable? For example if I have 2 datatables, named People and Addresses in a dataset (that I built using code, not getting from a database .. pardon the old fashioned Join syntax): dim dtJoined as DataTable = MyDataSet.RunSQLQuery ("Select * from People, Orders Where People.PersonID=Orders.OrdereID") Thanks

    Read the article

  • Can I use Linq to project a new typed datarow?

    - by itchi
    I currently have a csv file that I'm parsing with an example from here: http://alexreg.wordpress.com/2009/05/03/strongly-typed-csv-reader-in-c/ I then want to loop the records and insert them using a typed dataset xsd to an Oracle database. It's not that difficult, something like: foreach (var csvItem in csvfile) { DataSet.MYTABLEDataTable DT = new DataSet.MYTABLEDataTable(); DataSet.MYTABLERow row = DT.NewMYTABLERow(); row.FIELD1 = csvItem.FIELD1; row.FIELD2 = csvItem.FIELD2; } I was wondering how I would do something with LINQ projection: var test = from csvItem in csvfile select new MYTABLERow { FIELD1 = csvItem.FIELD1, FIELD2 = csvItem.FIELD2 } But I don't think I can create datarows like this without the use of a rowbuilder, or maybe a better constructor for the datarow?

    Read the article

  • How update DB table with DataSet

    - by Paul
    I am begginer with ADO.NET , I try update table with DataSet. O client side I have dataset with one table. I send this dataset on service side (it is ASP.NET Web Service). On Service side I try update table in database, but it dont 't work. public bool Update(DataSet ds) { SqlConnection conn = null; SqlDataAdapter da = null; SqlCommand cmd = null; try { 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); da.UpdateCommand = cmd; da.Update(ds.Tables[0]); return true; } catch (Exception ex) { throw ex; } finally { if (conn != null) conn.Close(); if (da != null) da.Dispose(); } } Where can be problem?

    Read the article

  • transaction handling in dataset based insert/update in c#

    - by user3703611
    I am trying to insert bulk records in a sql server database table using dataset. But i am unable to do transaction handling. Please help me to apply transaction handling in below code. I am using adapter.UpdateCommand.Transaction = trans; but this line give me an error of Object reference not set to an instance of an object. Code: string ConnectionString = "server=localhost\\sqlexpress;database=WindowsApp;Integrated Security=SSPI;"; SqlConnection conn = new SqlConnection(ConnectionString); conn.Open(); SqlTransaction trans = conn.BeginTransaction(IsolationLevel.Serializable); SqlDataAdapter adapter = new SqlDataAdapter("SELECT * FROM Test ORDER BY Id", conn); SqlCommandBuilder builder = new SqlCommandBuilder(adapter); adapter.UpdateCommand.Transaction = trans; // Create a dataset object DataSet ds = new DataSet("TestSet"); adapter.Fill(ds, "Test"); // Create a data table object and add a new row DataTable TestTable = ds.Tables["Test"]; for (int i=1;i<=50;i++) { DataRow row = TestTable.NewRow(); row["Id"] = i; TestTable .Rows.Add(row); } // Update data adapter adapter.Update(ds, "Test"); trans.Commit(); conn.Close();

    Read the article

  • JSON.NET "System.OutOfMemoryException" when deserializing into a DataSet

    - by Tiago
    Very new to C# and JSON. I have been struggling with this problem for about a day and can't figure it out. JSONLint states both JSON strings are valid. Trying to deserialize the following {"items":[{"id":"1122267","quantity":"1","bundle":"1"}],"seconds_ago":"1"} throws the exception An unhandled exception of type 'System.OutOfMemoryException' occurred in Newtonsoft.Json.dll If I try {"items":[{"id":"1122267","quantity":"1","bundle":"1"}]} it works. I'm reading the JSON string from a textbox and then deserializing using the following string json = textBox1.Text; DataSet dataSet = JsonConvert.DeserializeObject<DataSet>(json);

    Read the article

  • DataSet gets cleared when displaying crystal report output

    - by Tejas
    hello friends, I am facing one strange but typical problem. In one my form I have DataSet filled up with so much of data which I need to use throughout the form. & I have 1 "print report" button also. When user click on that a report gets displayed. But after I click on that my DataSet gets cleared & so after that bug comes to my form. What to so my DataSet remains filled even after displaying that report output? Pls help me experts...

    Read the article

  • DataSet Schema sync.

    - by np
    Here is my scenario: I have a DataSet1 that i load from a DataSet1.xsd which has a few datatables. After laoding the DataSet1 we add data to it and serialize it and save it to a file. But the next day we make changes to the schema of the dataset for example added a couple of columns to the schema. Now when we load the existing DataSet from the serialized file this will not have the columns that were added in the xsd file. We need to sync the dataset with the new schema. How to? Thanks N

    Read the article

  • DataSet.GetChanges - Save the updated record in a different table than the source one

    - by John Dev
    I'm doing operation on a dataset containing data from a sql table named Test_1 and then get the updated records using the DataSet.GetChanges(DataRowState.Modified) function. Then i try to save the dataset containing the updated records on a different table than the source one (the table is names Test and has the same structure as Test_1) using the following statement: sqlDataAdapter.Update(changesDataSet,"Test"); I'm getting the following error : Update unable to find TableMapping['Test'] or DataTable 'Test' I'm new to ado.net and don't even know if it"s something possible. Any advice is welcome. Just to provide a bit of context. ETL jobs are importing data in temp table with same structure as the original but with _jobid suffix. Right after a rule engine is doing validation before updating the original table.

    Read the article

  • Using Linq to filter a ComboBox.DataSource ?

    - by Pesche Helfer
    Hi board, in another topic, I've stumbled over this very elegant solution by Darin Dimitrov to filter the DataSource of one ComboBox with the selection of another ComboBox: how to filter combobox in combobox using c# combo2.DataSource = ((IEnumerable<string>)c.DataSource) .Where(x => x == (string)combo1.SelectedValue); I would like to do a similar thing, but intead of filtering by a second combobox, I would like to filter by the text of a TextBox. (Basically, instead of choosing from a second ComboBox, the user simply enters his filter in to a TextBox). However, it turned out to be not as straight forward as I had hoped it would be. I tried stuff as the following, but failed miserably: cbWohndresse.DataSource = ((IEnumerable<DataSet>)ds) .Where(x => x.Tables["Adresse"].Select("AdrLabel LIKE '%TEST%'")); cbWohndresse.DisplayMember = "Adresse.AdrLabel"; cbWohndresse.ValueMember = "Adresse.adress_id"; ds is the DataSet which I would like to use as filtered DataSource. "Adresse" is one DataTable in this DataSet. It contains a DataColumn "AdrLabel". Now I would like to display only those "AdrLabel", which contain the string from the user input. (Currently, %TEST% replaces the textbox.text.) The above code fails because the lambda expression does not return Bool. But I am sure, there are also other problems (which type should I use for IEnumerable? Now it's DataSet, but Darin used String. But how could I convert a DataSet to a string? Yes, I am as much newbyish as it gets, my experience is "void", and publicly so. So please forgive me my rather stupid questions. Your help is greatly appreciated, because I can't solve this on my own (tried hard already). Thank you very much! Pesche P.S. I am only using Linq to achieve an uncomplicated filter for the ComboBox (avoiding a View). The rest is not based on Linq, but on oldstyle Ado.NET (ds is filled by an SqlDataAdapter), if that's of any importance.

    Read the article

  • Avoiding Redundancies in XML documents

    - by MarceloRamires
    I was working with a certain XML where there were no redundancies <person> <eye> <eye_info> <eye_color> blue </eye_color> </eye_info> </eye> <hair> <hair_info> <hair_color> blue </hair_color> </hair_info> </hair> </person> As you can see, the sub-tag eye-color makes reference to eye in it's name, so there was no need to avoid redundancies, I could get the eye color in a single line after loading the XML into a dataset: dataset.ReadXml(path); value = dataset.Tables("eye_info").Rows(0)("eye_color"); I do realise it's not the smartest way of doing so, and this situation I'm having now wasn't unforeseen. Now, let's say I have to read xml's that are in this format: <person> <eye> <info> <color> blue </color> </info> </eye> <hair> <info> <color> blue </color> </info> </hair> </person> So If I try to call it like this: dataset.ReadXml(path); value = dataset.Tables("info").Rows(0)("color"); There will be a redundancy, because I could only go as far as one up level to identify a single field in a XML with my previous method, and the 'disambiguator' is three levels above. Is there a practical way to reach with no mistake a single field given all the above (or at least a few) fields ?

    Read the article

  • Can I create a custom class that inherits from a strongly typed DataRow?

    - by Calvin Fisher
    I'm working on a huge, old project with a lot of brittle code, some of which has been around since the .NET 1.0 era, and it has been and will be worked on by other people... so I'd like to change as little as possible. I have one project in my solution that contains DataSet.xsd. This project compiles to a separate assembly (Data.dll). The database schema includes several tables arranged more or less hierarchically, but the only way the tables are actually linked together is through joins. I can get, e.g. DepartmentRow and EmployeeRow objects from the autogenerated code. EmployeeRow contains information from the employee's corresponding DepartmentRow through a join. I'm making a new report to view multiple departments and all their employees. If I use the existing data access scheme, all I will be able to get is a spreadsheet-like output where each employee is represented on one line, with department information repeated over and over in its appropriate columns. E.g.: Department1...Employee1... Department1...Employee2... Department2...Employee3... But what the customer would like is to have each department render like a heading, with a list of employees beneath each. E.g.: - Department1... Employee1... Employee2... + Department2... I'm trying to do this by inheriting hierarchical objects from the autogenerated Row objects. E.g.: public class Department : DataSet.DepartmentRow { public List<Employee> Employees; } That way I could nest the data in the report by using a collection of Department objects as the DataSource, each of which will put its list of Employees in a subreport. The problem is that this gives me a The type Data.DataSet.DepartmentRow has no constructors defined error. And when I try to make a constructor, e.g. public class Department : DataSet.DepartmentRow { private Department() { } public List<Employee> Employees; } I get a 'Data.DataSet.DepartmentRow(System.Data.DataRowBuilder)' is inaccessible due to its protection level. error in addition to the first one. Is there a way to accomplish what I'm trying to do? Or is there something else I should be trying entirely?

    Read the article

  • Send A DataSet via Sockets in .NET

    - by FinancialRadDeveloper
    I had written a Web Service to return a DataSet back to my ASP.Net site and this was working fine. However due to security issues and also the ability to get certain references installed, I have to move this to an App Server and so doing it as a Windows Service and communicating with the ASP.Net site now via sockets. Is there a way I can easily give the Website a serialized DataSet via Sockets from my App Server so I can read this in and then just carry on using the code I currently have to bind this to a GridView?

    Read the article

  • Add an column to dataset in .net 1.1

    - by prince23
    hi, i have dataset(dataset name dsEmp) with an 25 columns , here i need to add an new column with columname as "EndDate" of data type as string now i need to import all the data from column18 whose datatype is Datetime to the newely created datacolumn "EndDate" once we import all the data from the column 18 to the newcolumn "EndDate" , we should remove the column18 hope my Question is clear, can any one please help me this.

    Read the article

  • dynamically updating a datagrid from a XML file c# 3.5

    - by Farstucker
    I have a datagrid that is populated via XML file when the form loads. Everything is working great but I would like the datagrid to update dynamically when a new order is received (Separate class receives a data stream and updates the file). Im looking for suggestions on how this should be done. (ie using a timer update every second, or monitor the file using FileSystemWatcher.. etc) Since where here, I might as well mention that in order to update the datagrid Im clearing the whole data set and Re-reading the file using: DataSet.Clear(); DataSet.ReadXml("file.xml"); dataGridView1.DataSource = DataSet; if this is not the proper approach, please offer any alternate suggestions.

    Read the article

  • C# Same DataSource + Multiple DataGridViews = Data Binding Issues?

    - by C. Griffin
    Here's what I'm doing: I have (2) DataGridView controls DGV #1 is bound to the DataSet, DGV #2 is bound to a DataView of the SAME DataSet Now, what I'm needing to accomplish here is this: When a user checks a boolean column on the original DGV, the second DGV should now display the newly checked row also. The context is that the first DGV is a master list, and the second one is a "favorite" view of the first. When I check the rows, the favorite column does NOT update. Do I need to use a DataAdapter to actually update the database, or can I operate directly on the DataSet (DataTable) -- or even with the Rows in the original DataGridView?

    Read the article

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