|
Hi all,
How can my VB.NET program checks whether the MS Excel is installed on the machine. Is there any .NET library that let me to check whether particular application is installed on the computer?
Thanks in advance.
|
|
|
|
|
You could do one of two things.
1) You could search for the installed files. Excel.exe
2) You could try an instance the excel object via com.
Forever Developing
|
|
|
|
|
Hi,
I would like to try the second approach. However, how do I know I failed to create the COM instance is the error that the machine is not installed the MS Excel?
Thanks for replying.
|
|
|
|
|
Put the code in a Try/Catch block! Believe me, if Excel is not installed, it'll bomb as soon as you try to create the object.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thanks for reply.
But there are many possible reasons for failing to create an instance of COM in TRY .. CATCH... How do I know that error is caused by the MS Excel not installed?
|
|
|
|
|
Yes there are and that's why you check for the exception type in the Catch code.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I have been tasked with writing some code to support several internal users using VoIP. The requirements on the server side call for me to create a PBX style system that allows an operator to answer incoming external calls and forward them to their VoIP extensions. On the client side, the requirement is to be able to connect to the server and make internal calls to other users of the VoIP software. Any Ideas???
Thanks
Douglas Davis
Xenolith Technology Group
|
|
|
|
|
|
I'm having problems updating an SQL database from a web service. i think the problem is permisions although i could be wrong.
I'm pulling the data from the service into a datagrid, editing then sending back to update database, the data never changes.
im using VS to build the relevent dataAdapters conn etc
code....
Web service
'this is the call to receive the jobs from the service and this works fine
_
Public Function GetJobs() as JobsDataset<br />
dim ds as new JobsDataset<br />
JobsAddapter.Fill(ds,"Jobs")<br />
return ds<br />
end function
'ok once i've got the data i bind to a data grid, make some changes then send the dataset back.
'This is where the problem happens ,,, ive got error handling in the sub
' but it has no errors it steps through the code and every thing seems to work
' but the data is not updated
Public Sub UpdateJobs(ByVal dsJobs as JobDataset)<br />
If Not(dsJobs Is Nothing) then<br />
JobAdapter.Update(dsJobs)<br />
dsJobs.AcceptChanges()<br />
end if<br />
End Sub
Ive added ASPNET to the SQL Server and i think the permisions are correct but
im sure it's permisions thats causing the data not to b writen
any help would be great
|
|
|
|
|
In my UserControl I have several classes and some of which are Public because the UITypeEditor requires them
to be Public when using the editor to add members to my collection during design time in the IDE. Not a problem
there but when I add my UC to a test project all the Public classes are added as "separate" controls in the toolbox.
Is there a way to limit what is exposed in the toolbox other then making the classes Private or Friend?
Thanks for any help.
|
|
|
|
|
I got the answer on another forum.
<system.componentmodel.toolboxitem(false)> _
Public Class MyClass
'
'
'
End Class
Enjoy
|
|
|
|
|
How do you format DateTime values in a comboBox to display the date only without the time ("mm/dd/yyyy") in the text box as well as in the list. The ComboBox is bound to a datetime field in MS Access (Jet.OLEDB.4.0) ?
Thanks very much.
|
|
|
|
|
I need code to create a shortecut in vb4 onto the main win screen
|
|
|
|
|
Did I hear you correctly? Did you say VB FOUR??
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Expertise: Intermediate
Language: VB4,VB5,VB6
January 22, 2000
Create an Internet shortcut
Unlike regular LNK shortcut, which contain data in binary file, Internet shortcut files are just text files in this format:
[InternetShortcut]
URL=www.domain.com
Thus it is simple to programmatically create an Internet shortcut that, when double-clicked, will load the default browser and have it point to the specified URL. Here is a reusable routine that does it all:
' Create an internet shortcut
'
' when double-clicked, this shortcut will
' load the default browser and point it to
' the specified URL page
Sub CreateInternetShortcut(ByVal FileName As String, ByVal URL As String)
Dim fnum As Integer
' an Internet shortcut is just a two-line text file
fnum = FreeFile
Open FileName For Output As #fnum
Print #fnum, "[InternetShortcut]"
Print #fnum, "URL=" & URL
Close #fnum
End Sub
|
|
|
|
|
how can i make datagrid with check ???
i want that to delete the entries of a table whose corresponding entries in checkbox are select
"its like yahoomail"
all the message are deleted whose checkbox are selected
i want same functionality
plz help
|
|
|
|
|
i want to retrieve of a table whose schema and other constraints i do not know
basically , i had given user opurtunity to browse the database (and select any table) and based on that i will display the priary keys(if it does not had primey keys then a msgbox will be displayed)
is there any method to know wheteher table has primary keys and to bind that column to the combobox
plz help
a code snippet will be more helpfull....
|
|
|
|
|
You can use the stored proc sp_primarykeys
Best of luck
Forever Developing
|
|
|
|
|
i m using ms access
plz help me
code will be very useful
|
|
|
|
|
I was not sure if you were using OLEDB or ODBC so I did it in OLEDB.
Private Sub cmdFindPrimary_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdFindPrimary.Click
Try
Dim ConnString As String = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=V:\VBScratchPad\test.mdb;"
Dim cn As OleDbConnection = New OleDbConnection(ConnString)
cn.Open()
Dim da As New OleDbDataAdapter("Select * from Test", cn)
Dim ds As New DataSet("TESTING")
da.FillSchema(ds, SchemaType.Mapped)
For i As Integer = 0 To ds.Tables(0).PrimaryKey.GetUpperBound(0)
Console.WriteLine(ds.Tables(0).PrimaryKey(i).ColumnName)
Next
Catch ex As ApplicationException
MessageBox.Show(ex.ToString())
End Try
End Sub
Best of Luck
Forever Developing
|
|
|
|
|
i had written the code but i m still getting exceptions
here is my code
con is oledbconnection
adap is oledbdataadapter
ds is dataset
con = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Password=;User ID=Admin;Data Source=D:\Documents and Settings\sumit\My Documents\db1.mdb")
adap = New OleDbDataAdapter("select * from table4", con)
ds = New DataSet("testing")
adap.FillSchema(ds, SchemaType.Mapped)
Dim i As Integer
Try
For i = 0 To ds.Tables("table4").PrimaryKey.GetUpperBound(0)
combobox1.items.add(ds.Tables("Table4").PrimaryKey(i).ColumnName())
Next
Catch ex As System.Exception
MsgBxox(ex.Source + " " + ex.Message + " " + ex.ToString)
End Try
End Sub
and i m getting the exception
"object refrence not set to instance of object"
help plz
|
|
|
|
|
Not sure why this is but I found a solution to you problem
For i = 0 To ds.Tables(0).PrimaryKey.GetUpperBound(0)
ComboBox1.Items.Add(ds.Tables(0).PrimaryKey(i).ColumnName())
Next
it seems that when filling the schema you cannot refer to the table by its name but only by index number or the value "Table"
Forever Developing
|
|
|
|
|
it still not working
is there any method top get the name of that column.
|
|
|
|
|
Hi
I was wondering if there is anyway to use VB.NET 2003 to determine the bit rate of an MP3, If so how?
Thanks
- Colin
|
|
|
|
|
http://www.codeproject.com/vb/net/vbmp3header.asp
Read MP3 header information and read/write the ID3v1 tag
By Thommy Mewes
|
|
|
|