|
So how should I then implement this?? Should I then just set it to DateTime.Now?
|
|
|
|
|
ma se wrote: So how should I then implement this?? Should I then just set it to DateTime.Now?
Depends on what you want. If you want to initialize it to any value, DateTime.Now is as good as any. If you specifically want to store a value that indicates it wasn't given a 'real' value, I suggest you pick some standard value, say, 2000-01-01 00:00:00.
Cheers,
Vıkram.
After all is said and done, much is said and little is done.
|
|
|
|
|
DateTime.MinValue is typically used for "no value yet".
|
|
|
|
|
Or a DateTime? equal to null is used for "no value yet".
MinValue can lead to very ugly bugs
Happy Programming
Urs
-^-^-^-^-^-
no risk no funk
|
|
|
|
|
|
only two letters away from being an asset
|
|
|
|
|
If you need DateTime as null you can use a Nullable type
Nullable<DateTime> dt = null;
or shorthand
DateTime? dt = null;
-- modified at 9:25 Friday 29th June, 2007
only two letters away from being an asset
|
|
|
|
|
Because VB is all about nothing
only two letters away from being an asset
|
|
|
|
|
|
|
There are a few little differences like this between VB and C#. I spent some months on a contract doing VB .NET after having done C# and I was caught out on a few things. Example, locals are automatically initialised to defaults in VB. But not in C#. Actually, I think VB is correct in this case, but nevertheless it is a difference.
Kevin
|
|
|
|
|
'Nothing' and 'null' are not equivalent.
'Nothing' in VB is the default value of the type. For reference types, this is equivalent to 'null' in C#, but for value types 'Nothing' means the state of the value when created.
That's why you can use "Is Nothing" in VB for reference types and "= Nothing" for value types.
David Anton
www.tangiblesoftwaresolutions.com
Instant C#: VB to C# converter
Instant VB: C# to VB converter
C++ to C# Converter: converts C++ to C#
C++ to VB Converter: converts C++ to VB
Instant C++: converts C# to C++/CLI and VB to C++/CLI
Instant Python: converts C# to IronPython and VB to IronPython
|
|
|
|
|
Hi all,
How can i integrate the ImageMagick with c# .net. If you have any samples or links please let me know.
thanks in advance
|
|
|
|
|
you'd need to use p/invoke. Why would you want to ? What do you need that GDI+ won't do ?
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
i need to convert from pdf file into tiff file? If it is possible with in GDI+, please send some samples.
|
|
|
|
|
ImageMagik does that ? OK, I didn't know that. In that case, p/invoke is your best bet, there are articles here on CP about it.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I have a following regex in my program
01 private void myMethod
02 {
03 string strInput = "http://www.yahoo.com/";
04 string p = strInput;
05 Regex myRegex = new Regex(@"http://(www\.)(?[^\.]+)\.com", RegexOptions.IgnoreCase);
06
07 MatchCollection MatchList = myRegex.Matches(strInput);
08
09 StringBuilder sb = new StringBuilder();
10 sb.Append(MatchList.Count + " Matches found\n");
11 sb.Append("==========================================\n");
12 rtbOutput.Text = sb.ToString();
13 }
But when i run the program i receie the following error
An unhandled exception of type 'System.ArgumentException' occurred in System.dll
Additional information: parsing "http://(www\.)(?[^\.]+)\.com" - Unrecognized grouping construct.
What am I doing Wrong?
o O º(`'·.,(`'·., ☆,.·''),.·'')º O o°
»·'"`»* *☆ t4ure4n ☆* *«·'"`«
°o O º(,.·''(,.·'' ☆`'·.,)`'·.,)º O o°
|
|
|
|
|
If I'm not mistaken then (? marks the start of a named group (see named group in MSDN).
Why do you have the ( and ) anyway?
-^-^-^-^-^-
no risk no funk
|
|
|
|
|
Take the '?' question mark out of the group and put it in front of it, actually marking the fact that (www\.) is optional.
SkyWalker
|
|
|
|
|
Hi All,how can I pass variables from .aspx.cs to javascript...in javascript file how can I receive them?
please help me..
-- modified at 6:40 Friday 29th June, 2007
Hi,Im Razana
|
|
|
|
|
I feel like I've answered this one three times today.....
Just use the RegisterClientScriptBlock method on the page class to write javascript into the page, and build a string in your code behind that creates the variable.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Yes you can use RegisterClientScriptBlock...
but if you put some dynamic values in javascript you can use this one also..very easy and stright forward.
string str="Some Dynamic String";
Response.Write(" var ServerStr="+str+" ");
cheers
Ravi Kant Srivastava
(System Analyst)
HandsOn Technology & Engineering
Gurgaon
(India)
e-mail:ravikant@hte.co.in
Cell: +91-9999611388
|
|
|
|
|
Some problems with this
1 - you didn't put the variable in quotes
2 - Response.Write always puts the text at the top of the page, above the head tag, this is bad.
3 - RegisterClientScriptBlock lets you stop a script from being inserted more than once.
Ideally, if you want full control of the text's location, you should put it in the aspx, or put a literal control in the aspx that you can set to contain the script.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I need to do 3 Steps..
1.In java Script file, I've to get the value of textbox which is placed on .aspx file..
2.I've pass this value to another .aspx file to check whether the value of text box exsist in database..
3.Finally I have to pass a variable from the second .aspx file to the first .aspx file...
I did the above to...
I dont know the third one...that is my problem...
txtajaxscript.js
=================
var http = getHTTPObject();
var url="txtajaxcheck.aspx?id=";
function handleHttpResponse() {
if (http.readyState == 4) {
results = http.responseText;
document.getElementById("lbltxt").innerHTML= results;
}
}
function txtdisplay()
{
var txtvalue=document.getElementById("Text1").value;
document.getElementById("lbltxt").innerHTML=txtvalue ;
var http = getHTTPObject();
http.open("GET", url + escape(txtvalue), true);
http.onreadystatechange = handleHttpResponse;
http.send(null);
var role = "<%=role%>";
document.getElementById("lbltxt").innerHTML=role ;
}
function getHTTPObject() {
if (typeof XMLHttpRequest != 'undefined') {
return new XMLHttpRequest();
}
try {
return new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
return new ActiveXObject("Microsoft.XMLHTTP");
} catch (e) {}
}
return false;
}
now I have to pass a variable from txtajaxcheck.aspx to txtajaxscript.js...and I have to get a variable here which is sent by txtajaxcheck.aspx ...
Help me please....
Hi,Im Razana
|
|
|
|
|
Hi,
my situation is that I am creating an updater for my application that updates a reference library in the database.
I have a master library and a client library. I basically want to be able to compare the master library with the clients library and update where necessary.
I could achieve this with the merge datasets, then call get changes and update the database. However what I must avoid is that the client may have made changes to their library and I don't want to override there specific changes with the master database.
Any ideas how I might acomplish this?
Thanks
Paul
|
|
|
|