|
Ok, I can't find any useful information there though - such as the structure of the file.
|
|
|
|
|
i have same problem i can't found any information about structure of the file
|
|
|
|
|
So what are you trying to do? Crack open the files so that you can extract the underlying maps?
|
|
|
|
|
na i want use the ozf file for my application that load map file and show the location of user from GPS device
|
|
|
|
|
It looks like this file format was invented by the author for his application. I doubt you'll find it readily available anywhere I'm afraid.
|
|
|
|
|
|
hi
i have this code for update datetime fileds in access using params
SQL = "update ConfTbl set D_from = @MyFrom , D_to = @MyTo where Code = " + Convert.ToInt32(TmpCode1) + "";
OleDbCommand Cmd = Conn.CreateCommand();
OleDbParameter dateparam1 = Cmd.Parameters.AddWithValue("@MyFrom", DbType.DateTime);
dateparam1.Value = dt_From.Value;
OleDbParameter dateparam2 = Cmd.Parameters.AddWithValue("@MyTo", DbType.DateTime);
dateparam2.Value = dt_To.Value;
Cmd.CommandText = SQL;
Cmd.ExecuteNonQuery();
how to change this for run query that find between two dates ?
somthing like: `select * from ConfTbl where Tdate >= #MyFrom# and Tdate <= #MyTo#`
thanks in advance
|
|
|
|
|
One, this seems related to what you posted directly below. Edit the original, don't start a new thread.
Two, FORMAT your code snippets!!!
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
hi
i have in my access datetime filed that hold date in short format in this format: `01/08/2011`
i have in my C# program datetimePicker that hold date in this format:
`dt_from_A.Value.ToShortDateString()` and hold `01/08/2011`
i try to run this query :
SELECT * FROM ReturnConfTbl where Tdate >= #01/08/2011# and Tdate <= #01/08/2011#
but i dont receive any records
|
|
|
|
|
in sql server, both of those dates default the time to midnight, not sure bout other db's but i assume its the same. If all you have is the one date you can use a some DATEADD function to add a day to it and just make the query Tdate < date + 1. all the db's i've seen have some form of that function as do most popular languages..even javascript can do it.
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
goldsoft wrote: filed that hold date in short format in this format: `01/08/2011`
Don't store dates as text/char; use a proper date/datetime datatype.
goldsoft wrote: and hold `01/08/2011`
No, it holds a proper DateTime value; it simply displays the value in that format (or any other).
goldsoft wrote: >= #01/08/2011# and Tdate <= #01/08/2011#
Use a parameterized query.
Those two values are the same, so you will only get rows with exactly that value. You could use the AddDays method of the DateTime type to calculate the second value.
|
|
|
|
|
As PIEBALDconsult said, store dates and times in a proper DateTime, and hand them through as parameters.
It is also worth noting that Access (like every other database I have seen) uses ISO format for dates anyway: yyyy-MM-dd so the query you tried would not work as the date format would cause an error.
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
Manfred R. Bihy: "Looks as if OP is learning resistant."
|
|
|
|
|
This is a SQL question, not a C# question.
You want to use the BETWEEN keyword in your SQL query:
select * from table where table1.datecolumn BETWEEN date1 AND date2
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass." - Dale Earnhardt, 1997
|
|
|
|
|
what is the right way to fetch only one record from the table where many records of same types exist there ?
|
|
|
|
|
Because you asked in this forum, rather than the Database forum, I assume you mean a DataTable, not a database table, where an SQL solution would be appropriate, so I will recommend you look at Linq and select and take in particular.
If you are looking for SQL please post in the Database forum. I'll still help you there, although I should be asleep already.
|
|
|
|
|
The generic answer is to use a cursor .
Specifically it really depends on the database engine - for instance in Oracle PL/SQL you can use a loop command to iterate through a table.
Continuous effort - not strength or intelligence - is the key to unlocking our potential.(Winston Churchill)
|
|
|
|
|
There are many other ways besides using a cursor, which have inherent problems depending on the situation.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
GuyThiebaut wrote: The generic answer is to use a cursor .
That doesn't sound like a good idea to me.
All major databases provide alternatives to that. Oracle certainly does.
At this point I am not sure that answer isn't just wrong.
|
|
|
|
|
I think I may be misunderstanding his question - I understood him to be asking how does one iterate through a result that returns multiple rows one row at a time...
Since it does not sound like a good idea, to you, could you provide me with better suggestions please as I always want to learn from my mistakes - thanks.
Continuous effort - not strength or intelligence - is the key to unlocking our potential.(Winston Churchill)
|
|
|
|
|
If you want to return one record then you should construct the query to do just that.
|
|
|
|
|
Sure but given:
"I understood him to be asking how does one iterate through a result that returns multiple rows one row at a time"
How would you do this without a cursor?
Continuous effort - not strength or intelligence - is the key to unlocking our potential.(Winston Churchill)
|
|
|
|
|
This is the C# forum.
So the correct way to do that would be to return the result set (complete or subset) and interate it in C#.
But if one wants to return on record then one structures the query appropriately.
|
|
|
|
|
The easiest way is to use the DISTINCT clause.
EDIT: I do not know who downvoted my answer and why. But let me explain to you why I suggested DISTINCT and not TOP as suggested by other posters. A part of the question is
love yadav wrote: where many records of same types exist That means the OP wants to return one record from each type (each set of distinct values) and not just the first row. TOP 1 will return just the first row not matter how many distinct values are there in the result set.
modified on Sunday, July 31, 2011 11:42 PM
|
|
|
|
|
If you're using MySQL, you can say Limit 1
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Top (1) could be an option. If you are talking about LINQ, try FirstOrDefault .
"The worst code you'll come across is code you wrote last year.", wizardzz[ ^]
|
|
|
|