Hi, I'm looking for doing a Pivot Table query in vb.net.
I've found a lot of code in c# but not in VB.Net and i don't understand how to convert c# to VB.
Can you help me?
Thanks
Ju
I want to write a query like this:
SELECT o.OrderId, MAX(o.NegotiatedPrice, o.SuggestedPrice)
FROM Order o
But this isn't how the MAX function works, right? It is an aggregate function so it expects a single parameter and then returns the MAX of all rows. Does anyone know how to do it my way?
Hi.
I'm using sql plus to execute a query (a select) and dump the result into a file, using spool option.
I have about 14 millions lines, and it takes about 12 minutes to do the dump.
I was wondering if there is something to make the dump faster?
Here below my sql plus options:
whenever sqlerror exit sql.sqlcode
set pagesize 0
set linesize 410
SET trimspool ON
set heading on
set feedback off
set echo off
set termout off
spool file_to_dump_into.txt
select * from mytable;
Thanks.
In the following model:
class header(models.Model):
title = models.CharField(max_length = 255)
created_by = models.CharField(max_length = 255)
def __unicode__(self):
return self.id()
class criteria(models.Model):
details = models.CharField(max_length = 255)
headerid = models.ForeignKey(header)
def __unicode__(self):
return self.id()
class options(models.Model):
opt_details = models.CharField(max_length = 255)
headerid = models.ForeignKey(header)
def __unicode__(self):
return self.id()
If there is a row in the database for table header as
Id=1, title=value-mart , createdby=CEO
How do i query criteria and options tables to get all the values related to header table
id=1
Also can some one please suggest a good link for queries examples,
Thanks..
Is this a correct way for id generation in MySQL ?
INSERT INTO Picture
(PictureId,First_pick,Title,Description,File_Name,Is_Vertical)VALUES
((SELECT max(pictureid)+1 FROM Picture),0,?,?,?,?)
I mean if it is guaranted that PictureId will be unique when this query is run by many threads ?
I can't modify table structure. Should I use any specific locks, index or transaction isolation level ?
Regards, Michal
After processing form from POST I should redirect, to prevent user from hitting back. However, I am using form to determine search query on a database, so I need to either pass params to the redirected site or the result of a search. Or maybe there is some other good practice, how to solve this problem? Maybe in this situation I am allowed not to redirect (nothing happens, if user performs search again).
I have a polymorphic association (Class Table Inheritance) and I need use DQL to query entities of a specific child class wich can be done using "x INSTANCE OF Entity" in WHERE clause. Now I need to put conditions specific for that child class but I get this error:
"Class Person has no association named student_field_1"
Person = Parent Class
Employee = Child class
Student = Child class
is there any way yo cast of somehow tell Doctrine that the Person is actually a Student and to allow me to put Student fields in the WHERE?
Hi ,
Suppose I have a page abc.aspx in it I have a user control ucx123.ascx. I am fragment caching the user control and the cache is vary by param. The parameter is some id in the querystring.
I want to add a sql cache dependency with respect to sql query.
The scenario is I added the dependency but the cache is not invalidating
does anyone tried doing cache for spring-ntlm NtlmProcessingFilter.java file so that every request no need to query from microsoft active directory to authenticate user ? how to implement such cache using ehcache
I have a perl script, which takes a query string parameter, connects to a database and displays data.
I'd like to include that script in a PHP file like so:
include('perlscript.pl?item=302');
Such that the perl script's response is displayed on the PHP/HTML page.
How can I do this?
I have this query:
SELECT mt.*, fordon.*, boende.*, elektronik.*, business.*, hem_inredning.*, hobby.*
FROM classified mt
LEFT JOIN fordon ON fordon.classified_id = mt.classified_id
LEFT JOIN boende ON boende.classified_id = mt.classified_id
LEFT JOIN elektronik ON elektronik.classified_id = mt.classified_id
LEFT JOIN business ON business.classified_id = mt.classified_id
LEFT JOIN hem_inredning ON hem_inredning.classified_id = mt.classified_id
LEFT JOIN hobby ON hobby.classified_id = mt.classified_id
ORDER BY modify_date DESC
I need to implement a count here, to just count all rows in combination with the JOINS you see.
How should I do this?
SELECT COUNT(mt.*, fordon.* etc) FROM ? // This method wont work
Thanks
i have a query
OleDbCommand com = new OleDbCommand("select * from techs where actd0v between '" + TextBox1.Text + "' and '" + TextBox2.Text + "'" , con);
where textbox 1 and 2 are the specified dates in which i want to retreive some date related to those dates.but when i m trying to find the data between the given dates it gives me some dates which are not included in between them.is there any pattern i need to specify to get all the dates which occur in between the specified dates.
i m using ms access database for my project.
Hi guys,
In the Apple docs it says that
JavaScript execution time is limited to 10 seconds for each top-level entry point.
If your script executes for more than 10 seconds, Safari on iPhone OS stops executing the script at a random place
I plan to have some Javascript run every 10 seconds or so that will do an AJAX query to the server and rewrite just the section of the page necessary. Will this be possible with these restrictions on the device?
I have a simple SQL query (using SqlCommand, SqlTransaction) in .NET 2.0 that returns a table of integer-string pairs (ID, Name). I want to get this data into a dictionary like Dictionary.
I can get the result into a DataTable, but even iterating over it, I'm not sure how to do the typing and all that stuff. I feel like this must be a common problem but I haven't found any good solutions.
Thanks in advance.
I have a need to query an existing Sybase ASE database and would like to use Linq syntax for my data retrival.
I don't need write access, nor do I need the full set of Linq operators, just Select(),
SelectMany(), Where(), and GroupJoin()
What are options are available?
In particular, I'm wondering about nHibernate and building a new Linq2Sybase provider based on the IQ toolkit.
I'm using the "join_table" function with Kohana's ORM to build a query. The following works:
$category = ORM::factory('category')->join_table('product');
But this doesn't:
$category = ORM::factory('category');
$category->join_table('product');
The documentation uses the second as an example, but it returns 0 while the first example returns "categories_products" which is correct. Any ideas?
In Socket Programming, how will a Unix thread receive a Socket CLOSE event from a client if connection is closed?
Are there any API's which will notify the unix thread about the CLOSE event received?
As in Windows we have WSAEnumNetworkEvents API which gets the event notification for a specified socket descriptor. What will be the equivalent API used in the Unix socket programing?
Please provide the help for the query.
I have two tables from two different Data Contexts. Although both tables are from the same database, two separate datacontexts exist.
Error msg: "The query contains references to items defined on a different data context."
How can I get around this? Any help is appreciated. Thanks.
Hi all, i have a couple of sql views with composite primary keys that i want to query, and since Hibernate makes it a pain to work with composite keyes, im using createSQLQuery. The problem is that this method can only return a List, and i need to refer to the colums by their index.
Any chance i could do like jdbc and refer to the columns by their sql name insted of their index? thanks
Hi,
Not really a coding question more a little help with my idea of a Relational database.
If I have 3 tables in a SQL database. In my php script I basically query the companies which are in industry "a" and then insert a row into a separate table with their details such as companyId , companyName etc is that a type of Relational database ?
I have explained it in a simple way so we don't get confused what I am trying to say.
i have a pgsql table with fields id, identifier, name.
id serial NOT NULL,
identifier character varying(16),
name character varying(128)
I want to fetchAll values from the table orderby identifier.
but identifier is having values
12, 100, 200, 50
and after $table->fetchAll(null, 'identifier');
is giving the result
100, 12, 200, 50
but I want the result as
12, 50, 100, 200
or using a direct query?
I have a SQL Server 2000 database. When I run the following command
select * from sysindexkeys
This display the appropriate records.
I then do a DBCC command for the sysindexkeys. It doesn't display anything. Strange there is no page having the sysindexkeys records. Then how the query display the list of records.
Hi,
well for some strange reason IE gives me and InvalidAuthenticityToken error almost every time a POST query is used. Seems to be that IE does not like the "/" and "=" characters sometimes found in authenticity_token. So I wondered if anyone has actually found a solution to this?
More strange is that no other browser seems to behave that way.
Thanks in advance.
Hi Following query is not working is there any problem with it?
var possibleSegments =
from epl in eventPotentialLegs
join sd in segmentDurations on
new {
epl.ITARequestID,
epl.ITASliceNumber,
epl.DepartAirportAfter,
epl.AirportId_Origin,
epl.AirportId_Destination
}
equals
new {
sd.ITARequestId,
sd.SliceIndex,
sd.OriginAirport,
sd.DestinationAirport
}
where
epl.DepartAirportAfter > sd.UTCDepartureTime
and
epl.ArriveAirportBy > sd.UTCArrivalTime
select new PossibleSegments{ ArrivalTime = sd.arrivalTime };