|
Thanks for ur reply. ............it is working....
Do good and have good.
|
|
|
|
|
SELECT MyColumn
FROM MyTable
GROUP BY MyColumn
HAVING COUNT(*) < 2
|
|
|
|
|
Hi there,
I need to read data from a excel spreadsheet, show on a webpage and insert into a sql server 2005 database. Need to do it in asp.net 2.0, using ado.net and VB(or C# samples will also help).
Can anyone point me to the right place?
|
|
|
|
|
Do you have a standard format for the spreadsheet you are reading? If so you can execute a SQL DTS package and read the data via ado.net.
how vital enterprise application are for proactive organizations leveraging collective synergy to think outside the box and formulate their key objectives into a win-win game plan with a quality-driven approach that focuses on empowering key players to drive-up their core competencies and increase expectations with an all-around initiative to drive up the bottom-line. But of course, that's all a "high level" overview of things
--thedailywtf 3/21/06
|
|
|
|
|
Hi,
Is it possible to connect to a MySQL databse with c# asp.net without having to install anything extra to mysql?
I think MySQLDirect.NET is what im looking for but its not free, is there a free alternative to this? I don't need all the bells and whistles just something that I can use to connect with, do lookups and send commands.
Basically I just want to access the database using built in fuction of .net if possible, or if not some class that I could include, as i don't have direct access to the server it will be on so won't be able to install extras.
Hope that makes sence
Thanks in advance
|
|
|
|
|
u can download mysql.net connector from mysql.com. after that add its reference to yr project. then u can use it as u use SqlClient or OracleClient namespaces.
|
|
|
|
|
|
Try this for your connection string:
string conString = "Provider=Microsoft.Jet.OLEDB.4.0;DataSource=C:\myDB.mdb;"
Steve
|
|
|
|
|
Hi every body i need to know how to do one think.So i have to table one is Employer other is customerEmployer.Employer have idEmployer,name.CustomerEmployer have idemplpoyer and idcustomer.
SO my question is please give me query who give it to me employer.name with max customet how to do that???
N.Nikolov
best regards
when i want to read something good just seat and type it
|
|
|
|
|
Your tables are:
Employer
--------
IdEmployer
Name
CustomerEmployer
----------------
IdEmployer
IdCustomer
This describes two thirds of a many-to-many join. The missing information is likely to be
Customer
--------
IdCustomer
{other columns}
papa80 wrote: SO my question is please give me query who give it to me employer.name with max customet how to do that???
What do you mean by max customer? What is a max customer? What defines the customer as being the max?
If you mean the MAX(IdCustomer) then:
SELECT Employer.Name
FROM Employer
INNER JOIN CustomerEmployer ON CustomerEmployer.IdEmployer = Employer.IdEmployer
WHERE IdCustomer = (SELECT MAX(IdCustomer) FROM CustomerEmployer)
|
|
|
|
|
is my bad.Ok i need to show employer.name with max number of customeres do you know how will look now that query???
when i want to read something good just seat and type it
|
|
|
|
|
SELECT Employer.Name, CustomerCount.NumCustomers
FROM Employer
INNER JOIN (SELECT IdEmployer, COUNT(*) AS NumCustomers
FROM CustomerEmployer) AS CustomerCount
ON CustomerCount.IdEmployer = Employer.IdEmployer
|
|
|
|
|
that is give me error
Msg 8120, Level 16, State 1, Line 25
Column NumCustomers is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.
how to solv it??
when i want to read something good just seat and type it
|
|
|
|
|
Colin Angus Mackay wrote: SELECT Employer.Name, CustomerCount.NumCustomersFROM EmployerINNER JOIN (SELECT IdEmployer, COUNT(*) AS NumCustomers FROM CustomerEmployer) AS CustomerCountON CustomerCount.IdEmployer = Employer.IdEmployer
You need to add ORDER BY CustomerCount.NumCustomers DESC to give you the maximum first. To get only the maximum, use SELECT TOP 1 Employer.Name, etc.
SELECT TOP 1 Employer.[Name], CustomerCount.NumCustomers
FROM Employer INNER JOIN (SELECT IdEmployer, COUNT(*) AS NumCustomers
FROM CustomerEmployer
GROUP BY IdEmployer) AS CustomerCount
ON CustomerCount.IdEmployer = Employer.IdEmployer
ORDER BY CustomerCount.NumCustomers DESC
Ian
-- modified at 9:26 Thursday 17th August, 2006
|
|
|
|
|
Thank you very much.That is what i need.This code is great.
when i want to read something good just seat and type it
|
|
|
|
|
can anyone pls say in what kind of a scenario can i go for System.Data.Oledb and System.Data.Odbc. Is there any difference in their performance. will it suit well for Oracle.
-----------------------------------------------------------------
where there is a will there is a way
|
|
|
|
|
There is a specific Oracle provider that you can use. You should use the most specific provider for your database rather than one of the generic providers such as Odbc or OleDb
|
|
|
|
|
Hi guys,
Good Day!
My back-end in my system is MS SQL SERVER, the major scenerios here are, it performs weekly autoupdate for the database and the data is so huge.. then, evrytime its updating the transaction log is occupying more space in the drive and encounters error if i set it to restrict file growth or in uncheck automatically file growth (it says that i need to set more size for the transaction logs or else it will not perform)..
My problem here is how can i delete the tranasaction logs automatically or limit the size without encounter the error everytime i update the database, since my system does not need that?
Hope your response, guys... Thank you in advance....
regards,
JayR
|
|
|
|
|
Is your DB set to SIMPLE recovery model?
Do you have AUTO_SHRINK set ON?
Steve
|
|
|
|
|
You need to understand what the transaction log is and what it's used for. See this comment[^] and this comment[^] for details.
I ought to turn those into an article.
|
|
|
|
|
I have a table that has currency exchange rates as below
CCY EX_RATE RATE_DT
---- ------- -------
AED 1.1 7/31/06
AED 1.0 6/30/06
AED 1.5 5/31/06
What that means is that the exchange rate was 1.5 from 5/31 to 6/30 and is at 7/31 till eternity. What I want is the output to look like this
CCY EX_RATE START_DT END_DT
---- ------- -------- ------
AED 1.1 7/31/06 (NULL)
AED 1.0 6/30/06 7/31/06
AED 1.5 5/31/06 6/30/06
I think an self-join will give me the correct data but i am getting excessive rows when i do a join.
|
|
|
|
|
Asad,
This should work.
Select CCY, EX_RATE, MIN(RATE_DT) as START_DT, MAX(RATE_DT) as END_DT
From your_currency_table
Group by CCY, EX_RATE
Farhan Noor Qureshi
|
|
|
|
|
Thanks for your reply but that doesnt work. If I have this data
CCY EX_RATE RATE_DT
---- ------- -------
AED 1.1 7/31/06
AED 1.0 6/30/06
AED 1.5 5/31/06
It will return something like
CCY EX_RATE START_DT END_DT
---- ------- ------- ------
AED 1.1 7/31/06 7/31/06
AED 1.0 6/30/06 6/30/06
AED 1.5 5/31/06 5/31/06
I want it to give me ranges like
CCY EX_RATE START_DT END_DT
---- ------- -------- ------
AED 1.1 7/31/06 (NULL)
AED 1.0 6/30/06 7/31/06
AED 1.5 5/31/06 6/30/06
|
|
|
|
|
select ccy,ex_rate,rate_dt as start_dt,(select top 1 cur2.rate_dt from tblcurrencyrate cur2 where cur.ccy = cur2.ccy and cur2.rate_dt > cur.rate_dt order by cur2.rate_dt) as end_dt from tblcurrencyrate cur
--EricDV Sig---------
Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them.
- Laurence J. Peters
|
|
|
|
|
I'm still getting the hang of this new tool and for the life of me, I can't remember how to add SQL procedures in the Stored Procedures folder. It keeps saving them as SQL files, but storing them as files. Man I miss the old look and feel. I finally got used to that one.
"In this house, we obey the laws of thermodynamics!" - Homer Simpson
Web - Blog - RSS - Math - LinkedIn
|
|
|
|