|
i want to sort a table by string column
this column contains data in this format ddd/dddd (ex: 100/2006 or 6/2006)
so when i order the table by this column, it will sort like this:
1/2006
11/2006
111/2006
2/2006
22/2006
but i want to sort like this
1/2006
2/2006
11/2006
22/2006
111/2006
so, is there any why to sort like this on a vb.net application not in the database?
Faris Madi
Nothing Comes Easy (N.C.E.)
|
|
|
|
|
|
SELECT *<br />
FROM MyTable <br />
ORDER BY REPLICATE('0',8-LEN(mycolumn)) + mycolumn
----------
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 using SQL SERVER 2000 with .net 2003
my problem is when i connect to the other computer that has the database
it keep telling me "Login faild on Computername\Guest"
and i've installed the SQL SERVER 2000 on the other computer on mixmode authentication.
Why he want to login to Guest Account... while Guest account is off.
i'm using this connection string:
Me.SQLConnection_Search.ConnectionString = "packet size=4096; Trusted_Connection=true; Persist Security Info=true; SERVER= 192.168.0.1; User ID= sa; Password=sa;initial catalog=aqar; "
so where is the problem.
Faris Madi
Nothing Comes Easy (N.C.E.)
|
|
|
|
|
|
Hi
I need to modify the excel export feature in Reporting Services... The issue is that client needs to have chart in excel format after exporting so that user can manually change the values in excel sheet to check the effect in the chart dynamically. Can anybody tell me how I can do that? I know it would require the creation of chart in BIFF format. But could not find out how?
If someone knows any .NET library that can help me in that please let me know. I don't want to go for SoftArtisian Office Writer as it has certain limitation as it doesn't supports the grouping of data in RS.
Thanks
-- modified at 3:29 Saturday 17th June, 2006
|
|
|
|
|
I'm considerind adding database capabilities to my software. First step is selecting the proper database. The database should have 0 maintenance, be light weight. I would also appreciate a single file binary database and not BDF/Paradox like ASCII files.
At the moment I think SQLite could make it.
Once you made a choice - especially with small companies like mine - it is difficult to switch to another one. So since I'm not a database specialist, I would appreciate advices or suggestions on other candidates, and possibly pros and cons.
Thanks,
Yarp
http://www.senosoft.com/
|
|
|
|
|
SQLite is a proprietary format embedded database .. that sort of works against 'switching to another one' unless, you use a database abstraction layer in between your code and the database layer.
The most obvious one I can think of is ODBC, and there is an (?experimental) ODBC driver for Sqlite. You're still not off the hook with ODBC, because of SQL variations (Ie SQLite doesnt support all of the SQL-92 Standard) , but it could make it 'easier' to use ODBC
There is a database abstraction layer (cant remember the name off-hand, will look it up and try and post back), that MAY (memory is a bit dim) let you select between different database 'back-ends' - my guess is you would still have to stick to fairly basic SQL unless its translated somewhere for each potential database back-end.
.. but thats the approach I would use if there was any hint of having to change the database back-end ..
(if it counts for anything, I use SQLite in some projects - I also use SQLite and Oracle 9i in other projects)
hth, 'g'
ps .. your p3DO explorer looks great - wish I knew how to do some of that stuff - not enough time ....
-- modified at 2:10 Saturday 17th June, 2006
|
|
|
|
|
Thanks for your detailed answer Garth,
Since my needs are rather basic I will most probably only use SQL basic commands. So I think I can cope with those SQLite limitations.
Also although I will design it for multi-users use it'll mostly be used by single user.
For the driver, yes it is a choice in itself but the thiner layer, the better.
> your p3DO explorer ... - wish I knew how to do some ... - not enough time
Yes it takes a lot of time, fortunately (or not I'm single and I love 2D/3D graphics. This gives me the will to go ahead.
Looking for the proper library/component is a hard part of the project (I made severall costly mistakes in the past).
Yarp
http://www.senosoft.com/
|
|
|
|
|
You can try out Firebird. It can be used both as standalone or as a full server. I think you can convert a standalone database to a server very easily. For more check http://www.firebirdsql.org/[^]
--
Don't take life seriously because you can't come out of it alive.
-Warren Miller
(From Monty2[^] bio)
|
|
|
|
|
Thank you for your advice. I already used Interbase in the past, it is a good database but not light enough for what I intend to do.
I would most probably choose it for professional clients running on a network (I've read SQLite is not good for transactionnal network access), but my needs are too basic even for Interbase.
Note - I don't say for FireBird since I don't know it.
Yarp
http://www.senosoft.com/
|
|
|
|
|
Hi,
I have a problem with and app that is connected to an SQL 2000 database
The user got a new server dual CPU 3.2 GHz Pentium 4 with 2G memory and the app is slower compare with the old machine a dual CPU 755 MHz Pentium 3 with 512 memory.
If you use the TCP/IP connection in ODBC driver, the new machine is very slow.
If you use Name Pipe in ODBC, both machine a doing well.
The old machine it is working well with both TCP/IP and Pipes.
Does anybody have any idea why it is such a big difference between TCP/IP and pipes for the new machine? The different is from 1 minute to 10 minutes for an operation.
Any thoughts are welcome
Thanks,
Florian
-- modified at 15:01 Friday 16th June, 2006
|
|
|
|
|
my guess is Named-Pipes and ODBC are better at buffering, while TCP/IP works to a point then TCP/IP becomes saturated and network performance decreases.
(but there's a lot of variables here)
'g'
|
|
|
|
|
I have a table "tbl_order" with to the fields "customer_number" and "date". there can be multiple rows with the same customer_number, but the date fields are allways unique.
these or potential rows in my table:
cust_no | date | item
---------------------------
21 2006-01-06 shovel
21 2006-03-05 axe
21 2006-05-05 widget
45 2006-05-01 fish tank
45 2006-05-02 ...
For every cust_no i want to retreive only the row with the earliest date. How can this be done?
what i want is this:
------------------------
21 2006-01-06 shovel
45 2006-05-01 fish tank
Any help would be greatly appreciated
/ Stefan
|
|
|
|
|
|
//---------Below is code:----------------------------------------------------
string conn_str="Provider=MSDAORA.1;User ID=navuser2;Data Source=orcl;Password=navuser2";
OleDbConnection conn=new OleDbConnection(conn_str);
conn.Open();
OleDbCommand cmd = new OleDbCommand();
cmd.CommandText = "select * from test";
cmd.Connection = conn;
OleDbDataAdapter adap=new OleDbDataAdapter(cmd);
DataSet dtset=new DataSet();
adap.Fill(dtset,"test");
string ins= "insert into TEST values(30,'900')";
DataTable tab1;
tab1=dtset.Tables["test"];
DataRow r1;
r1=tab1.NewRow();
adap.InsertCommand=new OleDbCommand(ins,conn);
tab1.Rows.Add(r1);
adap.Update(dtset,"test");
conn.Close();
//------------------------------------------------------------------------
1.The above code is working fine for insert statements. How to use the above code in case if we are trying to update database with more than 1 updated row of dataset. e.g. instead of using "insert into TEST values(30,'900')";, use "update test set emp=100". Here we donot know how many rows will be updated in dataset.
|
|
|
|
|
Hi,
I'm running SQL Server evaluation version, and it sould ne close to the 6 month expiry date. How do I check when it expires?
Regards,
ma se
|
|
|
|
|
*solved* this is what you get for posting questions at 8:30pm local time *sleepy*
after some more digging i have noticed a second column that has a int, 0, 1 or 2, and it exactly correlates with the "fuzzy date". so a second flag is being used to achieve this
***
i am trying to convert data from one system (stored in MS SQL) into a different system stored in MySQL.
in the MS SQL some records are stored with a "fuzzy date", they only has a year, no day and no month. we have the same concept the new system, where we store the date as 00/00/1988
using a SQL client on MySQL with one of these dates i am told it is 01/01/1988, but if i issue the same query on the MySQL command line i am told the date is 00/00/1988, so i have to distrust what clients are telling me.
in the MS SQL database i have tried "enterprise manager version 8" and it is telling me the date is 01/01/1988, but the software (i have NO access to any source code for the old system) reports the date as "1988", no day and no month.
either the old system uses some flag somewhere to say "this is a fuzzy date" or the MS SQL client is "protecting" me from the invalid data.
in MSSQL the column is of type "datetime", and i have found dates that show as "01/01/1985" and "03/2001" in the old system, so i can rule out the theory that you cannot record data on the 1st January.
any pointers or bright ideas would be most welcome. i know something about MySQL but am learning MSSQL as i go along
zen is the art of being at one with the two'ness
-- modified at 15:34 Thursday 15th June, 2006
|
|
|
|
|
Look for ISDATE(), CAST(), CONVERT() DATEPART() and DATENAME() functions in BOL.
Farhan Noor Qureshi
if (this == this) thow this;
|
|
|
|
|
Hi,
I am passing the customer id to DataBase and I want it should return the recordset. Can you pls let me know how to do it in ESQL. I am new to ESQL. It would be grate if you also let me know how to access each individual field.
Thanks
|
|
|
|
|
Does this "ESQL" thing come with any sort of docs?
Farhan Noor Qureshi
if (this == this) thow this;
|
|
|
|
|
Hi all,
Please help me its very urgent for me..
How we can disable and enable the unique constraint for an index.
I have tried ALTER Table_name disable CONSTRAINT constraint_name; But it is giving error no such constraint is present..
This unique constraint is on index...and not on single index it is on multiple index...
Please try to solve my problem
|
|
|
|
|
This link[^] gives a pretty good explanation for all uses of constraints.
Chris Meech
I am Canadian. [heard in a local bar]
When no one was looking, every single American woman between the ages of 18 and 32 went out and got a tatoo just above their rumpus. [link[^]]
|
|
|
|
|
What DB are you using?
Farhan Noor Qureshi
if (this == this) thow this;
|
|
|
|
|