Search Results

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

Page 43/57 | < Previous Page | 39 40 41 42 43 44 45 46 47 48 49 50  | Next Page >

  • populate object graph from database

    - by Rama
    Hi, I would like to know the best way to populate an object that has a collection of child objects and each child object may inturn have a collection of objects, from database without making multiple calls to the database to get child objects for each object. basically in hierarchical format something like for example a customer has orders and each order has order items. is it best to retrieve the data in xml format (SQL server 2005), or retrieve a dataset by joining the related tables together and then map that the data to the object? thanks in advance for your help.

    Read the article

  • Address Validation API

    - by Paul
    I have a task to validate addresses entered into a system I am currently creating. The system requires that address entered are validated against a valid data source. In the UK the dataset comes from the Royal Mail and is expensive to access. The data needed is post code info for the whold of europe to start with accessed by an API into the web application. There are a number of companies that offer this service, QAS Capscan Postcode anywhere These all offer the service I require. However this is expensive and in some cases not a complete data set. e.g. not Ireland I was also wondering if there would be a way to utalis the google maps API to validate this data via postal code and country. Would the google maps method be possible or do I have to go down the line of one of these expensive companies? Any thoughts on what line I should take.

    Read the article

  • vs2010 Cache SQL data incorrect fields

    - by mickartz
    OK, I found a walkthrough on msdn for what I was after (offline database cache). However when I let the wizard create a local database from my online sql server the timespan fields are converted to a string?? Now I know the suggestion was to create my own local database and then use the MS Synch framework...however...this proclaims to do it "out of the box" However now I've a dataset which I've no idea how to use, and a database newly formed (for the synched cache) taht I will have to use Ling to Entities with(??) meanwhile I have this weird timespan to string conversion? should I give up now or push on? can i overwrite the the .designer.cs? typeof(string) to typeof(timespan)? damn wizards!!

    Read the article

  • Finding parents where child collection does not contain an item

    - by Colin Bowern
    I am trying to get a list of parents where the child collection does not contain an item of a specific type. The LINQ equivalent would be something like: dataset.Where(x => x.Items.FirstOrDefault(y => y.Type.Code == "ABC") == null) The object model is Parent Child (Items) Type Code If Parent is my aggregate root, how would I model this in NHibernate criteria/query? Here's my first attempt: var results = session.CreateCriteria<Parent>() .CreateCriteria("Items") .CreateCriteria("Type") .Add(Restrictions.Not(Restrictions.Eq("Code", "ABC"))) .SetResultTransformer(Transformers.DistinctRootEntity) .List<Parent>(); This doesn't seem to return the right entities - it just returns them all.

    Read the article

  • Quick way to do data lookup in PHP

    - by Ghostrider
    I have a data table with 600,000 records that is around 25 megabytes large. It is indexed by a 4 byte key. Is there a way to find a row in such dataset quickly with PHP without resorting to MySQL? The website in question is mostly static with minor PHP code and no database dependencies and therefore fast. I would like to add this data without having to use MySQL if possible. In C++ I would memory map the file and do a binary search in it. Is there a way to do something similar in PHP?

    Read the article

  • can rails send data to browser chunk by chunk?

    - by Nik
    Hello all, I have a very large dataset (100,000) to be display, but any browser I tried that on including chrome 5 dev, it make them choke for dozens of seconds (win7 64bit, 4gb, 256gb ssd, c2duo 2.4ghertz). I did a little experiment by some_controller.rb def show @data = (1..100000).to_a end show.html.erb <% @data.each do |d| % <%= d.to_s % <% end% as simple as that it chokes the browsers. I know browsers were never built for this, so I thought to let the data come in chunk by chunk, I guess 2000 per chunk is reasonable, but I wouldn't want to make 50 requests each time this view is called, any ideas? It doesn't have to be chunk by chunk if it can be sent all at once. Best,

    Read the article

  • how to add parameters with mulitselection enabled in ssrs 2008

    - by Sheikh Usman
    Hi, I have a table called Resource, and i am making a line chart (the chart is complicated, so just assume its a simple xy line chart). I want to execute the report with different resources. I have added a new parameter and bound it to a dataset to return a dropdownlist of resource names. Can i do a mulitiple selection of resource. for example if i want to make chart with ResourceA and ResourceB, only, can i select these two resources from the dropdownlist of parameters. cheers, Oz

    Read the article

  • Silverlight - Timeout Issue

    - by user70192
    Hello, I have a Silverlight 3 application that is querying a large dataset. This query is taking over one minute. After approx. one minute into the attempt, an error is getting logged into the event viewer that says: "Membership credential verification failed" Oddly queries that are taking shorter than 1 minute are running successfully. Because of this, I do not believe it is a "credential" issue, unless somehow it is expiring. But how do I set the expiration? I have no idea what else this could be. Thank you,

    Read the article

  • Parent-Child relation while using object data source

    - by Saba
    Hello guys I am experiencing with a class generator I've written, which generates a class for each table in database with each table field as a property and such. Before that, I used to add a typed dataset to the project and add some tables to it. It automatically detected the relationship between tables and when I added a parent table as data source of a datagrid, I could add another datagrid and use the foreing key data member of it's bindingsource to fill it, and when someone moved the focus on parent datagrid, the data in child datagrid would change accordingly. Now that I have my classes, I add an object as data source for my 2 datagrids, but obviously it doesn't detect a parent child relation. But It'd really help if I could have that foreign key relation in my object datasources. Is there any way to have that relation in object datasource?

    Read the article

  • Java or Python distributed compute job (on a student budget)?

    - by midget_sadhu
    I have a large dataset (c. 40G) that I want to use for some NLP (largely embarrassingly parallel) over a couple of computers in the lab, to which i do not have root access, and only 1G of user space. I experimented with hadoop, but of course this was dead in the water-- the data is stored on an external usb hard drive, and i cant load it on to the dfs because of the 1G user space cap. I have been looking into a couple of python based options (as I'd rather use NLTK instead of Java's lingpipe if I can help it), and it seems distributed compute options look like: Ipython DISCO After my hadoop experience, i am trying to make sure i try and make an informed choice -- any help on what might be more appropriate would be greatly appreciated. Amazon's EC2 etc not really an option, as i have next to no budget.

    Read the article

  • ADO.NET - DataRead Error

    - by user560706
    Hi, I am trying to display data from a column in my database onto my rich textbox, but I am getting mixed up between DataSet and DataReader - I know the majority of the code below is correct, I just get two lines containing errors, and I'm not sure why: // Create a connection string string ConnectionString = ("Provider=Microsoft.ACE.OLEDB.12.0;Data Source= C:\\Documents and Settings\\Harley\\Desktop\\Test.accdb"); string SQL = "SELECT * FROM Paragraph"; // create a connection object SqlConnection conn = new SqlConnection(ConnectionString); // Create a command object SqlCommand cmd = new SqlCommand(SQL, conn); conn.Open(); DataTable dt = new DataTable(); da.Fill(dt); //ERROR // Call ExecuteReader to return a DataReader SqlDataReader reader = cmd.ExecuteReader(); foreach(DataRow reader in dsRtn) //ERROR { richTextBox = richTextBox.Text + reader[0].ToString(); } //Release resources reader.Close(); conn.Close(); }

    Read the article

  • Using Assert to compare two objects

    - by baron
    Hi everyone, Writing test cases for my project, one test I need is to test deletion. This may not exactly be the right way to go about it, but I've stumbled upon something which isn't making sense to me. Code is like this: [Test] private void DeleteFruit() { BuildTestData(); var f1 = new Fruit("Banana",1,1.5); var f2 = new Fruit("Apple",1,1.5); fm.DeleteFruit(f1,listOfFruit); Assert.That(listOfFruit[1] == f2); } Now the fruit object I create line 5 is the object that I know should be in that position (with this specific dataset) after f1 is deleted. Also if I sit and debug, and manually compare objects listOfFruit[1] and f2 they are the same. But that Assert line fails. What gives?

    Read the article

  • Can you reuse a mysql result set in PHP?

    - by MarathonStudios
    I have a result set I pull from a large database: $result = mysql_query($sql); I loop through this recordset once to pull specific bits of data and get averages using while($row = mysql_fetch_array($result)). Later in the page, I want to loop through this same recordset again and output everything - but because I used the recordset earlier, my second loop returns nothing. I finally hacked around this by looping through a second identical recordset ($result2 = mysql_query($sql);), but I hate to make the same SQL call twice. Any way I can loop through the same dataset multiple times?

    Read the article

  • using subset but old variables still left

    - by user2520852
    I am working with a data set, which is basically daily usage data (let's just say variable X and Y) by different cities (about 150 cities). I have created a subset of data for only specific cities, choosing just 3 of the 150 cities. Then when I do tapply by cities, I get means for 3 cities but also get NA for all other 147 cities that was in the data set. I am using the below coding df<-read.csv(...) df_sub<-subset(df,df$City==1|df$City==3|df$City==19) X_Breakdown<-tapply(X,df_sub$City, mean, na.rm=TRUE) Print(X_Breakdown) City 1 City 2 15 NA City 3 City 4 12 NA City 5 City 6 NA NA Hope you get the idea. I would like to get a dataset that only contains the 3 cities that I'm interested in. It seems that the set of variables is encoded in R, is there a way to fix this? Kindly advise. Thanks

    Read the article

  • Implementing a runtime Look Up Table in C#

    - by Yarok
    Hey all, I'm currently working on a robot interface GUI, using C#. The robot has two sensors, and two powered wheels. I need to let the user the option to load a Look Up Table (LUT) during runtime, one for each sensor, that will tell the robot what to do according to the sensor's reading. I think the best way to do it is using a .csv file, formatted like so: index , right wheel order, left wheel order the index is an int between 0-1023 and is actually the sensor's reading. the orders for the right and left wheel are integers, between -500 - 500. Example - left sensor's readings: 1,10,20 meaning: sensor reads 1 -- left wheel 10 rpm right wheel 20 rpm So my question is this: what is the best way to implement it? using a dataset?(if so, how?) using an array? (if so, how do I load it during runtime?) Any help would be much appreciated, Yarok

    Read the article

  • CakePHP repeats same queries

    - by Rytis
    I have a model structure: Category hasMany Product hasMany Stockitem belongsTo Warehouse, Manufacturer. I fetch data with this code, using containable to be able to filter deeper in the associated models: $this->Category->find('all', array( 'conditions' => array('Category.id' => $category_id), 'contain' => array( 'Product' => array( 'Stockitem' => array( 'conditions' => array('Stockitem.warehouse_id' => $warehouse_id), 'Warehouse', 'Manufacturer', ) ) ), ) ); Data structure is returned just fine, however, I get multiple repeating queries like, sometimes hundreds of such queries in a row, based on dataset. SELECT `Warehouse`.`id`, `Warehouse`.`title` FROM `beta_warehouses` AS `Warehouse` WHERE `Warehouse`.`id` = 2 Basically, when building data structure Cake is fetching data from mysql over and over again, for each row. We have datasets of several thousand rows, and I have a feeling that it's going to impact performance. Is it possible to make it cache results and not repeat same queries?

    Read the article

  • ReportViewer datadinding (WPF)

    - by user512150
    I have a rdlc file and I try to show it using report viewer control in WPF. My DataSource is called 'OfficeDataSet' and DataSet used in report is called 'Address'. I try to initialize report viewer (I put it in WindowsFormsHost) like this: private void PrepareReport() { reportDataSource = new ReportDataSource(); officeDataSet = new OfficeDataSet(); adapter = new AddressTableAdapter(); adapter.Fill(officeDataSet.Address); reportDataSource.Name = "OfficeDataSet_Address"; reportDataSource.Value = officeDataSet.Address; viewerInstance.LocalReport.DataSources.Add(reportDataSource); viewerInstance.LocalReport.ReportEmbeddedResource = "WpfApplication1.Reports.TestReport.rdlc"; viewerInstance.Location = new System.Drawing.Point(0, 0); viewerInstance.RefreshReport(); } but I got the message "A data source instance has not been supplied for the data source 'Address'". Anybody know what can be wrong with this code? (I'm totally new in WPF and Reporting Services).

    Read the article

  • MYSQL, Subquery Reference in Union

    - by christian
    Is there any way to reference a subquery in a union? I am trying to do something like the following, and would like to avoid a temporary table, but the subquery will be drawn from a much larger dataset so it makes sense to only do it once.. SELECT * FROM (SELECT * FROM ads WHERE state='FL' AND city='Maitland' AND page='home' ORDER BY RAND()) AS sq WHERE spot = 'full-banner' LIMIT 1 UNION SELECT * FROM sq WHERE spot = 'leaderboard' LIMIT 1 UNION SELECT * FROM sq WHERE spot = 'rectangle1' LIMIT 1 UNION SELECT * FROM sq WHERE spot = 'rectangle2' LIMIT 1 .... etc,, It's a shame that DISTINCT can't be specified for a single column of a result set.

    Read the article

  • What are some Servlet Container pros and cons for a Solr installation?

    - by danieltalsky
    The SolrInstall wiki page lists seven different server / Servlet Containers compatible with Solr: Tomcat Jetty Resin JBoss WebSphere Weblogic Glassfish I'm sure that "best" is subjective, so I'll just say my criteria are: easiest to set up, best for search performance with a smallish, infrequently-updated dataset, and with the fewest number of gotchas. Jetty and Tomcat both have apt-get solr packages, so they're clearly the frontrunners for some. Jetty is used in the demo install, but there's some notes that Jetty has some difficulties handling Unicode in some cases. Tomcat is a common choice but my understanding is that it's not as lightweight and has a lot of features not needed by Solr. Is it worth considering any of the others? Are there some important pro's and cons I should be aware of?

    Read the article

  • Plotting Tweets from DB in Ruby, grouping by hour.

    - by plotti
    Hey guys I've got a couple of issues with my code. I was wondering that I am plotting the results very ineffectively, since the grouping by hour takes ages the DB is very simple it contains the tweets, created date and username. It is fed by the twitter gardenhose. Thanks for your help ! require 'rubygems' require 'sequel' require 'gnuplot' DB = Sequel.sqlite("volcano.sqlite") tweets = DB[:tweets] def get_values(keyword,tweets) my_tweets = tweets.filter(:text.like("%#{keyword}%")) r = Hash.new start = my_tweets.first[:created_at] my_tweets.each do |t| hour = ((t[:created_at]-start)/3600).round r[hour] == nil ? r[hour] = 1 : r[hour] += 1 end x = [] y = [] r.sort.each do |e| x << e[0] y << e[1] end [x,y] end keywords = ["iceland", "island", "vulkan", "volcano"] values = {} keywords.each do |k| values[k] = get_values(k,tweets) end Gnuplot.open do |gp| Gnuplot::Plot.new(gp) do |plot| plot.terminal "png" plot.output "volcano.png" plot.data = [] values.each do |k,v| plot.data << Gnuplot::DataSet.new([v[0],v[1]]){ |ds| ds.with = "linespoints" ds.title = k } end end end

    Read the article

  • how to find datakeys in oncheckedchanged event ?

    - by subodh
    <asp:Panel ID="pnlFocusAreaPanel" runat="server" GroupingText="Focus Area" Width="800"> <table cellspacing="0" cellpadding="0" width="750"> <tr> <td> <asp:GridView ID="dgFocusAreaDetails" runat="server" Width="100%" CssClass="dgStyle" AutoGenerateColumns="False" BorderColor="Silver" BorderWidth="1px" CellPadding="0" ShowHeader="False" OnSelectedIndexChanged="dgFocusAreaDetails_SelectedIndexChanged" DataKeyNames="PK_ID"> <FooterStyle Font-Underline="True" HorizontalAlign="Center" VerticalAlign="Middle"> </FooterStyle> <Columns> <asp:TemplateField HeaderText="Focus Area" HeaderStyle-BackColor="Silver"> <ItemStyle Width="90%" /> <ItemTemplate> <asp:Label runat="server" ID="lblFocusArea" Text='<%# DataBinder.Eval(Container.DataItem, "FOCUS_AREA_NAME").ToString()%>'> </asp:Label> </ItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="Is Current Valid" HeaderStyle-BackColor="Silver"> <ItemStyle Width="10%" HorizontalAlign="Center" /> <ItemTemplate> <asp:CheckBox ID="chkFocusArea" runat="server" OnCheckedChanged="OnCheckChangedEvent" AutoPostBack="true" /> </ItemTemplate> </asp:TemplateField> </Columns> </asp:GridView> </td> </tr> <tr> <td align="left"> <asp:TextBox ID="txtFocusArea" runat="server" Width="300px" CausesValidation="true" CssClass="txtStyle" ValidationGroup="focusArea"> </asp:TextBox> <cc1:TextBoxWatermarkExtender ID="txtFocusAreaWaterMark" runat="server" TargetControlID="txtFocusArea" WatermarkText="Add Focus Area" WatermarkCssClass="WaterMarkStyle"> </cc1:TextBoxWatermarkExtender> <asp:Button ID="btnAddFocusArea" runat="server" Text="AddFocusArea" CssClass="btnStyle" OnClick="btnAddFocusArea_Click" CausesValidation="true" ValidationGroup="focusArea" /> <asp:RequiredFieldValidator ID="reqtxtFocusArea" runat="server" ControlToValidate="txtFocusArea" ErrorMessage="Please enter focus area" Display="Dynamic" ValidationGroup="focusArea"> </asp:RequiredFieldValidator> <asp:RegularExpressionValidator ID="regexFocusArea" runat="server" ErrorMessage="Invalid characters(<,>,#)" ControlToValidate="txtFocusArea" ValidationExpression="^([^&lt;#&gt;]*)$" ValidationGroup="focusArea" Display="Dynamic" SetFocusOnError="true"> </asp:RegularExpressionValidator> </td> </tr> </table> </asp:Panel> and in code behind protected void btnAddFocusArea_Click(object sender, EventArgs e) { string strFocusArea = txtFocusArea.Text; OleDbConnection myConnection = new OleDbConnection(ConfigurationSettings.AppSettings["SQLConnectionString"]); if (strFocusArea == string.Empty || strFocusArea == txtFocusAreaWaterMark.WatermarkText) { lblError.Text = "Focus area is not entered"; } else { string insertQuery = "INSERT INTO LK_CODECAT_FOCUS_AREA(FOCUS_AREA_NAME,FK_ADDED_BY,ADDED_ON) "+ " VALUES('" + strFocusArea + "', "+Session["UserID"] +", GETDATE())"; try { myConnection.Open(); OleDbCommand myCommandToInsert = new OleDbCommand(insertQuery, myConnection); myCommandToInsert.ExecuteNonQuery(); } catch(Exception exc) { ExceptionLogger.LogException(exc); } finally { if (myConnection != null) { myConnection.Close(); } } PopulateFocusArea(); } txtFocusArea.Text = txtFocusAreaWaterMark.WatermarkText; } private void PopulateFocusArea() { OleDbConnection myConnection = new OleDbConnection(ConfigurationSettings.AppSettings["SQLConnectionString"]); string selectQuery = "SELECT PK_ID, FOCUS_AREA_NAME, IS_CURRENT_FOCUS FROM LK_CODECAT_FOCUS_AREA LKCFA ORDER BY FOCUS_AREA_NAME"; if (Session["RoleID"].ToString() == "1" || ((Session["WorkID"].ToString() != "9") || (Session["WorkID2"].ToString() != "9") || (Session["WorkID3"].ToString() != "9"))) { try { myConnection.Open(); OleDbCommand myCommandFocusArea = new OleDbCommand(selectQuery, myConnection); OleDbDataAdapter myAdapter = new OleDbDataAdapter(myCommandFocusArea); DataSet ds = new DataSet(); myAdapter.Fill(ds); dgFocusAreaDetails.DataSource = ds; dgFocusAreaDetails.ShowHeader = true; dgFocusAreaDetails.DataBind(); } catch (Exception exc) { ExceptionLogger.LogException(exc); } finally { if (myConnection != null) { myConnection.Close(); } } } } protected void dgFocusAreaDetails_SelectedIndexChanged(object sender, EventArgs e) { string selectedCategory = dgFocusAreaDetails.SelectedRow.Cells[1].Text; int index = dgFocusAreaDetails.SelectedIndex; lblError.Text = dgFocusAreaDetails.DataKeys[index].Value.ToString(); } public void OnCheckChangedEvent(object sender, EventArgs e) { CheckBox chk = (CheckBox)sender; string chkfocusarea = ((Control)chk).ID; //string focusAreaDetails = dgFocusAreaDetails.SelectedRow.Cells[0].Text; int index =Convert.ToInt32(dgFocusAreaDetails.SelectedIndex); if (chk.Checked) { string updateQuery = "UPDATE [LK_CODECAT_FOCUS_AREA] SET [IS_CURRENT_FOCUS] = 1 WHERE PK_ID = " +Convert.ToInt32( dgFocusAreaDetails.DataKeys[index].Value)+" "; } else { lblError.Text = "unchecked"; } } i want to know how i find the datakeyvalue on checked event.

    Read the article

  • Reporting Services Linear Gauge Scale

    - by lnediger
    I have set up a linear gauge in Reporting Services 2008. What I would like to do is specify my scale interval. The only problem with this is the scale intervals I would like to use are not at constant intervals. For example, say the scale min is $0 and the scale max is $10 000. Depending on the chart I may want an interval marker labelled at $2000, $5000, then $7945. These numbers would be calculated based on percentages of scale max specified in the dataset. I have not been able to figure out how I would go about doing this.

    Read the article

  • How to bind data in silverlight? In case I don't know which columns would be retrieved from database

    - by kwon
    I am trying to bind data from database to datagrid in silverlight. When I get typed data from DB, it is no problem since I use List<'EntityObject' collection object for example. However, sometimes I need data which I won't be able to know how many and what columns will be generated in design time. In this case, I cannot use typed collection like List<'EntityObject'. In addition, it is not able to use DataSet in silverlight. So, in this case and situation, how to solve this kind of problem? Thanks in advance Kwon

    Read the article

  • Archiving Database Tables using Java

    - by HonorGod
    My application demands archiving database tables between sybase and db2 and vice-a-versa and within(db2 to db2 and sybase to sybase) using java. I am trying to understand the best strategies around in terms performance, implementation, ease of use and scalability. Here is my current process - source and destination tables with the acceptable parameters (from java) are defined within xml. the application reads the source and destination configurations and execute them sequentially. destination is sometime optional when source is just deleting data from a specific table or when the source is just calling a stored procedure. dataset between source and destination is extremely large (in millions) From top of my head, it looks like I can define dependencies between multiple source and destination combination and have them execute in parallel in multiple treads. But will this improve any performance(i hope it will)? Are there any open-source frameworks for data archiving using java? Any other thoughts on the implements side will be really helpful. Thanks

    Read the article

  • SSRS - Checking whether the data is null

    - by NLV
    Hello I've the following expression in my report. =FormatNumber(MAX(Fields!Reading.Value, "CellReading_Reading"),3) Now when the dataset is empty 'Fields!Reading.Value' becomes empty and finding their maximum is invalid. How can i check if the entire column is empty? I tried the following with no luck. =iif(IsNothing(Fields!.Reading.Value),"",FormatNumber(MAX(Fields!Reading.Value, "CellReading_Reading"),3)) But still i'm getting #Error in the report. I also checked out link and was not able to get a clue from it. I want to handle it in the report level. Thank you. NLV

    Read the article

< Previous Page | 39 40 41 42 43 44 45 46 47 48 49 50  | Next Page >