|
OK - so this is a SQL question. I am not sure how to do it in your query, if you don't have the day of week already. I recommend asking in the SQL forum.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Try this, daetpart is your friend - from BOL
SELECT
DATEPART(wk,datadate) Week,
COUNT(*) Attendees
FROM MyTable
WHERE DATEPART(YEAR,datadate) = 2008
GROUP BY
DATEPART(wk,datadate)
ORDER BY DATEPART(wk,datadate)
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Oh - cool.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
In SQL Server Datepart(Week,{date}) gives you teh week of the year, so you could group like that.
eg
select datepart(week,getdate()) for today gives yuo 20, i.e. the 20th week of the year.
Hope this helps
Bob
Ashfield Consultants Ltd
|
|
|
|
|
i have apllication with forms created in design view.
this forms have controls in them, like datagrids, buttons etc.
my application reads text from a CSV file and putting the text in the datagrids and other controls.
these controls use the "arial" font.
my CSV loads both hebrew text and russian(not in the same time).
i have no trouble viewing russian. but when i switch my regional settings to hebrew, the datagrids display russian charecters(scrambled) instead of hebrew.
ive noticed that when i select a font in the form or buttons it gives me the option of choosing also the right script for the font.
but in the datagrid i can only choose the font name and dont have the option of script.
anyone knows how can i deal with this font problem?
thanks.
|
|
|
|
|
I need help i have been trying all day yesterday and all day to day to try and get this working
What i trying to do is create buttons dynamically i can now do this thanks to Dave Kreskowiak he told me how to wire up the events for this but i just can’t get my head round it
I can get the event to work but the event is the same for each button
I need it to get the relevant drink and price from the database and put them in a list box
Dave mentioned directcast i tried to find out how to do this but with no joy
Original thread
http://www.codeproject.com/script/Forums/View.aspx?fid=1646&tid=2546094[^]
|
|
|
|
|
If all your buttons fire the same event, you can cast the object passed into the click event ( typically called 'sender' ) to a button, and then you can examine it's name or tag to work out what button was clicked and change the behaviour accordingly. I'd typically use the same event handler if all the buttons did roughly the same thing, for example, if three buttons all added a different value to something, I'd store the value in the tag property.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
|
It doesn't come with the Express editions, as far as I know. I could be wrong because all I have is the Team Suite, which comes with everything.
|
|
|
|
|
Hi
Can anyone give a code that can chat with Yahoo and MSN in VB.NET?
Thanks
Socheat
|
|
|
|
|
I doubt anyone will willingly post you the code but a simple bit of research will get you the following
clickety[^]
About the 8th result was a CP article - try doing some work before requesting the codez.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I've been trying to get this to work for ages now.
All I need is to be able to cast an object as a data type that's type is stored in a variable. EG:
Public Class Test<br />
Private _myType As System.Type = MyCustomClassHere.GetType()<br />
<br />
Public Sub DoSomething()<br />
<br />
Dim MyVariable As (Here it would refer to _myType to get the data type [which is MyCustomClassHere's Type])<br />
<br />
End Sub<br />
<br />
I've tried using DirectCast(), Converter(Of Object, Of _myType) and alsorts but I can't get it to work. Could anyone help me out? Thanks.
|
|
|
|
|
Member 3400545 wrote: I've been trying to get this to work for ages now.
If I get what you're asking, I'm sorry to say that you've been wasting your time. This won't work at all since the compiler needs to know what the type is at compile-time. The best you're going to be able to do is define it as Object, but then you lose all ability call methods and st properties on the object.
|
|
|
|
|
Member 3400545 wrote: I've been trying to get this to work for ages now.
Why? Can you tell us why you are trying to do so? What are you trying to accomplish? We can then provide you either with a resolution to your problem or provide you with alternatives.
Sometimes when something does not work, change your strategy instead of trying over and over and wasting your time.
|
|
|
|
|
Hello!
My aim is to read inputs from a gamepad that is attached to an usb port. How can I do that in Vb.Net? HOw can I also check the device capabilities?
Thank You!
What a curious mind needs to discover knowledge is noting else than a pin-hole.
|
|
|
|
|
You'll have to use DirectInput in the DirectX library to do this. There is nothing in the .NET Base Class Library that will do this for you.
|
|
|
|
|
I've never used it myself, but I know there's some support for hardware in the Robotics Studio Microsoft put out. No guarantees, but if you're determined to stick with VB that might be a starting point.
|
|
|
|
|
hi
i am using datagrade to display my data but i want to merge the cell that have the same value ,my data strctuer is
levelnumber: course1
: course2
: course3
can i merge the cell that have the same level in the first column
please i need help
|
|
|
|
|
Merging cells is not supported. You'll have to use a third party grid control to do this, like DevExpress's XtraGrid Suite[^].
|
|
|
|
|
--> indexof and lastindexof methods get the occurence from the start and from the end. So, how will i get the character in the middle..?
For example:
"adfdfafwera"
how will i get the mid "a"?
J A Nasir K
|
|
|
|
|
hi nasir,
There r not any method which perform this type of task. However you can write your own procedure.
Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)
My Company
|
|
|
|
|
Try This
dim MyString as string="Rajesh"
dim Midstring as string =""
Midstring=mid(MyString,len(MyString)/2,1)
thanks
Rajesh B --> A Poor Workman Blames His Tools <--
|
|
|
|
|
--> Do you think it will work. I don't. Coz everytime it will not be the case....... just take the example and try it..
"afeafsdfwerwa"
--> i want to extract the 2nd "a". How..?
J A Nasir K
|
|
|
|
|
hi nasir,
if you want to extract second occurance then you can try something like that
Dim str As String<br />
str = yourStringVariableValue<br />
Dim FirstLocation As Integer<br />
FirstLocation = str.IndexOf("a")<br />
str = str.Substring(FirstLocation + 1)<br />
Dim SecondLocation As Integer<br />
SecondLocation = str.IndexOf("a")<br />
SecondLocation = SecondLocation + FirstLocation + 1<br />
MsgBox(SecondLocation)
hope this helps
Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)
My Company
|
|
|
|
|
You can use the IndexOf method of the String class to find the index of the first occurance of your string. Then you can call it again, passing in the position to start the search from, namely the position of the previous occurance of the string.
' Look for the first occurance of "a" in a string
Dim pos As Integer = SomeString.IndexOf("a"c)
' Look for the next occurance of "a", starting at the position of the first occurance +1.
Dim pos2 As Integer = SomeString.IndexOf("a"c, pos + 1)
Or, if you already know the positions, you can use the SubString method of the String class.
|
|
|
|