sql

How to get more than 1 line in Crystal Report by using DataSet ?

OpenConnect(); OleDbDataAdapter olda = new OleDbDataAdapter("Select * from RECORD where LIC_PLATE='GE 320'", con); DataSet dataset = new DataSet(); olda.Fill(dataset); cr1.SetDataSource(dataset.Tables[0]); crystalReportViewer1.ReportSource = cr1; crystalReportViewer1.Refresh(); ...

AJAX page + SQL query behaving vaguely ?!

I'll try my level best to describe the problem in words here since it's quite confusing. An 'sql' query gives no output, Through ajax page, when variables are passed in the query. Even the count of number of rows gives 0. So, I 'echoed' the same query which has the passed variables now having the values. When 'copy'-'pasted' the same (re...

C#/Linq combobox databinding

I'm working on a project where I'm using DataBindings to update certain fields based on currently selected field. I have a series of textBoxes which are databound to a combo box, which at present is currently linked to a table as a data source. However there is a relationship between the ID of two tables, meaning the combobox should be l...

I have a bunch of listings, I am trying to sort by featured and date in rails yet it's not working properly...

Let's say I have a listing a listing has a date and a featured (of true or false) How do I order my listings to order by featured = true first? Currently I have some listings as featured nil, then a few appeared as false - the ones that appeared as false are showing up before featured true. This makes sense because false is before tru...

Matching similar city names in SQL

I have a table "City" which contains city names, and I have a another table which I just created and contains cities from different sources. When I run a query to match the cities between the two tables I find about 5000 mismatches. So please give some queries which I can use to match cities (because sometimes users enter city names wi...

how can i analyze the results of the sql query : dbcc showcontig ?

how can i analyze the results of the sql query : dbcc showcontig to improve the performance of sql ...

SQlite: select into?

I'm not sure if I can use select into to import data from another table like this: select * into bookmark1 from bookmark; Is it true that SQlite doesn't support this syntax? are there any other alternatives? ...

mysql join table on itself

I am having problems with this and I'm hoping it's possible. I have a table from wordpress which stores post meta data, so the columns and field data cannot be changed (Easily). The table structure is thus post_id meta_key meta_value the meta key stores a field name and the meta_value, the value for that field. I need to group thes...

Plain SQL vs Dialects

DBMS Vendors use SQL dialect features to differentiate their product, at the same time claiming to support SQL standards. 'Nuff said on this. Is there any example of SQL you have coded that can't be translated to SQL:2008 standard SQL ? To be specific, I'm talking about DML (a query statement), NOT DDL, stored procedure syntax or anyth...

Why does not postgresql start returning rows immediately?

The following query returns data right away: SELECT time, value from data order by time limit 100; Without the limit clause, it takes a long time before the server starts returning rows: SELECT time, value from data order by time; I observe this both by using the query tool (psql) and when querying using an API. Questions/issues: ...

Checking for empty xml column

Next query runs successfully: select top(100) * from PackageSessionNodes where Cast(ContentInteractions as nvarchar) != '' Next gives me error Target string size is too small to represent the XML instance update PackageSessionNodes set ContentInteractions = '<contentinteractions />' where Cast(ContentInteractions as nvarchar) = '' ...

Slow response when querying a View - Using Linq to SQL

I have the following view: SELECT poHeader.No_ AS PONumber, poHeader.[Buy-from Vendor No_] AS VendorNumber, poHeader.[Document Date] AS DocumentDate, vendor.Name AS VendorName, vendor.Contact AS VendorContact, vendor.[E-Mail] AS VendorEmail, vendor.Address AS VendorAddress, vendor.[Address 2] AS VendorAddress2, vendor.City ...

Math with previous row in SQL, avoiding nested queries ?

Hi, I want to do some math on the previous rows in an SQL request in order to avoid doing it in my code. I have a table representing the sales of two entities (the data represented here is doesn't make much sense and it's just an excerpt) : YEAR ID SALES PURCHASE MARGIN 2009 1 10796820,57 266...

MYSQL moving information with php

I am wondering if it is possible to automate or by button press to move mysql table information from one table to another table deleting it from the first table and putting it in another table? Using php. My mysql table is big and the page that adds the information to that table has 70 query's on it which slows the page refresh times. ...

NSIS- Error handling

I have written an installer and uninstaller in NSIS which creates and drops an sql database, which is working fine. I have written some .bat and .sql files to create and drop the database and then just call these files from NSIS script. My problem is if I keep this database open in SQL Server Management Studio and run the uninstaller ide...

Why does NHibernate first insert and then update element of a collection?

I'm not sure if it's a correct behavior or something done wrong on my side: I've got a very simple parent-child relationship public class SubmittedBatch { public virtual Guid Id { get; set; } public virtual IList<SubmittedBatchParameter> Parameters { get; private set; } } public class SubmittedBatchParameter { public virtu...

Oracle SQL: How to read-and-increment a field

I'm refactoring the data import procedure for an enterprise application and came across a snippet I'd like to find a better solution. When importing data we have to create a unique entity for each data set and there is a counter in a field to be used to assign this id sequentially. You read the field to get the next free id and increment...

Query TFS database to fetch last 10 check-in details

Is there a way to query TFS database to get the last 10 check-in details The output should be something like File name | Comment | Changed By | Date ---------------------------------------------------------------------------- Test.cs Added new functionality username 01/08/2010 I ...

Nhibernate not returning right result sometime

Hi Guys, So here is my nhibernate query. I am just querying in database if there is latest entry by some number but with latest time stamp. So like if I have Row A 6 1/7/2010 2:55:59 PM Row B 6 1/7/2010 2:56:33 PM So According to the query it should return Row B but sometimes it is not happening. Can anyone point out the...

oracle stored procedures

how can I make oracle procedure with oracle xe, how can I check if input is valid or not? ex: if my input is number and I type in char that procedure prints out something in that case, I've dealt with SQL but not with these kind of procedures? any help is appreciated UPDATE This was a dummy example .. what I meant is to start from the ...