|
Hi i have one month records in my table...,
when i display the dates in my datagrid that sunday dates only want to show some other color...................
How to do that.............
-- modified at 6:18 Wednesday 28th March, 2007
Magi
|
|
|
|
|
i dont know where the dates in your code coming from.... but you can easily have the weekdays from a date......
the code is ..........
Dim myDate as Date<br />
Dim dayOfWeek as Integer=myDate.DayOfWeek<br />
if myDate is a MONDAY then dayOfWeek will have 1 and So on.....
you can check for the SUNDAYS in your dates by that.....
Tirtha
"A man can ride on your back only when it is bent....."
|
|
|
|
|
Dim dtMyDate As Date = Today()
You can loop through the dates and check as follows
if dtMyDate.DayOfWeek = DayOfWeek.Sunday then ...
|
|
|
|
|
Hi all,
i am pretty new to VB and i got one problem for which i can't find any answer (sorry if i'm simply too blind and this was already answered). Maybe i also start with too difficult issues.
Anyway, i'll just ask.
Is there any way to access the properties of a service and to display these information in a ListView?
In more details:
I got an application developed as a Windows Service. This application can be used several times as a service which means several instances of this service can be created.
My problem is that i would like to display the path the original exe-file of the according service/instance in a ListView.
I already managed to get the name an current status of the according service but i can't manage to display the according path.
I'll put a part of the code here (please be forbear with me i'm beginner):
--------------------------------------------------------------------------------
ListView is called LstGenvSrv
'List
LstGenvSrv.View = View.Details
LstGenvSrv.Clear()
'Columns
LstGenvSrv.Columns.Add("Service", 300, HorizontalAlignment.Left)
LstGenvSrv.Columns.Add("State", 70, HorizontalAlignment.Center)
LstGenvSrv.Columns.Add("Registered File", 350, HorizontalAlignment.Left)
Dim RunningServicesXXX As ServiceProcess.ServiceController
Dim ServiceList As ListViewItem
For Each RunningServicesXXX In ServiceProcess.ServiceController.GetServices()
If RunningServicesXXX.ServiceName.StartsWith("XXX Service") Then
ServiceList = New ListViewItem(RunningServicesXXX.DisplayName)
ServiceList.SubItems.Add(RunningServicesXXX.Status.ToString)
I played around here but i am not able to...
LstGenvSrv.Items.Add(ServiceList)
LstGenvSrv.Refresh()
End If
Next
--------------------------------------------------------------------------------
In Column "Registered File" i'd like to display the path to the original exe-file for a better overview.
Is this easily possible? The only other possibility i know is by accessing the Registry. Searched through all items of ServiceProcess / ServiceProcess.ServiceController but did not find anyhing.
Some person told me to use some API-Functionality but i thought with .Net this is more or less obsolete.
Thanks for your help.
Mr.Zylinder
|
|
|
|
|
Hi all,
I have an asp.net webform which is exporting a crystal report in to Excel format. But what I need is, I would like to format the excel cells so that it should adjust the cell size or wrap the cell according to the data given in it by using VB.Net. If anybody know it pls. advice me or give me some code snippet if possible. Thank you.
Regards,
S/W Engineer
Akebono Soft Technologies
aleem_abdul@akebonosoft.com.
|
|
|
|
|
my project code is:
Imports System.Data.OleDb
Public Class Form1
Inherits System.Windows.Forms.Form
Public mycon As New OleDbconnection
Public mycomm As New OleDbCommand
Public d As New OleDbDataAdapter
Dim i As Integer
Public strquery As String
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
mycon = New OleDbConnection("provider=msdaora.1;user id=scott;data source=;password=tiger;")
mycon.Open()
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
strquery = "insert into bhawna values(? ? ?)"
mycomm.Connection = mycon
mycomm.Parameters.Add(New OleDbParameter("name", OleDbType.VarChar, 10, "name"))
mycomm.Parameters.Add(New OleDbParameter("class", OleDbType.VarChar, 10, "class"))
mycomm.Parameters.Add(New OleDbParameter("roll_no", OleDbType.Char, 5, "roll_no"))
mycomm.Parameters(0).Value = TextBox1.Text
mycomm.Parameters(1).Value = TextBox2.Text
mycomm.Parameters(2).Value = TextBox3.Text
mycomm.CommandText = strquery
i = mycomm.ExecuteNonQuery
MsgBox("record submitted")
End Sub
End Class
i m having problem in line
i=mycomm.executenonquery
can ny1 tell why this error occur
|
|
|
|
|
replace the error line with this one
mycomm.ExecuteNonQuery
|
|
|
|
|
bhawna_k wrote: i m having problem in line
i=mycomm.executenonquery
can ny1 tell why this error occur
Can you tell us what the error is? Knowing what exception was thrown and the message helps a lot in determining what the error is so that a solution can be found.
|
|
|
|
|
An unhandled exception of type 'System.Data.OleDb.OleDbException' occurred in system.data.dll"
this error occur
|
|
|
|
|
I'll repeat my request with the important bit highlighted: Knowing what exception was thrown and the message helps a lot in determining what the error is so that a solution can be found.
|
|
|
|
|
Can someone help me on my problem.
I'm new in vb and i want to create a report using the designer but i get this error invalid datasource. Where could i have gotten wrong?
Below is my code.
Private Sub cmdprnt_Click()
Set pdbsched = OpenDatabase(App.Path & "\schedule.mdb")
sql1 = "SELECT fldschedEmpID, fldscheddate, fldschedAirline, fldschedDoD, fldschedDoA "
sql1 = sql1 & "FROM tbltripbooking "
Set rs = pdbBook.OpenRecordset(sql1)
rs.MoveFirst
SchedRep.Show
rs.Close
End Sub
|
|
|
|
|
Private Sub cmdprnt_Click()
Set pdbsched = OpenDatabase(App.Path & "\schedule.mdb")
sql1 = "SELECT fldschedEmpID, fldscheddate, fldschedAirline, fldschedDoD, fldschedDoA "
sql1 = sql1 & "FROM tbltripbooking "
Set rs = pdbBook.OpenRecordset(sql1)
set Schedrep.datasource=rs
SchedRep.Show
rs.Close
End Sub
|
|
|
|
|
How can we change paper orientation dynamically by using default printer setup in Visual Basic ? I tried with 'Printer' object but it is not working.
|
|
|
|
|
|
What do you mean with a "hyperlink text"? Is that a label that is made to look like a hyperlink, or should you have asked this question in the Web Development forum instead?
---
single minded; short sighted; long gone;
|
|
|
|
|
What do you mean popup window? are you referring to the messagebox?
|
|
|
|
|
how do i declare a class i have created in a windows application
|
|
|
|
|
to declare an object variable write something like this:
dim yourobject as yourclass
to initialize/create the object write something like this:
yourobject = new yourclass
|
|
|
|
|
how do i start a timer from the toolbox and how do i declare it.
|
|
|
|
|
your question is very confusing...what do u mean by
start a timer from the toolbox ????
whatever.....you can create a Timer in runtime........like this
1.declare a Timer variable like this......<br />
Private WithEvents myTimer As Timers.Timer<br />
<br />
2.write a function SetUpTimer() like......<br />
<br />
Public Sub SetUpTimer()<br />
Try<br />
myTimer = New Timers.Timer<br />
With myTimer<br />
.AutoReset = True<br />
.Interval = 1000<br />
.Start()<br />
End With<br />
Catch obEx As Exception<br />
Throw obEx<br />
End Try<br />
End Sub<br />
3.Wherever you want your timer to start working call SetUpTimer()
Tirtha
"A man can ride on your back only when it is bent....."
|
|
|
|
|
Hi ,
I want to consolidate two or more rows in a excel sheet from VB.
Plz help.
Ahmad
|
|
|
|
|
is that you are trying to read data from two excel sheets and do some process on the data read.
can u please explain what you are looking for.
Regards
KP
|
|
|
|
|
Hello,
[VS 2005]
Using typed dataset
I have a table adapter that is filled. I want to delete all the previous data that is in the database before filling this table.
Is there a single command that can be used to delete every single row in the database table, then issue the fill command.
With the delete command you have to enter the fields. However, I don't have the name of the fields values until after the table is filled.
Just want to fill the table with fresh data.
Many thanks,
Steve
|
|
|
|
|
try this.
[DatasetName].Tables(0).Rows.Clear()
the zero value pertaining that you only have one table in the dataset.
hope this hepls.
|
|
|
|
|
I would suggest that you can go ahead and write a SP itself that deletes or truncates the table entries.
You can call this SP from TableAdaptor followed by this use the SP to fill the table
Regards,
Jaiprakash M Bankolli
jaiprakash.bankolli@gmail.com
|
|
|
|