|
anyone can help me how to get number of weeks in a month... using vb.net, and what week did i select an specific date?....
ex : sample pickdate "
02/14/2007 (using a datetimepicker)
output: 2nd week of Febuary...
pls help thanks
start a new beginning in every ending; thats what life for......
|
|
|
|
|
moomoooomoo wrote: anyone can help me how to get number of weeks in a month
Number of days in a month divided by seven.
moomoooomoo wrote: and what week did i select an specific date?....
Day of the month minus one divided* by seven plus one.
* Assuming an integer division
|
|
|
|
|
Colin Angus Mackay wrote: Surely that's easy
Little Bit of constructive criticism. not everybody has developed thes logical thinking patterns that come withd programming experience. This could be percieved as condescending.
Posted by The ANZAC
|
|
|
|
|
The ANZAC wrote: not everybody has developed thes logical thinking patterns that come withd programming experience.
Really? I thought this was primary school stuff. Oh, well... Maybe you're right.
|
|
|
|
|
Well...not everyone thinks the same, some are more naturally left or right brain sided which tends to different frames of thought. The most unbias way to write is to assume they know nothing. Without the implications of an obvious answer, and without writing in a manner that seems to belittle. This way you cover all your bases without any chance of offense.
Posted by The ANZAC
|
|
|
|
|
Would you consider that the 5th of March 2007 is the first week of March then?
|
|
|
|
|
It is indeed the 1st week of March.
Looking at weeks on a calendar, or the number of weeks in the year, is different.
March 5th is in the 2nd workweek of March, or the 10th week of the year. Different context.
He was a snowflake, like other "unique" snowflakes, falling down, getting stepped on, and pushed aside to disappear.
|
|
|
|
|
ChandraRam wrote: Would you consider that the 5th of March 2007 is the first week of March then?
Yes (5-1)/7+1 = 1
|
|
|
|
|
That depends on if you consider a week to belong to a certain month, or if you consider a week to be able to belong to two months.
If the first of a month is a sunday, do you consider that single day to be the first week of the month, or does the week belong to the previous month?
---
single minded; short sighted; long gone;
|
|
|
|
|
Anyone have any idea where I can find information on updating MS Outlook records from a VB .NET application? I've been asked if my application can post scheduling information to Outlook's Calendar. I'm trying to find out if that is even feasible.
|
|
|
|
|
|
I had written about this earlier, but the application does not work..
I have the server return in its response, an url to an xml file, say
urlPath = "http://abc.xyz.com/tmp/ordera5fgscfs122dfbvgefsdsd.xml"
I want that when the client receives the url to an xml string in the response it saves the xml file to a particular location specified earlier; say
folderPath = "C:\"
I am using the following code:
Dim xmlDocToSave As MSXML2.DOMDocument40
xmlDocToSave.loadXML (urlPath)
xmlDocToSave.save (folderPath)
But this is not saving the xml file into the folder location.
Can anyone please help, I want to know how should I save the xml file sent by the server. It is urgent
|
|
|
|
|
It's a bit difficult to follow your explanation. Is this server-side code and you're trying to save a file on the client machine? If so, then you can't do what you want. You have no control over where a client browser saves a file. You have to send the file in the Response stream with the proper encoding, then the browser will ask the user where he/she wants to save the file, just like if you were to download a .ZIP file.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Thanx for your reply. I got it working.
This is a client side implementation. The client receives an url to an xml file in the response and wants to save the xml file.
The changes I had to go were as follows
Say for instance, the server return in its response, an url to an xml file, urlPath = "http://abc.xyz.com/tmp/ordera5fgscfs122dfbvgefsdsd.xml"
I want that when the client receives the url to an xml string in the response it saves the xml file as follows,
filePath = "C:\saved.xml"
Now I am using the following code:
Dim xmlDocToSave As New DOMDocument40
xmlDocToSave.Load (urlPath)
xmlDocToSave.save (filePath)
This will save the contents of the xml in 'saved.xml' in C:\
|
|
|
|
|
Hello,
I have made a custom control with a few textboxes, checkboxes and so on.
There is a event (public Event TextChanged (Controlnr as Int16, Text as string)
It works fine if I put the control(s) on the form, then I can choose that control and write code for the event
But I don't know how many controls I need (depends on the user), so after loading the form I add the first control by writing code Me.controls.add (control)
The question is how can I capture the event(s) ?
With a dropdownitem you can write menu.DropDownItems.Add("Name", Nothing, Eventhandler) is this also possible with an custom control and how ?
Thanks
|
|
|
|
|
You can add event handlers at runtime by using AddHandler. For example lets say I create a button at runtime, this would be the code to link the buttons click event with a given method.
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim btn As New Button
Me.Controls.Add(btn)
AddHandler btn.Click, AddressOf RuntimeButton_Click
End Sub
Private Sub RuntimeButton_Click(ByVal sender As Object, ByVal e As System.EventArgs)
MsgBox("You clicked a button added at runtime")
End Sub
End Class Your custom control is no different. It's a control just like a button. Just create a method that excepts the same parameters as your event. Then use AddHandler to link each control you make with that method.
Also, all .net events have a sender object and 'e' which is or inherits from system.eventargs. I would recomend for consistency staying with that pattern. You can read more about creating your own events here[^].
|
|
|
|
|
Thanks, it realy helped me
|
|
|
|
|
Hello,
After installing my VB.NET application on client computer I click on search button on my first form and I am getting "Object Reference is Not Set to an Instance of an Object" error.
Does anyone know why?
thanks
programmer
|
|
|
|
|
Usually this will occur if you haven't created an instance of an object. By using the 'New' keyword to an object to create an instance.
Hope this help.
|
|
|
|
|
Like Jack said, you got this error because you tried to set a property or call a method on an object that didn't exist. Perhaps your code tried to retrieve an object from another method and just assumed that it got a valid object when it actually got back Nothing instead?
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Does anyone know if there is a way to configure the MSHFlexGrid control so it doesn't highlight the first non-fixed row when the user clicks in a fixed row?
|
|
|
|
|
Hi.
I have console application installed on the servers, which I'm trying to run by calling it from a batch file.
In the batch file, I specify UNC path to the application 1 paramter: path to the folder.
Example:
\\server\directory\app \\server\dir\datafile\
The application doesn't see the path to the folder and returns back with "Directory doesn't exist" error (it does run the application though). When I change UNC paths, within the batch file, to noraml (proper path to the application and path to the folder using C:\... etc.) URLs the application works without any problems. If I only change folder path to C:\... it can't see the path as well.
I know that it got something to do with the security issue within .NET. Is there anyway around it. It looks like the app. just can't understand UNC paths.
Please help.
Thank you, Alex.
|
|
|
|
|
It's patially a security issue, since managed code is not trusted from ANY network source, and it also appears to be a problem with your app not being able to handle UNC paths. Or, there is a permissions issue with the path that you're giving your app.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
The server it installed on has access to the path so I don't think it's a permission issue. We've tried to give permission to everyone for this folder and still had problems. By the way the initial test of the application was trying to access share on the same server and failed. Do you know any way around it? We will be calling batch from another computer and we need to use UNC paths.
|
|
|
|
|
how to change an exsisting items image.?
exsample i have 5 items in listview:
Man
Wooman
Animal
Thing
Star
And all those items have same icon like ( ) buth when you click the
button i wish that item animal changes the icon into ( )...
Esample....
Thanks!!!!!!!!!!!!!!!!!!!
|
|
|
|