|
Hi
You can iterate though the processes running on the machine to see if one is running with the same name as the current application. Code would look like
Dim currentProcess as Process = Process.GetCurrentProcess
Dim allProcesses as process() = process.getprocessesbyname(currentProcess.ProcessName)
For each process as Process in allProcesses
If process.Id = current.Id then continue for
If [Assembly].GetExecutingAssembly().Location.Replace("/", "\") = currentProcess.MainModule.FileName Then
'There is another version running
Throw new exception("Application already open")
end if
next
Thats just entered but should give you a good idae of how to code this...
|
|
|
|
|
run this on Form1_Load
If (UBound(Diagnostics.Process.GetProcessesByName(Diagnostics.Process.GetCurrentProcess.ProcessName)) > 0) = True Then<br />
End<br />
End If
|
|
|
|
|
Thanks for your flying reply its working for me
Thanks
Warm Regards
Prakash-B
|
|
|
|
|
hi,
go to Properties of Project & click on application tab
now click on checkBox related to "Make single instance application"
hope this helps
Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)
|
|
|
|
|
Thanks for your flying reply its working for me
Thanks
Warm Regards
Prakash-B
|
|
|
|
|
can anyone tell me where the SaveSettings function store the data in registry.
thanks
|
|
|
|
|
|
hi
i have extracted backend code of the webpage which looks some thing like this.
<title>orkut - Login
is an online community that connects people through a network of
trusted friends. We are committed to providing an online
meeting place for people to socialize, make new acquaintances
and find others who share their interests.
Join orkut now to create and connect with your own social circle.
Learn more about keeping orkut beautiful
|
| |
|
now i want to take only the the data which is in the table format and display it in tables in asp and vb.net.
i did this program. but am extracting the whole file(above code) into the tables but want to take only the data which is present in the table tags.
and also how to display a textfile data which does not have any table tags.
there is no such thing as good or bad.
|
|
|
|
|
Hey
Well you could parse the file for the tag you are looking for in this case , then get the tag and each tag then you know you are on the next row, repeat this until the tag and repeat the whole process.
You could do this by getting the whole file then loading it into memory and parsing it or using the StreamReader class.
Then display the information in the way you choose.
You can use msdn for any help but most of this problem is just working out the logic of what you need (which is explained above)
Hope this helps
Dan
|
|
|
|
|
Hi All,
Please anyone in brief define the Environment Class and when to take advantage of it.
Thanks & Wishes
Navneet Hegde
Nashik(City Of Pilgrimage)
-- modified at 0:48 Thursday 5th July, 2007
Develop2Program & Program2Develop
|
|
|
|
|
|
Hi D,
Thanks very much.
Respect & Regards
Navneet Hegde
Nashk(City Of Pilgrimage)
Develop2Program & Program2Develop
|
|
|
|
|
How can I convert a binary data from SQL to a byte array in vb.net? If any one knows how,
please kindly let me know. I appreciate your help. Thank you very
much.
|
|
|
|
|
What form does the data take, before you convert it ?
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Kind of new to crystal reports, so forgive me if this is simple.
Basically, all the information from a DB is displayed in rows, however when I click an ID of a row on the crystal report viewer, I get a blank page, and I really want the data to appear on this new page + mabe some headings etc
Help appreciated.
|
|
|
|
|
i want to program inputbox so if i click ok it's save value in variable or variable = nothing if i click cancel ewven there is value
notes
if i press space button more than once when i press ok button the variable return null value
md_refay
|
|
|
|
|
Sounds like you need to build your own control. This is VB6 ?
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hey all:
Is there any way in VB. Net to set background or foreground color whole column of datagrid?
-- modified at 0:14 Thursday 5th July, 2007
|
|
|
|
|
|
Hi,
I'm using VB.NET 2005 Express, and I'm having a go at teaching myself about threading as I want a marquee progress bar displayed on my form whilst it fills a table in a dataset.
On my form, I've got a textbox for a database name, and a textbox for simple Select SQL statements.
What I'm finding is that when I press 'Go', it populates the DataGridView perfectly, and my progress bar is displayed as I had wanted. However, what I then find is that if I change the contents of the database textbox, or the contents of the SQL textbox, and press 'Go' again, it either doesn't do anything to the DataGridView, or it completely falls over.
I'd really appreciate it if you could point me in the right direction to suggest some improvements to the very raw code shown below:
Imports System.Data<br />
Imports System.Data.OleDb<br />
<br />
Public Class Form1<br />
<br />
Private ds As New DataSet()<br />
Private conn As OleDb.OleDbConnection<br />
Private WithEvents backGroundWorker1 As New System.ComponentModel.BackgroundWorker<br />
<br />
' THREADING REFERENCES<br />
' http:
' http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1386086&SiteID=1<br />
<br />
Private Sub FillDataGridView()<br />
<br />
Dim strDataSource As String = Me.txtDataSource.Text & "@ol_server;"<br />
<br />
Dim strConnectionString As String = "Provider=Ifxoledbc.2;" & _<br />
"Password=informix;" & _<br />
"User ID=informix;" & _<br />
"Persist Security Info=True;" & _<br />
"Password=informix;" & _<br />
"Data Source=" & strDataSource.ToString<br />
<br />
conn = New OleDb.OleDbConnection(strConnectionString)<br />
<br />
Dim ds As New DataSet()<br />
<br />
backGroundWorker1.RunWorkerAsync()<br />
<br />
Dim i As Integer<br />
<br />
For i = 1 To 100<br />
<br />
Me.ProgressBar1.Value = i<br />
<br />
Next<br />
<br />
End Sub<br />
<br />
Private Sub btnGo_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnGo.Click<br />
<br />
Me.ProgressBar1.Visible = True<br />
<br />
Me.ProgressBar1.Refresh()<br />
<br />
FillDataGridView()<br />
<br />
End Sub<br />
<br />
Private Sub backGroundWorker1_DoWork(ByVal sender As Object, ByVal e As System.ComponentModel.DoWorkEventArgs) Handles backGroundWorker1.DoWork<br />
<br />
Dim da As New OleDb.OleDbDataAdapter<br />
Dim cmd As New OleDb.OleDbCommand<br />
<br />
conn.Open()<br />
<br />
cmd.Connection = conn<br />
cmd.CommandText = Me.txtSQLStatement.Text<br />
<br />
da.SelectCommand = cmd<br />
<br />
da.Fill(ds, "Table")<br />
<br />
conn.Close()<br />
<br />
End Sub<br />
<br />
Private Sub backGroundWorker1_RunWorkerCompleted(ByVal sender As Object, ByVal e As System.ComponentModel.RunWorkerCompletedEventArgs) Handles backGroundWorker1.RunWorkerCompleted<br />
<br />
Me.ProgressBar1.Value = 0<br />
Me.ProgressBar1.Visible = False<br />
Me.ProgressBar1.Refresh()<br />
<br />
DataGridView1.DataSource = ds<br />
DataGridView1.DataMember = "Table"<br />
<br />
End Sub<br />
End Class
|
|
|
|
|
What specific error are you getting when the app falls over?
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
When my app fills a table adapter with values, null values go in just fine. Doesn't matter what types the values are. But, in a separate operation, when I try to insert a row, I get null value exceptions, even for the values declared as NULLABLE. I guess I need to test each value by using .hasValue, but what I don't understand is why the fill works with no problem and the insert doesn't.
|
|
|
|
|
Hi Ken,
First of all, you probably mean that your app fills a DataSet with the use of an adapter.
Something like MyAdapter.Fill(MyDataset) . The DataSet aparently is set to ignore restraints, so the fill operation, which is basically nothing more than a read operation, works just fine. When you use your adapter's InsertStatement, you actually tell it to create new data in the source table (database). All therefore depends on the design of the table in your data source (database?), from its properties you can see which fields must receive a value.
Hope this helps,
Johan
My advice is free, and you may get what you paid for.
|
|
|
|
|
Johan, thanks for your clear explanation. Based on what you have pointed out, looks like I need to look more closely at the settings of the Access database that I am using--Ken
|
|
|
|
|
Hi,
I have a problem:I want to find the width of a word document.
I need it for my project.
Is a way to find this?
thanks.
|
|
|
|