|
i would like to know how to compare date in ASP.NET Web Application..??
the prob is that we are using Oracle as the database..which uses date as DD/MM/YY format while VB.NET uses MM/DD/YY format,..
so how to cope with these two diff formats ??
|
|
|
|
|
VB.NET doesn't use any particular date format. The default dateformat is determined by the system, not VB.NET.
You should be comparing two Date objects, not two Strings of text representing the dates. Convert your data from the database, as well as the compare date, to Date objects and use the .CompareTo() method of one of them to compare it to the other.
Dim dt1 As New Date(2005, 2, 12)
Dim dt2 As New Date(2005, 3, 21)
Dim result As Integer = dt1.CompareTo(dt2)
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
ya Mr. Dave..
the system date that we tried to enter into the Oracle database through "Today.date.date" is not being entered into the database,,..
wat can be the prob... and so how shud we enter the system date in the database ??
|
|
|
|
|
Without seeing your code, it's impossible to tell you what your doing wrong.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I run into this all the time in my CIS349 and CIS 405 classes. In fact I just emailed a student of mine about a similar problem.
use the oracle to_date or to_char functions.
in SQL:
select * from orders where orderdate between to_date('01/23/2005', 'MM/DD/YYYY') AND to_date('02/23/2005', 'MM/DD/YYYY')
for the reverse....
select to_char(orderdate, 'MM/DD/YYYY') from orders;
In the latter version when you get your data back from the db into your data container you will already have it in the right format.
http://www.jasncab.com/huberblog :: Jason Huber
|
|
|
|
|
We have a bunch of terminal servers using roaming profiles (copies user setting to network share, includes contents of HKCU).
Problem is our logon script is locking the HKCU hive and it is not unloading to be copied.
I installed a tool that is now telling us this is what is locking it.
wmiprvse.exe (1428)
HKCU (0x1dc)
Then I found out that if a certain part of our logon script does not run the profile unloads
We don't really have any WMI experts here. I think we just copied this from somewhere. But what I think is going on is we are not "cleaning up" correctly after doing our calls and this is resulting in the profile being locked.
This is one section that we do some calls.
Set objReg = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\default:StdRegProv")
' determine the logon server
objReg.GetStringValue HKEY_CURRENT_USER, "Volatile Environment", "logonserver", strLogonServer
' "\\" prefix needs to be removed
Anyone know what we should do after this to free up the HCKU hive?
|
|
|
|
|
There's nothing to do. Your read shouldn't be locking the key. You can TRY setting objReg to Nothing and see what that does. The WMI Standard Registry Provider doesn't have any Open/Close methods, everything like that is handled internally by the Provider.
Also, if all you need is the name of the Logon Server, just grab it from the Environment strings.
ExpandEnvironmentStrings Method[^]
set WshShell = WScript.CreateObject("WScript.Shell")
WScript.Echo "Logon Server is " & WshShell.ExpandEnvironmentStrings("%LOGONSERVER%")
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
To bad.
To set objreg to nothing is this what I would do:
Set objReg=
or
set objReg=""
or
set objReg=null
Thanks
|
|
|
|
|
Set objReg = Nothing
Seriously, if all you need is the Logon Server, get it from the Environment strings. Only use WMI and the Registry Provider if you have to. They add a large chunk of execution weight to your script if you use them.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Just anybody know how to add a images dynamically to a listview control.and list view control should display like thumbnail images
suiscf
|
|
|
|
|
I want to re-organize the files in a FTP folder. Is there any way to "move a file from a Folder from FTP site to some other folder which is in that FTP site itself" without copying that file to our system.
Thanks,
Regards,
Rajkumar.S
|
|
|
|
|
Only if the FTP Server supports it. You'll have to with the documention for your server.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi!
I read the articles related to message windows that popup but i still don't have the answer for my problem.
I have a form which launches a new form (i want it to be a topMost form) but even with the ShowWindow() function the second form still gets focus.I tried a simpler example with a main form and a second that didn't contain any controls or painting code and it still gets the focus.This is my declaration of function.Am i doing anything wrong?When should i call showWindow()?
<dllimport("user32")> _
Private Shared Function ShowWindow(ByVal hWnd As IntPtr, ByVal nCmdShow As Int32) As Boolean
End Function
(...)
Dim myForm2 As New Form2
ShowWindow(myForm2.Handle, 4) '4 is the SW_SHOWNOACTIVATE value
This doesn't work for me (using vb.net).Can anyone help me?
Never say never
|
|
|
|
|
I don't know how to avoid changing the focus to the new form, but maybe the following will help you:
You should be able to use the Show() method to display the second form then call Focus() to set focus back on your primary form.
Example:
<br />
dim f2 as New Form2<br />
public sub ShowForm2()<br />
if firstTime Then Me.AddOwnedForm(f2)<br />
f2.Show()<br />
Me.Focus()<br />
End Function<br />
|
|
|
|
|
Hi!
I was trying to avoid that solution, but after a whole day of searching the web and grups, maybe i'm gonna follow that way.
Last night at home i was trying to accomplish this, and i kind of got it (i don't understand why this works but... ) : I was declaring the forms locally like dim myForm2 as New Form2 and then calling the showWindow() function.But then i declared the form as a class Member: Private myForm2 as Form2 and then in the init.Components method i did myForm2 = new myForm2 and then showed the form and it worked ok!!!Why is this?What's the difference between showing a form declared locally and another that is a class member?
Never say never
|
|
|
|
|
Hi!
I GOT IT.It was about time...i can't believe it took me a day and a half to accomplish this.
I think the problem is in the topMost Property.After a bit of thinking, i didn't use that property in the form designer, what i simply did was this, 2 simple instructions(that's what pisses me off):
ShowWindow(Me.Handle,SW_SHOWNOACTIVATE) 'SW_SHOWNOACTIVATE = 4
setWindowPos(Me.Handle,HWND_TOPMOST, XPos, YPos, myWidth, myHeight,SWP_NOACTIVATE) 'HWND_TOPMOST=-1
'SWP_NOACTIVATE=16
The first instruction tells the window how to behave when it appears. That constant tells it to not to steal the focus from other window.
The second instruction places the window where you desire with your desired behaviour.Once again the constants mean that:
1-the window will appear as TopMost
2-the window will not steal the Focus
AND IT WORKS FINE.
Never say never
|
|
|
|
|
Thanks for sharing your findings.
|
|
|
|
|
You scratch my back, i scratch yours.
PS: metaphorically speaking of course
Never say never
|
|
|
|
|
hi dears,
i wanna develope an add-in for outlook and outlook express.actually i wanna add a button in command bar to perfom some task. can someone help me? what should i use?can i do this in vba?how can i make an exe to install the developed application?
i shall be very very thankful to u if u consider it and help me.
|
|
|
|
|
I need to count the number of lines displayed in a richtextbox. I've seen examples using "Send Message" api but can't get it to work in VB.net. Other methods I've tried count wordwraped lines as a single line.
|
|
|
|
|
There are no properties anywhere in the RichTextBox control, not even in the underlying Win32 control, that expose this information. You could try calculating the number of lines by dividing the height of the RichTextBox with the height of a string of characters with the same font and size of whats displayed. The problem with this is that the RTB can display text of varying sizes, thus, have varying line heights. The bottom line is that there is no reliable way of doing this.
What are you trying to accomplish with this?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Try using the Lines property of RichTextBox. It contains an array of strings so you should be able to check the length using Lines.Length
|
|
|
|
|
I would really appreciate it if anyone could help me in figuring out how to print the entire form using VB.NET 2K3. I've done some research online and my program now prints, but only from a RichTextBox Control. What I need it to do is to send all the data from the form to the printer, how do I do this?
Thanks in advance.
Treacherous_1
|
|
|
|
|
Ok, nevermind I got it.
Treacherous_1
|
|
|
|
|
Hello there
I have started working on remoting objects and found many samples on Codeproject and on other sites.. through those samples I build one application. Now I wanted to deploy them on server machine and test it from client. but no one has told how to do this... as I want to run the server.exe in dedicated server process . Please help me out of this issue
or
if any one has electronic book on remoting please mail me at
rbashir@gmail.com
or
rbashir@alm-soft.com
your help would be highly appreciated..
Best Regards
Rizwan Bashir
|
|
|
|