|
this is my database structure for your info:
CREATE TABLE `job_orders` (
`job_order_id` int(11) NOT NULL AUTO_INCREMENT,
`customer_id` int(11) DEFAULT NULL,
`cleaner_id` int(11) DEFAULT NULL,
`job_order_status` int(255) DEFAULT '1' COMMENT 'New, Cancelled, Completed, Payment',
`is_cancelled` bit(1) DEFAULT b'0',
`job_order_date` date DEFAULT NULL,
`start_time` time DEFAULT NULL,
`end_time` time DEFAULT NULL,
`job_order_note` text,
`created_date` datetime DEFAULT NULL,
`created_user` int(11) DEFAULT NULL,
PRIMARY KEY (`job_order_id`),
UNIQUE KEY `idx_job_orders_job_order_id` (`job_order_id`),
KEY `idx_job_orders_customer_id` (`customer_id`),
KEY `idx_job_orders_cleaner_id` (`cleaner_id`),
KEY `idx_job_orders_job_order_status` (`job_order_status`),
KEY `idx_job_orders_is_cancelled` (`is_cancelled`),
KEY `idx_job_orders_job_order_date` (`job_order_date`),
KEY `idx_job_orders_start_time` (`start_time`),
KEY `idx_job_orders_end_time` (`end_time`),
KEY `idx_job_orders_created_date` (`created_date`),
KEY `idx_job_orders_created_user` (`created_user`)
) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8;
Technology News @ www.JassimRahma.com
|
|
|
|
|
What class type is returned from the sql_reader["start_time"] property? Check the documentation to see if it has a ToString method, and if so what is the syntax? You cannot write code like this and just assume it will work, you need to ensure you are using valid properties and methods.
Veni, vidi, abiit domum
|
|
|
|
|
Jassim Rahma wrote: Unable to cast object of type 'System.TimeSpan' to type 'System.IConvertible'.
sql_reader["start_time"] is returning a TimeSpan[^]. You cannot convert a TimeSpan to a DateTime , which is why the call to Convert.ToDateTime is failing.
If your time value is always less than 24 hours, you could use:
lblStartTime.Text = ((TimeSpan)sql_reader["start_time"]).ToString("hh\\:mm");
However, note that the hh format specifier only includes "the number of whole hours in the time interval that is not counted as part of its day component":
http://msdn.microsoft.com/en-us/library/ee372287.aspx[^]
If your time values could exceed 24 hours, you would need to format the value yourself:
private static string FormatTime(TimeSpan time)
{
return string.Format("{0:##00}.{1:00}", time.TotalHours, time.Minutes);
}
lblStartTime.Text = FormatTime((TimeSpan)sql_reader["start_time"]);
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Everybody,
i need to implement something that I need to know which url a current user is acessing. I already have a IE, Chrome and Firefox implementation, but I need to find shomething that works fine in Safari and Opera.
Somebody can help me to solve this?
Cheers,
Túlio Cruz.
|
|
|
|
|
Why write a bunch of code when any off-the-shelf proxy server will do this for you, and without having to write speerate support for every possible browser.
|
|
|
|
|
One reason not to use a proxy server is that the browser must be configured to work with it, and that's a hassle for the user.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Compared to the hassle of individually supporting many browsers, it's a very small one.
We also don't know anything of the environment to which this app is being targeted.
|
|
|
|
|
I am a beginner to C# while reading i came a cross Cesign Patterns So Can anyone please tell what is this Design Pattern ?
- factory
- Singleton
- Chain of Responsibility
How they help in development of Applications ?
|
|
|
|
|
It's impossible to provide sufficient detail to your question in a forum like this. There are plenty of references on the internet that will explain, the purpose of design patterns, and the different types that may be used. There are also books that cover the subject in full detail.
Veni, vidi, abiit domum
|
|
|
|
|
|
You can buy a book on design patterns and go through them.
|
|
|
|
|
Capturing a wealth of experience about the design of object-oriented software, four top-notch designers present a catalog of simple and succinct solutions to commonly occurring design problems. dofactoy[^] shows C# and VB.NET sample code of any GoF (Gang of Four: Erich Gamma, Richard Helm, Ralph Johnson and John Vlissides) pattern.
Cheers,
Jani Giannoudis
Meerazo.com - Resource Sharing Made Easy | Co-founder
|
|
|
|
|
Design patterns are a dime a dozen. Since you are a "beginner", then I would focus on the fundamentals first, and worry about patterns later.
Good luck.
|
|
|
|
|
|
The code for that sample is available. Why not just look there?
|
|
|
|
|
Hi
Thanks. I am not experinced in programming, was just told that it was a silverlight code that was hard to reuse as an ordinary VS code. But when looking into the details you are right.
Kind regards
Espen
|
|
|
|
|
Excellent. I'm glad that has got you started.
|
|
|
|
|
I am developing a web application using asp .net 2010 where I need to generate barcodes plus qrcodes dynamically and need to print it on different platform with different sizes.
How to achieve it? Which dll is useful for this? Whether microsoft have in build functionality for this or not? If yes then which DLL?
Winners don't do different thing they do things differently.
|
|
|
|
|
|
There is no built in DLL in Windows or .Net - but there are several api's that can be downloaded (both free and paid) that will do this to varying levels and for various bar code types.
|
|
|
|
|
Hi,
I have date data supplied as a string in the following format...
"Mon Sep 9 00:00:00 UTC 0100 2013".
Firstly, what is this format?
Secondly, how can I use C# to convert it and stire it in a DateTime variable?
I've tried...
DateTime dt = Convert.ToDateTime("Mon Sep 9 00:00:00 UTC 0100 2013"); but this blows up
Many Thanks.
|
|
|
|
|
Also tried...
DateTime dt = DateTime.ParseExact("Mon Sep 9 00:00:00 UTC 0100 2013", "ddd MMM dd HH:mm:ss K yyyy", CultureInfo.InvariantCulture);
Doesn't work either...
|
|
|
|
|
See here[^]
it lists, d, D, f, F, g, G, M, m, O, o, R, r, S, t, T, u, U, y, Y as valid format strings, and below the table it says : Any other single character unknown specifier. Throws a run-time FormatException.
In my case it says: String was not recognized as a valid DateTime.
try to remove the K specification along with the 0100...
|
|
|
|
|
Thanks for the reply.
I can't get it to work as a UTC. If I change it to UTC+ by adding the plus sign in to replace the space directly after the UTC on the fly then parse I can get it to work...
string strStart = "Mon Sep 9 00:00:00 UTC 0100 2013";
strStart = strStart.Replace("UTC ", "UTC+");
DateTime dtStart = DateTime.ParseExact(strStart, "ddd MMM d HH:mm:ss UTCzzzz yyyy", CultureInfo.InvariantCulture);
This works!
|
|
|
|
|