Search Results

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

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

  • SqlDateTime overflow thrown by Typed DataSet Insert

    - by end-user
    I'm using a Typed DataSet with an Insert statement; I have a table that has a smalldatetime field defined to accept null values. When I insert from a .NET 2.0 FormView, I get a "SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM." Now, I've read this post, and the parameter as sent to the class constructor is defined as global::System.Nullable<global::System.DateTime> DoB So, it looks like it should accept a Nullable obj. Additionally, the generated code is testing the value sent. if ((DoB.HasValue == true)) { command.Parameters[6].Value = ((System.DateTime)(DoB.Value)); } else { command.Parameters[6].Value = global::System.DBNull.Value; } Specifically, the error is occurring when generated SqlClient.SqlCommand.ExecuteScalar() runs: try { returnValue = command.ExecuteScalar(); } So, I guess my question is: how do I use a Typed DataSet to set a blank value (passed from a FormView on CommandName=Insert) to a null in a database?

    Read the article

  • C# winforms: DataSet with multiple levels of related tables

    - by Jake
    Hi, I am trying to use DataSet and DataAdapter to "filter" and "navigate" DataRows in DataTables. THE SITUATION: I have multiple logical objects, e.g. Car, Door and Hinge. I am loading a Form which will display complete Car information including each Door and their respective Hinges. In this senario, The form should display info for 1 car, 4 doors and 2 hinges for each door. Is it possible to use a SINGLE DataSet to navigate this Data? i.e. 1 DataRow in car_table, 4 DataRow in door_table and 8 DataRow in hinge_table, and still be able to navigate correctly between the different object and their relations? AND, able to DataAdapter.Update() easily? I have read about DataRelation but don't really understand how to use it. Not sure if it is the correct direction for my problem. Appreciate any advise. Thanks!

    Read the article

  • Problem with filling dataset

    - by Brian
    This is a small portion of my code file. Each time my debugger reaches the line 'NewDA.Fill(NewDS);' at runtime it jumps to the catch. I'm positive the daynumber variable gets a value that's present in the database and I've tried the query outside of the codefile on my database and it works fine. I'm also using the connectionstring 'db' on more parts of the code with successful results. string QueryNew = "SELECT activityname AS [Name], activitycategorynumber AS [Category] " + "FROM ACTIVITY WHERE daynumber = @daynumber"; SqlCommand NewCmd = new SqlCommand(QueryNew, db); NewCmd.Parameters.Add("@daynumber", SqlDbType.Int).Value = daynumber; SqlDataAdapter NewDA = new SqlDataAdapter(NewCmd); DataSet NewDS = new DataSet(); NewDA.Fill(NewDS);

    Read the article

  • C# SqlDataAdapter not populating DataSet

    - by Wesley
    I have searched the net and searched the net only to not quite find the probably I am running into. I am currently having an issue getting a SqlDataAdapter to populate a DataSet. I am running Visual Studio 2008 and the query is being sent to a local instance of SqlServer 2008. If I run the query itself in SqlServer, I do get information. Code is as follows: string theQuery = "select Password from Employees where employee_ID = '@EmplID'"; SqlDataAdapter theDataAdapter = new SqlDataAdapter(); theDataAdapter.SelectCommand = new SqlCommand(theQuery, conn); theDataAdapter.SelectCommand.Parameters.Add("@EmplID", SqlDbType.VarChar).Value = "EmployeeName"; theDataAdapter.Fill(theSet); The code to read the dataset: foreach (DataRow theRow in theSet.Tables[0].Rows) { //process row info } If there is any more info I can supply please let me know.

    Read the article

  • Dataset and Hierarchial Data How to Sort

    - by mdjtlj
    This is probably a dumb question, but I've hit a wall with this one at this current time. I have some data which is hierarchial in nature which is in an ADO.NEt dataset. The first field is the ID, the second is the Name, the third is the Parent ID. ID NAME Parent ID 1 Air Handling NULL 2 Compressor 1 3 Motor 4 4 Compressor 1 5 Motor 2 6 Controller 4 7 Controller 2 So the tree would look like the following: 1- Air Handling 4- Compressor 6 - Controller 3 - Motor 2- Compressor 7- Controller 5 - Motor What I'm trying to figure our is how to get the dataset in the same order that ths would be viewed in a treeview, which in this case is the levels at the appropriate levels for the nodes and then the children at the appropriate levels sorted by the name. It would be like binding this to a treeview and then simply working your way down the nodes to get the right order. Any links or direction would be greatly appreciated.

    Read the article

  • Casting complex class into a dataset?

    - by iTayb
    This is the class I'm trying to turn into a dataset: public class BookStore { private List<Book> booksList; } public class Book { private string name; private string imageurl; private string subject; private string author; private int level; private int year; private int rating; private List<string> booksellers; private List<decimal> bookprices; } There are proprieties, of course. How can I turn it into a dataset? Thank you very much.

    Read the article

  • search dataset from xml file

    - by Anelim
    Hi, I need to filter the results I obtain when I load my xml file. For example I need to search the xml data for items with keyword "Chemistry" for example. The below xml example is a summary of my xml file. The data is loaded in a gridview. Could you help? Thanks! Xml File (summary): <CONTRACTS> <CONTRACT> <CONTRACTID>779</CONTRACTID> <NAME>ContractName</NAME> <KEYWORDS>Chemistry, Engineering, Chemical</KEYWORDS> <CONTRACTSTARTDATE>1/8/2005</CONTRACTSTARTDATE> <CONTRACTENDDATE>31/7/2008</CONTRACTENDDATE> <COMMODITIES><COMMODITY><COMMODITYCODE>CHEM</COMMODITYCODE> <COMMODITYNAME>Chemicals</COMMODITYNAME></COMMODITY></COMMODITIES> </CONTRACT></CONTRACTS> My code behind code is: Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Dim ds As DataSet = New DataSet() ds.ReadXml(AppDomain.CurrentDomain.BaseDirectory + "/testxml.xml") Dim dtContract As DataTable = ds.Tables(0) Dim dtJoinCommodities As DataTable = ds.Tables(1) Dim dtCommodity As DataTable = ds.Tables(2) dtContract.Columns.Add("COMMODITYCODE") dtContract.Columns.Add("COMMODITYNAME") Dim count As Integer = 0 Dim commodityCode As String = Nothing Dim commodityName As String = Nothing Dim dRowJoinCommodity As DataRow Dim trimChar As Char() = {","c, " "c} Dim textboxstring As String = "KEYWORDS like 'pencil'" For Each dRow As DataRow In dtContract.Select(textboxstring) commodityCode = "" commodityName = "" count = dtContract.Rows.IndexOf(dRow) dRowJoinCommodity = dtJoinCommodities.Rows(count) For Each dRowCommodities As DataRow In dtCommodity.Rows If dRowCommodities("COMMODITIES_Id").ToString() = dRowJoinCommodity("COMMODITIES_ID").ToString() Then commodityCode = commodityCode + dRowCommodities("COMMODITYCODE").ToString() + ", " commodityName = commodityName + dRowCommodities("COMMODITYNAME").ToString() + ", " End If Next commodityCode = commodityCode.TrimEnd(trimChar) commodityName = commodityName.TrimEnd(trimChar) dRow("COMMODITYCODE") = commodityCode dRow("COMMODITYNAME") = commodityName Next GridView1.DataSource = dtContract GridView1.DataBind() End Sub

    Read the article

  • Dynamic Connection Strings for Strongly Typed DataSet in a Class Library using App.Config

    - by Luc
    This is my first question on StackOverflow.com and I'm not sure if this is the correct way to do this. I found a similar question titled: Modifying the Data Source for the Strongly Typed Dataset Connection String. However, the answer provided is not working for me. I'm not able to comment on it because I don't have enough "reputation points" (again, I just signed up), and I didn't want to provide an "answer", because I don't know the correct answer. My problem is that I need to be able to modify the connection string inside the generated myproject.dll.config file, but doing so has no effect for me at all. My library still uses the default connection string that was setup at design time. I've tried everything I know to try, but still no luck. I've tried working around the issue using multiple different approaches, but still the problem persists. I can't find any help on the internet with my specific problem either. It would be great if somebody could shed some light as to why my modified config file isn't being read. Useful information: I'm using a Strongly Typed DataSet I don't know the actual connection string at design time. The app.config doesn't allow me to specify a 'User' scoped connection string. I'm tied to a class library (no Windows Forms) Thank you for any help! Luc

    Read the article

  • Building a custom (dynamic) dataset and grid

    - by marko.ivanovski.nz
    Hi, I'm in the process of building a dynamic table in which you can add/remove rows & columns so it varies in size depending on what the user wants. Its purpose is to store properties for a product, but there can be from 1 to 10 different properties(columns) per product, and multiple instances(rows) of the product as well. Here's a screenshot of what I mean http://i40.tinypic.com/nbqkxc.jpg As you can see I need the structure to be completely up to the client which is where I'm getting stuck. I've started writing a custom DataSet that has "add column" & "add row" buttons, and have built a custom Table with Textboxes in each cell which builds from that dataset. I have no idea how to store the data on submit though, and to make it even more complex I need to store this in the database as a string which I think I can do by converting it to XML. Any help is appreciated, I think I just need a pointer in the right direction and am happy to do research from there. Thanks in advance. Marko

    Read the article

  • Convert XML to DataSet with rows

    - by lidermin
    Hi, I have an xml file like this: <result> <customer> <id>1</id> <name>A</name> </customer> <customer> <id>2</id> <name>B</name> </customer> </result> So I need that data filled on a DataSet, here is my code: var reader = new StringReader(xmldoc.InnerXml); dsDatos.ReadXml(reader); The problem is that it's filling the dataset with two Tables each one with a single row. But I need a single Table with the two rows. What am I doing wrong? PD: I'm using C# and I don't want to iterate through the XML file, I want to use the ReadXml method. Thanks for your time.

    Read the article

  • DataReader-DataSet Hybrid solution

    - by G33kKahuna
    My solution architects and I have exhausted both pure Dataset and Datareader solutions. Basically we have a Microsoft.NET 2.0 windows service application that pulls data based on a query and processes additional tasks per record; almost a poor mans workflow system. The recordsets are broader (in terms of the columns) and deeper (in terms of number of records). We observed that DataSet performs much better in terms of performance but runs into contraints as # of records increase say 100K+ we start seeing System.OutOfMemoryException on a 4G machine with processModel configured to run at memoryLimit set to 85. Since this is a multi-threaded app, there could be multiple threads processing different queries and building different DataSets, so we run into the exception sooner in that case DataReader on the other hand works but is a lot slower and hits other contraints; if there is some sort of disconnect it has to start over again or leaves open connections on the DB side and worst case takes down the service completely etc. So, we decided the best option would be some sort of hybrid solution. I'm open to guidance and suggestions. Are there any hybrid solutions available? Any other suggestions

    Read the article

  • updating dataset using join and bindingsource?

    - by netadictos
    Hi, I have created a dataset and in the designer I have created the relations and foreign keys that exist in the database. Basically, I have a product that has a relationship to a table of prices. The keyfield they share is IdProduct in the Prices table. In the Fill/Get of the product I return the Price field. I also have a DataGrid that uses a BindingSource which uses this table. Everything displays correctly and when I double click on a row within the datagrid I then open up a tabbed form that contains a detailed view of the record selected. The user at this point is able to make changes to the record and they are properly propogated back to the BindingSource. The problem is that the TableAdapter does not contain the appopriate update, therefore I am not able to call the TableAdapter.Update method with the dataset as I would had I created a tableadapter not using a join. How am I best to handle this situation. At the same time I cannot get any modified row: dTiendasDs.ProductosDataTable modified = (dTiendasDs.ProductosDataTable) dTiendasDs.Productos.GetChanges(DataRowState.Modified); modified is always null Thanks,

    Read the article

  • subset complete or balance dataset in r

    - by SHRram
    I have a dataset that unequal number of repetition. I want to subset a data by removing those entries that are incomplete (i.e. replication less than maximum). Just small example: set.seed(123) mydt <- data.frame (name= rep ( c("A", "B", "C", "D", "E"), c(1,2,4,4, 3)), var1 = rnorm (14, 3,1), var2 = rnorm (14, 4,1)) mydt name var1 var2 1 A 2.439524 3.444159 2 B 2.769823 5.786913 3 B 4.558708 4.497850 4 C 3.070508 2.033383 5 C 3.129288 4.701356 6 C 4.715065 3.527209 7 C 3.460916 2.932176 8 D 1.734939 3.782025 9 D 2.313147 2.973996 10 D 2.554338 3.271109 11 D 4.224082 3.374961 12 E 3.359814 2.313307 13 E 3.400771 4.837787 14 E 3.110683 4.153373 summary(mydt) name var1 var2 A:1 Min. :1.735 Min. :2.033 B:2 1st Qu.:2.608 1st Qu.:3.048 C:4 Median :3.120 Median :3.486 D:4 Mean :3.203 Mean :3.688 E:3 3rd Qu.:3.446 3rd Qu.:4.412 Max. :4.715 Max. :5.787 I want to get rid of A, B, E from the data as they are incomplete. Thus expected output: name var1 var2 4 C 3.070508 2.033383 5 C 3.129288 4.701356 6 C 4.715065 3.527209 7 C 3.460916 2.932176 8 D 1.734939 3.782025 9 D 2.313147 2.973996 10 D 2.554338 3.271109 11 D 4.224082 3.374961 Please note the dataset is big, the following may not a option: mydt[mydt$name == "C",] mydt[mydt$name == "D", ]

    Read the article

  • Importing a large dataset into a database

    - by peaceful
    I'm a beginning programmer in the relevant areas to this question, so if possible, it'd be helpful to avoid assuming I know a lot already. I'm trying to import the OpenLibrary dataset into a local Postgres database. After it's imported, I plan to use it as a starting seed for a Ruby on Rails application that will include information on books. The OpenLibrary datasets are available here, in a modified JSON format: http://openlibrary.org/dev/docs/jsondump I only need very basic information for my application, much less than what is provided in the dumps. I'm only trying to get out book titles, author names, and relationships between books and authors. Below are two typical entries from their dataset, the first for an author, and the second for a book (they seem to have an entry for each edition of a book). The entries seem to lead off with a primary key, and then with a type, before including the actual JSON database dump. /a/OL2A /type/author {"name": "U. Venkatakrishna Rao", "personal_name": "U. Venkatakrishna Rao", "last_modified": {"type": "/type/datetime", "value": "2008-09-10 08:44:01.978456"}, "key": "/a/OL2A", "birth_date": "1904", "type": {"key": "/type/author"}, "id": 99, "revision": 3} /b/OL345M /type/edition {"publishers": ["Social Science Research Project, Dept. of Geography, University of Dacca"], "pagination": "ii, 54 p.", "title": "Land use in Fayadabad area", "lccn": ["sa 65000491"], "subject_place": ["East Pakistan", "Dacca region."], "number_of_pages": 54, "languages": [{"comment": "initial import", "code": "eng", "name": "English", "key": "/l/eng"}], "lc_classifications": ["S471.P162 E23"], "publish_date": "1963", "publish_country": "pk ", "key": "/b/OL345M", "authors": [{"birth_date": "1911", "name": "Nafis Ahmad", "key": "/a/OL302A", "personal_name": "Nafis Ahmad"}], "publish_places": ["Dacca, East Pakistan"], "by_statement": "[by] Nafis Ahmad and F. Karim Khan.", "oclc_numbers": ["4671066"], "contributions": ["Khan, Fazle Karim, joint author."], "subjects": ["Land use -- East Pakistan -- Dacca region."]} The size of the uncompressed dumps are enormous, about 2GB for the authors list, and 18GB for the book editions list. OpenLibrary does not provide any tools for this themselves, they provide a simple unoptimized Python script for reading in sample data (which unlike the actual dumps comes in pure JSON format), but they estimate if that was modified for use on their actual data it would take 2 months (!) to finish loading the data. How can I read this into the database? I assume I'll need to write a program to do this. What language and any guidance on how I should do it to finish in a reasonable amount of time? The only scripting language I have any experience with is Ruby.

    Read the article

  • Dataset and SQLCe in .net 4

    - by Tyler Edwards
    I'm trying to build a SQLCe table structure dynamically using a dataset as the temporary table structure... Is there a SqlConnection string that will work with SqlCe? There used to be a SqlCeConnection...but I don't find that in the 4.0 framework? Has something replaced this? If the answer is L2S or Entity Framework...can I add columns to SqlCe tables at runtime? If so...how?

    Read the article

  • Transfer DataReader rows to a CrystalReport DataSet

    - by lennie
    Please help me as I am a newbie using VB.NET. I have been asked to transfer rows from a DataReader into a Crystal Report dataset. Here are the coding: Private Sub BtnTransfer() dim strsql as string = "Select OrderID, OrderDate from ORDERS" dim DS as new dataset1 '<---crysal report dataset1.xsd dim DR as SqlDataReader dim RW as DataRow = DS.Tables(0).NewRow sqlconn = new sqlconnection(ConnString) sqlcmd = new sqlCommand(strSql, sqlconn) sqlcmd.Connection.open() DR = sqlcmd.ExecuteReader(CommandBehaviour.CloseConnection) Do while DR.Read RW("OrderID") = DR("OrderID") RW("OrderDate") = DR(OrderDate") DS.Tables(0).Rows.ADD(RW) Loop End sub

    Read the article

  • Dataset to Database

    - by user181421
    Hello, I'm working with framework 2.0. I have a dataset with many rows that were entered by the user and I need to write them to the database. What is the right way to do it? TY

    Read the article

  • DataSet v/s Database

    - by Hemanshu Bhojak
    While designing applications it is a very good practice to have all the business logic in one place. So why then we sometimes have the business logic in stored procs? Can we fetch all data from the DB and store it in a DataSet and then process it? What would be the performance of the app in this scenario?

    Read the article

  • Read xml file and import only one table from multiple tables from xml file in the dataset at a time.

    - by Harikrishna
    I want to store the data in the xml file and retrieve the data from that. I have defined more than table in that xml file.Now to read the tables I am using dataset ds = new dataset(); ds.ReadXml(xmlfilepath); Now this dataset contains all the tables those are in xml file when we read the xml file into dataset. But I want only one specified table at a time in a dataset by condition. Like there are PersonalInfo,OtherInfo,PropertiesInfo tables in the xml file. But I want only OtherInfo table in dataset what I should do ?

    Read the article

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