|
The following example will add the last 20 days to your ComboBox:
'Create a variable of type Date
Dim dt As Date
Private Sub Form1_Load(ByVal sender As System.Object,ByVal e As System.EventArgs) Handles MyBase.Load
'Set the start date to 20 days ago
dt = Date.Now.AddDays(-20)
'Loop and add each date until it reaches today
Do While Not dt > Date.Now
'Increment the dates
dt = dt.AddDays(1)
'And add the dates to the ComboBox
cmbDate.Items.Add(dt.Date.ToShortDateString)
Loop
End Sub
I hope that helps.
(although having never used it, I am not 100% sure it will work in version 2002)
-- modified at 13:46 Sunday 23rd October, 2005
|
|
|
|
|
ListBox1.Items.Add(Format(Now.Date, "dd/MM/yyyy"))
|
|
|
|
|
Am I committing a major sin by asking a question here regarding VB6?
If so, please be gentle with me!
Using VB6, how do you determine the mac address of a network card?
db
Darryl Borden
Principal IT Analyst
dborden@eprod.com
|
|
|
|
|
|
hey guys Can we do the same through vb.net
if yes tell me also
abhinav
|
|
|
|
|
I have some javascript that detects a certain mimetype that is installed and it all works great in firefox and netscape but doesnt in IE is there any vbscript that will do the same but in IE
<script><br />
<br />
<br />
if (navigator.mimeTypes["video/psiv"]) { <br />
document.write("You have Already installed the plugin continue to next page!");<br />
window.location = "installed.html"<br />
<br />
}<br />
else { <br />
document.write("You need to install the plugin continue to next page!");<br />
window.location = "download.html"<br />
<br />
}<br />
<br />
</script>
|
|
|
|
|
hi,
i'm trying to store values from database into an array using datareader,
but i'm getting this exception:
system.NullRefernceException:Object Reference not set to an instance of an object
please help me
|
|
|
|
|
Post some code. Where in your code does it break. Which object is not initialized? That is where you will find the problem.
|
|
|
|
|
thanq for ur response
i got this,
problem is that my array was not initialized properly
now i got this.
now i've another problem ..
i posted this problem,its subject is "HOW TO ADD Values TO DATAGRID"
this is regarding adding data to already existing data in a datagrid
please try this
thanks in advance
|
|
|
|
|
I am trying to get the domain name from a client PC of the domain it is connected to.
"company.com.au"
Most code I find gets the domain name but not the full domain.
Any ideas would be great...
Thanks...
When people make you see red, be thankful your not colour blind.
|
|
|
|
|
What "connected to" are you refering to? Are you asking how to get the DNS suffix from the TCP/IP properties? A Windows domain? An Active Directory domain? ...?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I would like to get the AD domain string'
DC=company,DC=com,DC=au
Having trouble getting this so was hoping to get the
company.com.au and use string replace the "." with "DC="
Hope this makes sense...
I can pull from the reg on the DC but not on a client...
Thanks
When people make you see red, be thankful your not colour blind.
|
|
|
|
|
Couldn't you just lookup the machine name to get it's AD object, then look at that object's Parent property?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I guess someone could but I don't know what you are talking about...'
I am a newby if you have an example that would be great...
Thanks
When people make you see red, be thankful your not colour blind.
|
|
|
|
|
Since you were talkinga bout AD paths and stuff, I just assumed you knew what AD was all about. Without the basic knowledge of AD, you'll find this to be a difficult project to do. I would suggest starting the crash course here[^]. Yes, there are examples of how to search. Of course, they all assume you know the basics of AD.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Read this and looked at the examples like this one below but all have the ("LDAP://Path") but this I don't know how to get via code. I know AD and how to find the path but the program I am writing is for users that do not.
If this if to hard to do without a knowledge of AD I will pull in the full domain or DNS sufix and build a string from it replaceing the "." with "DC=" but this is not the best way to do it am I was looking to see if there was code that would pull in the root AD DC=companyDC=comDC=au.
Below is am example from the link you sent me...
To search an Active Directory hierarchy
Create an instance of the DirectorySearcher object and initialize it to the DirectoryEntry value that you want to search. Create an instance of the SearcherResultsEntry object.
Set the Filter property of the DirectorySearcher object to the value that you want to search for.
Initialize the search by calling the FindAll method of the DirectorySearcher. The DirectorySearcher object will return a collection of all objects in the target directory whose values match those specified in its Filter property.
The following example searches a directory for the user name "John" and then iterates through the returned collection, writing each object's path to a console. Note that this example will not search subdirectories.
' Visual Basic
Dim entry As New DirectoryServices.DirectoryEntry("LDAP://Path")
Dim mySearcher As New System.DirectoryServices.DirectorySearcher(entry)
Dim result As System.DirectoryServices.SearchResult
mySearcher.Filter = ("(anr= John)")
For Each result In mySearcher.FindAll()
Console.WriteLine(result.GetDirectoryEntry().Path)
Next
When people make you see red, be thankful your not colour blind.
|
|
|
|
|
Memory leakage has been viewed when visiting Accsess Database through ADO under VB. When opening a Recordset with a large number of records,the amount of memory consumed by the VB application will rise up,as well as the "total memory-used" indicated by the "Task Manager" in its status bar. But when the VB application finishs using the Recordset and colse the Recordset,then set the variable to Nothing, the amount of memory consumed by the VB application will go down to its normal level gradually,while the "total memory-used" show by the "Task Manager" in its status bar will not decrease,even over a long time, untill the VB appliction exits,the "total memory-used" will suddenly decrease.
Then what causes such a problem? how to resolve it?
thank you.
qiyue
yue_qi_qi@sohu.com
2005-10-21
|
|
|
|
|
You're looking in the wrong place to see what memory is being used by your application. In Task Manager, you're seeing what memory has been RESERVED for the entire .NET Framework and it's virtual machine that runs your application, otherwise known as the CLR (Common Language Runtime). Some of this memory is not permanently allocated to your "application", but is reserved for future use. This means that if Windows wants some of that memory back, the .NET CLR Memory Manager will release whatever Windows wants back to the system.
The .NET CLR Memory Manager keeps the memory reserved for performance reasons. Since you've used a large chunk of memory before, you might need it again, so the Manager hangs on to it, even though your application hasn't allocated it again. Since it's a little time consuming to allocate memory from the system (adding it to the .NET managed memory heap), then allocate your managed object on that heap, the .NET Memory Manager will try to skip the first step, if at all possible, by reserving memory for future use.
If Windows needs the memory back for something else, the .NET CLR Memory Manager is more than happy to free up whatever Windows needs. If you want to see the real memory counters, open up Performance Monitor and use the memory counters under the .NET CLR Memory performance object.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi all
I need to know how to write code when I press btn copy my application or my programme to spacIfic folder on the hard disk.
nobady answer last time are u
THANKS.
AMR-CIS
|
|
|
|
|
You're not very specific about what you mean by "copy my application". I'm assuming you just want to copy your .EXE and .DLL files. There's a very short example here[^] on how to copy a file.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
|
You're looking for <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemwindowsformsapplicationclassstartuppathtopic.asp" rel="nofollow">Application.StartupPath</a>[<a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemwindowsformsapplicationclassstartuppathtopic.asp" target="_blank" rel="nofollow" title="New Window">^</a>] .
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
very thanks to u
this is what I want.............
AMR-CIS
|
|
|
|
|
with a datagrid in a winform
single click on the datagrid:
my program must do one think(change the color of a single cell) - OK
double click on in the datagrid:
the program must show a panel the content if the datable "under" the datagrid - OK
the datagrid class has 2 method datagrid1.doubleclick end datagrid1.click
well when i click two times (doubleclick method) the program executes one time the dobleclikc and two times the single click
*************************************************************************************
Private Sub DataGrid1_MouseHover(ByVal sender As Object, ByVal e As System.EventArgs) Handles DataGrid1.MouseHover
Dim xxx As System.Windows.Forms.MouseEventArgs
Dim sss As Integer
sss = xxx.Clicks
If sss > 0 Then
If xxx.Clicks = 1 Then
'here code the inside datagri1.click
End If
If xxx.Clicks >2 Then
'here code the inside datagri1.doubleclick
End If
End If
End Sub
i take this exception
"System.NullReferenceException" in forfat1.exe
my question is:
how can i intercept the the single and the double click if mouse is over datagrid (mousehover method) bypassing commands datagrid.click end doubleclick end even mousedown????
thanks a lot and forgive my bad english
ROBERTO BAGGIO RULES
|
|
|
|
|
Hai Friends
I am trying to save data in excel file using vb6 code. I have to merge some cells in the excel sheet through the code. Problem is after saving the file excel.exe doesn't get closed in task manager.
Thanks and Regards
|
|
|
|