|
Load DEnvAparoAtt
With DEnvAparoAtt
If .rsDcmd_OneSubjAtt.State <> 0 Then .rsDcmd_OneSubjAtt.Close
End With
Rpt_SpecificSubjectAtt.Sections(2).Controls(2).Caption = cmb_fac.Text & " ( " & cmb_group.Text & " ) Part-" & cmb_part.Text & " Section ( " & cmb_sec.Text & " ) " & cmb_shift.Text & " " & cmb_Ses.Text & " Student Attendenace For " & Cmb_subject.Text
Rpt_SpecificSubjectAtt.Refresh
If Rpt_SpecificSubjectAtt.Visible = False Then Rpt_SpecificSubjectAtt.Show
i write this code and the data report not show refresh report?
|
|
|
|
|
Hi
I want to use C++ .net based class library in my vb.net project.
there is class library called "CClass" it contain class called "Class1"
i wrote the code in form.vb
Dim obj As New Class1
but it gave me an error " Statement is not valid in a namespace."
guys plz help me.
|
|
|
|
|
|
hai every body,
am using VS 2005 and using vb.net, vb is my code begin, my problem is in one combo box i was given all the months(like Jan 07, Feb 07...........,Dec 10)on the next Text box it should automatically retrieve no of days ie 30 or 31 am trying to write for combo changed event and also combo click event But it wont work. How To Solve my issue Please help
|
|
|
|
|
urtextboxname.text=urcomboboxname.selectedindex.text
or simply write
urtextboxname.text=urcomboboxname.text
|
|
|
|
|
Thanks For Your Reply. But It wont work. could you read my question?
If the combo box value is jan 07 then the next text box would automatically changed to 31, if the combo value is feb 07 then the text box value automatically changed to 28. Is it Possible. Please help me?
|
|
|
|
|
Try starting with:
On selectedindexchanged:
Dim subStr As Integer<br />
If Me.ComboBox2.Text.Contains("jan") Then<br />
subStr = Me.ComboBox2.Text.Substring(Me.ComboBox2.Text.IndexOf("n") + 1, 3)<br />
Me.TextBox1.Text = DateTime.DaysInMonth("20" & subStr, 1)<br />
ElseIf Me.ComboBox2.Text.Contains("feb") Then<br />
subStr = Me.ComboBox2.Text.Substring(Me.ComboBox2.Text.IndexOf("b") + 1, 3) '1. note the change in the letter within the index of<br />
Me.TextBox1.Text = DateTime.DaysInMonth("20" & subStr, 2) '2. note the change in the second part of this daysinmonth.<br />
End If
Do for each month. The subStr part of this code extracts the year, assuming the indexof letter is the last the only one in the month component and also assuming that there is a space between the month and year and that the year is in a 2 number format. Please note that contains() is case sensitive and needs to be specific. If you do the year as 2007 as oppose to 07 then the "20" part must be removed from the daysinmonth part of the code.
Posted by The ANZAC
|
|
|
|
|
yest it so easy
Function MonthDaysNo(cmbstr As String) As Integer
dim str as string
str=left(cmbstr,3)
Select Case str
Case "Jan":
urtxtboxname.text="31"
Case "Feb":
Dim Mydate as DateTime = DateTime.Now
Dim MyString As String = MyDate.ToString("yyyy")
dim yr as integer
yr=cint(Mydate)
If yr Mod 4 Then
urtxtboxname.text = 29
Else
urtxtboxname.text = 28
End If
Case "Mar":
urtxtboxname.text="31"
Case "Apr":
urtxtboxname.text="30"
Case "May":
urtxtboxname.text="31"
Case "Jun":
urtxtboxname.text="301"
Case "Jul":
urtxtboxname.text="31"
Case "Aug":
urtxtboxname.text="31"
Case "Sept":
urtxtboxname.text="30"
Case "Oct":
urtxtboxname.text="31"
Case "Nov":
urtxtboxname.text="30"
Case "Dec":
urtxtboxname.text="31"
End Select
End Function
then in the item change change call this function by passing argument urcombobox.text
|
|
|
|
|
Actually it's even easier
'Date to test
Dim stringDate As String = "sep 07"
'Date object
Dim parsedDate As Date
'If our string is valid date show days in month
If Date.TryParse(stringDate, parsedDate) Then
MsgBox(Date.DaysInMonth(parsedDate.Year, parsedDate.Month))
End If
From what I can tell the 'TryParse' method will except 3 letter abbreviations for the month as well as the full name. It won't except 'sept' however so I hope that's not an issue. If it is you could do it a little differently by making your own enumerator.
Private Function Days(ByVal text As String) As Integer
Dim split As String() = text.Split
'An error could occur so catch it and return -1
Try
Dim month As Integer = [Enum].Parse(GetType(Month), split(0).ToUpper)
Dim year As Integer = CInt("20" & split(1))
Return Date.DaysInMonth(year, month)
Catch ex As Exception
Return -1
End Try
End Function
Private Enum Month
JAN = 1
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEPT
OCT
NOV
DEC
End Enum
|
|
|
|
|
Thanks A lot it was working very nice. thanks for all the others for your reply. thanks
|
|
|
|
|
Hi there!
Just I want to know how to add excel file data into Oracle Database table using VB6.0?
I appreciate if any one there to help me asap.
thanks and regards
M. YASEEN
|
|
|
|
|
use this link and get idea from this example
ww.Planet-Source-Code.com/vb/scripts/ShowCode.asp?txtCodeId=9042&lngWId=4
|
|
|
|
|
I would like to write a program that tells me how long my computer has been running and write this to a text file. I have found out browsing msdn that you need to use "Systemuptime" but does not give any SIMPLE WAY of doing this.
Would appreciate someone showing me the light at the end of the tunnel, so i can find my way home.
|
|
|
|
|
|
Thanks for the reply,
After a bit of research I got it to do want i want .
Now i can get on with the next bit.
|
|
|
|
|
How can i run my application in safe mode? Do i need to create service? If true then please can anyone send me sample service becose i have never bin working with any of them.
Thanks...
|
|
|
|
|
Uhhh...What do you mean "Safe Mode"?? Windows doesn't have a safe mode that you can run just one application in. It runs the entire O/S in safe mode, meaning stripped down, only the basic essentials and generic drivers for the basics.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Dave.K. be a friend!
You know what i mean if i asked that i have to create a service, i need that it runs in safe mode like in windows so i enter safe mode and my application starts up automatically...
Understand?
Thanks... Dave.K.
|
|
|
|
|
No. All services in Windows, that are not essential to running Windows in Safe Mode do not start. AFAIK, you'll have to start it manually in Safe Mode. Why is this even a concern when Safe Mode is rarely ever used??
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
i am building an security program that locks system untill you enter password buth if you go to safe mode you can delete it from startup and enter the windows... please help me...
|
|
|
|
|
There is nothing you can do to prevent this. The only way you're going to get any near this kind of functionality is to replace MSGINA.DLL with your own implementation. Sorry, can't be done (nicely!) in VB.NET...
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
do you have sample of this or can you tell me how to do it?
|
|
|
|
|
Nope. Every example you're going to find, the few that do exist, will be in C++. Like I said, you really can't do that in VB.NET.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Besides, if all your "security" app is is a service, it's not going to protect much. At least, no different than turning on the password option on the ScreenSaver tab.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
well thanks...
|
|
|
|