|
select convert(varchar(2),datepart(dd,travel_date))from booking_details
this returns me :…….
15
21
24
8
5
But in this o/p I want 08 instead of 8 please suggest
|
|
|
|
|
This is the wrong forum for this question, but one answer might be:
select right('0'+convert(varchar(2),datepart(dd,travel_date)),2) from booking_details
Hope that helps.
Ben
|
|
|
|
|
Dear Ben
Thanks for your help.
It's working now.
|
|
|
|
|
|
This has nothing to do with VB or VB.NET. Ask this question in the SQL forum.
|
|
|
|
|
I want to add a control button to an existing command bar.
Dim CmdBar As CommandBar
Dim Cntrl As CommandBarControl
Cntrl = CmdBar.Controls.Add(MsoControlType.msoControlButton,Before:=1)
cntrl.Caption = "Test"
cntrl.DescriptionText = "Test Button"
Cntrl.TooltipText = "Test"
Cntrl.Tag = "TEST"
Cntrl.BeginGroup = True
Cntrl.Visible = True
Commandbar can be of 3 types
Enum MsoBarType
msoBarTypeNormal = 0 ' toolbar
msoBarTypeMenuBar = 1 ' menu bar
msoBarTypePopup = 2 ' menu, submenu or
' shortcut menu
End Enum
Problem is that if the type of the Commandbar is msoBarTypePopup then only i am able to see the added button in the Commandbar and if it is of type msoBarTypeNormal then i cant see it while controls count is increased by 1.
I am working on Powerpoint and various commandbars provided are "Shapes" "Formatting" "Thumbnails" etc.
When i right click on any slide "Formatting" command bar opens,to which i want to add a control button. "Formatting" commandbar is of type msoBarTypeNormal. Does anybody have an idea how i can achieve this
|
|
|
|
|
In my vb .net app I would like to display a pdf file after they clicked the file name out of the listbox. I got this already working with webbrowser control.
vGeselecteerdeAfbeelding = Me.ListBox1.SelectedItem<br />
Me.WebBrowser1.Navigate(vAfbeeldingPadTemp & vGeselecteerdeAfbeelding & ".pdf")
During the pdf file is displayed I want to let the user rename the file, but the webbrowser keeps the PDF file open. Is there a way to close this?
I tried to kill the acrobat.exe proces, but it's very slow.
|
|
|
|
|
what happens if you just navigate to a blank page or something? (does that close the pdf file??)
otherwise there is a control 'Adobe pdf reader' in the com components that will probably give you more control over the pdf file (you will have to have adobe reader installed for the development)
(the control can be added to the toolbox by rightclicking in the toolbox and click 'choose items...' then go to 'com components' tab and there you'll find the control)
hope this helps
If my help was helpfull let me know, if not let me know why.
The only way we learn is by making mistakes.
|
|
|
|
|
When I navigate to another PDF, the earlier opened PDF is still opened.
Your other suggestion worked well!
File.Copy("C:\1.pdf", "C:\" & Me.TextBox1.Text & ".pdf")<br />
Me.AxAcroPDF1.src = ""<br />
File.Delete("C:\1.pdf")
Thanks
|
|
|
|
|
Hi everyone,
Can anyone help me? How can I send an e-mail from a WINDOWS XP PC without using OUTLOOK EXPRESS like applications. I need help using Visual Basic 6.0.
Pls help me.
monSur
|
|
|
|
|
|
Hi all,
I have written one function to store the error in the database.The function codes are
[code]
Public Function PopulateFileDetails(ByVal JobCode As String, ByVal ChapterID As String, ByVal nStage As Integer) As String
Try
Catch ex As Exception
CaptureError("Populate Values ", "Name", ex)
End Try
End Function
[/code]
This function will get the arguments as
1.The Function name which generates the error
2.Username
3.The message ...(Ex as exception).
Now the problem is that i am forcing the user to give the
the function name which generated the error. Is there any other method where i can pass the name which caused the error. In this case it is PopulateFileDetails....
Thanks in Advance
Dana
|
|
|
|
|
The exception object has a stack trace which will end with the method that you are in.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillionOneHundredAndFortySevenMillionFourHundredAndEightyThreeThousandSixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it )
|
|
|
|
|
Thanks Graus
That one did the trick
Dana
|
|
|
|
|
hi all
i am working on a project that uses a tab control having three tabs, now i need to add a zoom feature on the form that will allow the tab control to zoom in and zoom out with every control on it as well. if some one has any idea about it then please let me know. thanks in advance.
help everyone
|
|
|
|
|
One way to achieve Zoom effect with TabControl is to increase or decrease size of tab control and all of its pages including its contents according to the Zoom factor which is required.
I tried to implement this functionality with a tab control and following code should give you the desired result-
---------------------Code Start--------------------------------------------------------
Code to ZoomIn-
----------------------------
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnZoomIn.Click<br />
<br />
Dim ZoomFactor As Integer = 25 'In percent <br />
<br />
For Each tbpg As TabPage In Me.TabControl1.TabPages<br />
<br />
For Each cntrl As Control In tbpg.Controls<br />
<br />
cntrl.Width += cntrl.Width * ZoomFactor / 100<br />
cntrl.Height += cntrl.Height * ZoomFactor / 100<br />
<br />
cntrl.Left += cntrl.Left * ZoomFactor / 100<br />
cntrl.Top += cntrl.Top * ZoomFactor / 100<br />
<br />
cntrl.Refresh()<br />
<br />
Next<br />
<br />
Next<br />
<br />
Me.TabControl1.Width += Me.TabControl1.Width * ZoomFactor / 100<br />
Me.TabControl1.Height += Me.TabControl1.Height * ZoomFactor / 100<br />
<br />
Me.TabControl1.Refresh()<br />
<br />
End Sub
---------------------------------
Code to ZoomOut –
---------------------------------
<br />
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnZoomOut.Click<br />
<br />
Dim ZoomFactor As Integer = 25 'In percent <br />
<br />
For Each tbpg As TabPage In Me.TabControl1.TabPages<br />
<br />
For Each cntrl As Control In tbpg.Controls<br />
<br />
cntrl.Width -= cntrl.Width * ZoomFactor / 100<br />
cntrl.Height -= cntrl.Height * ZoomFactor / 100<br />
<br />
cntrl.Left -= cntrl.Left * ZoomFactor / 100<br />
cntrl.Top -= cntrl.Top * ZoomFactor / 100<br />
<br />
cntrl.Refresh()<br />
<br />
Next<br />
<br />
Next<br />
<br />
Me.TabControl1.Width -= Me.TabControl1.Width * ZoomFactor / 100<br />
Me.TabControl1.Height -= Me.TabControl1.Height * ZoomFactor / 100<br />
<br />
Me.TabControl1.Refresh()<br />
<br />
End Sub
----------------------Code End---------------------
I hope this helps .
-Dave.
Dave Traister,
ComponentOne LLC.
www.componentone.com
|
|
|
|
|
thank you verry much for your kind help,
but i need to enlarge the font size of each control and also control the anchoring of each control.
i think the reason behind the unusual behavior of the tab control is that i set the location of the tab control on form's load event.
let me tell you what i did
i take a panel, place the tab control on that panel so that the panel become the parent of the tab control, now i set the auto scroll property of panel to true, set the dock property of panel to fill. this will zoom the tab control, the other control on each tab but the font size remains same. what else i can do to work it properly.
i more thing i have one more tab control on the first tab page of the main tab control. the things goes complicated now with this second tab control.
thanks in advance
help everyone
-- modified at 6:50 Wednesday 24th October, 2007
|
|
|
|
|
Font can be resized using code like this-
cntrl.Font = New Font(cntrl.Font.Name, cntrl.Font.Size + cntrl.Font.Size * ZoomFactor / 100, cntrl.Font.Style, GraphicsUnit.Pixel)
-Dave.
Dave Traister,
ComponentOne LLC.
www.componentone.com
|
|
|
|
|
|
Again you did not Google, you must learn to google before you post. you will be ignored here. We need real Questions, not this. If you have bought a book and Stop spending money on weekend with friends, then you would have know the Answer.
http://www.google.co.za/search?hl=en&q=IsError&meta=[^]
it will help
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sudden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
He's from Myanmar, so a surplus of disposable income is probably not something he has to worry about...
Paul Marfleet
|
|
|
|
|
As someone else said, you can't learn at this basic level by flooding the forums, you need to bu ya book.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillionOneHundredAndFortySevenMillionFourHundredAndEightyThreeThousandSixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it )
|
|
|
|
|
Hi,
In regards to your question I would like mention that
IsError is a Method which returns a Boolean value indicating whether an expression is an exception type.
IsError returns True if the expression represents an Object variable that derives from the Exception class in the System namespace.
The following code snippet will explain how we can use the IsError Method.
Sub demonstrateIsError(ByVal firstArg As Integer)
Dim returnVal As New Object
Dim badArg As String = "Bad argument value"
Dim errorCheck As Boolean
If firstArg > 10000 Then
returnVal = New System.ArgumentOutOfRangeException(badArg)
End If
errorCheck = IsError(returnVal)
End Sub
I hope this helps.
Regards,
John Adams
ComponentOne LLC
|
|
|
|
|
|
i want you to Say with me
next time i will google before i post in a Forum
here is what you are looking for in Google.
http://www.google.co.za/search?hl=en&q=byref+and+byvalue&meta=[^]
it will help
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sudden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|