|
Not sure, but I guess this should help:
System.Security.Principal.WindowsIdentity.GetCurrent().Name
Yuvi Panda T
15 Year Old Microsoft Student Partner
Blogs at : http://yuvipanda.blogspot.com
|
|
|
|
|
This will again get Logged on user name.
|
|
|
|
|
check this article
http://www.eggheadcafe.com/articles/20011015.asp
|
|
|
|
|
Thanx, but This article is telling how to kill a process and not how to list the username of the process.
|
|
|
|
|
if you're working on a win 2k, xp or 2k3 machine, check into the system.management namespace. it allows you to connect to wmi which has the information you need.
-jim
|
|
|
|
|
The Process class doesn't expose this functionality. The best method, like Jim said, would be to use WMI and the Win32_Process[^] class. Once you get the list of Win32_Process objects, call the GetOwner method on each one to get the information you need.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
|
Example:
DisplayMember = "term1"
ValueMember = "t001"
how do I get value "t001" from this combobox?
|
|
|
|
|
did u try by using selectedvalue:
ComboBox1.SelectedValue.ToString
check also this article
http://www.dotnet247.com/247reference/msgs/58/293562.aspx
|
|
|
|
|
How do I perform an SNMP Get or Set using VB.Net??? Please provide code as I have no clue where to begin. Thanks in advance!
|
|
|
|
|
test@corbus-systems.com wrote: How do I perform an SNMP Get or Set using VB.Net???
Check this article
Tarakeshwar
MCP, CCIE Q(R&S)
A conclusion is the place where you got tired of thinking.
-- modified at 23:48 Wednesday 10th May, 2006
|
|
|
|
|
Hello,
Working with I have a DataTable with 46 columns..including AgentID. I'd like to get all the unique AgentID's in the table without looping, ect. I think I should be able to do this with a DataView and it's RowFilter property but I'm not quite sure what to set the property to. It looks like it works very similar to an SQL query so I thought I could do something like:
.RowFilter = " DISTINCT AgentID "
or something but it didn't work. Google was no help. Anyone have experience with this property?
Thanks!
"Half this game is ninety percent mental."
- Yogi Berra
If you can read thank a teacher, if you can read in English, thank a Marine.
|
|
|
|
|
|
Hi guys,
I started my project on VB, stating it was a Database application.
Doing that , the project was embedded to my database.mdb file, so now I could see a nice GUI of all my tables.
The thing is that I need to choose the mdb in runtime, using a "File Open" dialog box.
Me.ProductOrdersTableAdapter.Fill(Me.PlugDataSet.ProductOrders)
Me.PORowsTableAdapter.Fill(Me.PlugDataSet.PORows)
Me.PINSerialTableAdapter.Fill(Me.PlugDataSet.PINSerial)
Me.CustomizationTableAdapter.Fill(Me.PlugDataSet.Customization)
Me.FirmwareTableAdapter.Fill(Me.PlugDataSet.Firmware)
- All these (for example) have been added to my form1.vb code. the thing is that PlugDataSet and ProductOrdersBindingSource were all generated inside the project files. All I want to do is change the DB source in runtime.
How can I change the connection string for the mdb file and not affect all my code ?
Thx
|
|
|
|
|
Assuming that your dataAdapter is an OLeDB adapter.
Here is what you can do.
Change the connection string of dataadapter in button click event.open a fileopendialog box in the buttonclick event
'textPath is a textbox which displays the selected db path
Private Sub dbConnect_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles dbConnect.Click
OpenFileDialog1.ShowDialog()
txtPath.Text = OpenFileDialog1.FileName
Dim DBString As String
DBString = "Jet OLEDB:Global Partial Bulk Ops=2;Jet OLEDB:Registry Path=;Jet OLEDB:Database Locking Mode=1;Data Source=" & txtPath.Text & ";Jet OLEDB:Engin" & _
"e Type=5;Provider=""Microsoft.Jet.OLEDB.4.0"";Jet OLEDB:System database=;Jet OLEDB" & _
":SFP=False;persist security info=False;Extended Properties=;Mode=Share Deny None" & _
";Jet OLEDB:Encrypt Database=False;Jet OLEDB:Create System Database=False;Jet OLE" & _
"DB:Don't Copy Locale on Compact=False;Jet OLEDB:Compact Without Replica Repair=F" & _
"alse;User ID=Admin;Jet OLEDB:Global Bulk Transactions=1"
dataconn.ConnectionString = DBString
End Sub
I hope this helps
Mandar Patankar
Microsoft Certified professional
|
|
|
|
|
I am not too sure about what type of connection it is. It seems like when I started the project and chose a Database project, VB.Net made a class out of the database, named it and made methods for it.
I am not too familiar with VB, and all I found was XML files that define the connection strings...
And all came out of simply starting a New->Project->Database
I am quite lost with it,
Thx
|
|
|
|
|
My question is who is my dataconn which I should modify ?
|
|
|
|
|
Hi All,
I am working on VB6.0 app, and was wondering if I can call a VB.net executable from the VB6.0 application? Please let me know.
Basically, I want to avoid writing the new code in VB6.0, instead do that in VB.net
Thanks a lot!!
|
|
|
|
|
Shell (application path)
or
shell.execute(application Path)
not matter in which language and which application you are trying it will run
Rizwan Bashir
|
|
|
|
|
Which reference do I have to add, because if I put Application shows me a message error
PS: I'm using Vb Net 2003
|
|
|
|
|
In VB6 you can execute an app like this...
Private Sub Command1_Click()<br />
Dim myfile As String<br />
myfile = "C:\bin\WindowsApplication1.exe" ' where the app is example<br />
Shell (myfile)'call the app<br />
End Sub
in vb.net this is how you execute a file....
'imports....<br />
<br />
Imports System.Diagnostics.Process<br />
<br />
'code...
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click<br />
Dim myfile As String = "C:\bin\WindowsApplication1.exe"<br />
Dim myprocess As Process<br />
myprocess.Start(myfile)<br />
End Sub
hope this helps!
good luck
andy
|
|
|
|
|
Thank you all for your suggestions, it worked.
|
|
|
|
|
How can I show a master-detail relation in a single datagrid.
Can anybody help me.
Thank you
Suman
|
|
|
|
|
Create a master detail Dataset and there after bind that dataset to datagrid.
Mandar Patankar
Microsoft Certified professional
|
|
|
|
|
Mr. Patankar,
Can you provide me any URL where i can get a sample code on it.
Thank you,
with Regards
Suman
|
|
|
|