I am trying to build an autorun application for windows 7 and I need to retrieve a drive's VOLUME serial number (the one that changes when you format it)
With this code i check the serial serialnumber of a usb stick.
[code]...
It is not perfect because the programma crash when there is no usb in de PC.But how do i search fot the sctick if it has a name , for example PPH ? And not G: , because it is everytime a different station.
I'm using MS ACCESS for my dbase..i have a tblborrow where you can find transac_num ..now, i have in my form a label which here, you can see how many transactions you have done already(i'll name it sa lbltransacno) and a save button..what i want now is that.. every time the user save a transaction.. the lbltransacno will automatically go to its next number.. but of course.. the user should fill up the information needed.. if those are not filled up, and he click the save button.. the transaction will not be counted.. how to code it?
I want to generate a serial number in this format: INDDMMYY000001, INDDMMYY000002, INDDMMYY000003, ... I can generate INDDMMYY using following code: lblNoSiri.Text = "IN" + Date.Now.ToString("ddMMyy") However, I don't know how to generate the last six digit number. I only can generate number without zero in front of it. How to create the number with fix number of digit?
I get this error at the Commit of a transaction in a desktop application:
This OleDbTransaction has completed; it is no longer usable.
Other posts I have seen with similar error suggests this can occur if it takes a long time, or contains large amounts of data. This is not the case here.Logging tells me it takes 140 ms from Begin to Commit and about 10 commands executed inside the transaction.It is using an Oracle database.This class is a simplified version of my database class:
Class MyDatabase Private mConnection AS OleDbConnection Private mTransaction AS OleDbTransaction
[code]....
Is it not allowed to run a select inside a transaction like this? Or can it be done by running the transaction in a specific isolation level (I see that the BeginTransaction method has an optional parameter for doing this) ? ..Or some other sollution..? In my case, it was not a problem to move the select to run before the transaction started, but what if you need to run selects that must run inside the transaction?
I've seen plenty of examples of transactions in the actual store procedure's SQL. But I'm wanting to do the transaction and keep track of it in code. I tried this but it says that my insertcommand's transaction object is null. How can I fix this?
vb Dim conn As SqlConnection = DBConnections.SQLServerConnection conn.Open() Dim params(1) As SqlParameter
Error : Execute requires the command to have a transaction object when the connection assigned to the command is in a pending local transaction. The transaction property of the command has not been initialized..
This one causes the error: Dim oOperation As COperationOutputTypeBS oOperation = COperationOutputTypeBS.GetOperationOutputType(txtOperationCode.Text)
I would like to know how to convince the SaveFileDialog to overwrite a read only file. Currently, it is throwing up a dialog and not even getting to my FileOk method.
I have some code that fills my datagridview (VulDgv) I also have some code that exports the datatable to an excelfile (DatatableToExcel). All works pretty good. However...when I export to an existing file I get 2 warnings, first is the "file exists overwrite" warning from the savefiledialog. The second message is the "excelfile exists" from excel itselve. (is it possible to hide this message?) My real problem is after the 2 messages the code APPENDS the data to the excel file instead of overwriting it.
How can I save an Excel-file, which I'd edit with VB.NE, to a file, which already exists? Evertime there is a dialog: File already exists. Do you really want to overwrite? YES|NO|Abort
I'm using this code to generate machine signature. But it's take noticeable time to execute.
Public Shared Function DriveSN(ByVal DriveLetter As String) As String Dim disk As ManagementObject = New ManagementObject(String.Format("Win32_Logicaldisk='{0}'", DriveLetter))
Dim Q As New SelectQuery("Win32_BaseBoard") Dim SearchString As New ManagementObjectSearcher(Q) Dim Info As ManagementObject For Each Info In SearchString.Get() TextBox1.Text += Info("SerialNumber").ToString() Next Its not working. I cant get my motherboard serial. Why?
what i want is to get the serial number of my cpu.i have used the code you give at your website,that refers at the function GetProcessorId, at 3 different pc's,where all these pc's were using cpu's of the company INTEL.so my problem is that i took the same ID from the 3 pc's i used. is there any way that will make me able to get a real serial number from a cpu,that this serial number is unique?i am using visual studio 2008.do you have something to suggest?
I am making my first application which involves WMI.. Using the documentation provided by MSDN and the Forums I have managed to get data related to the Win32 Class (Computer Name, Physical Memory, IP Address, etc..) Now I would like to get the Serial number of the monitor. I believe I have to use the WmiMonitorID Class. However, I do not know the Syntax to access the property of the same. I had used the code below for the win32 class. How do I modify it for the WmiMonitorID Class?
Public Function OpSys() As String() Dim Str(4) As String ' ManagementObjectSearcher retrieves a collection of WMI objects based on[code]........
What is missing is a way that when I give a print click on the quantity of copies informed skirt with sequential numbers without repetitionex.: 10001, 10002, 10003
The PC has VB program.The VB (running over XP operation system) communicates through USB to RS232 and communicates with electronic board.I found out the when the XP allocate port number more then (estimation) 16, the VB program have problem to communicate with the board.(The problem disappears when the XP allocate port number less then 16).Is VB can handle port number that have high number (like com 45 etc')? and how...Can I force the XP to automatic allocate port number less then specific value?
OS: windows 7 64-bit /Programming Language: Visual Basic.net on Visual Studio 2010 express edition.I have dataset with 4 tables each one of them is a datasource to a datagridview I want to add a serial number column to the datagridview so I made this
DataGridView1.Columns.Add("serial", "SER.") For x As Integer = 0 To (ds.Tables("workers").Rows.Count - 1) DataGridView1("serial", x).Value = (x + 1) Next
It was working fine untill I added a relationship to the dataset the relationships codes were
Dim relation_WC As New DataRelation("relation_WC", ds.Tables("workers").Columns("id"), ds.Tables("cources_jun").Columns("workerid")) Dim relation_WV As New DataRelation("relation_WV", ds.Tables("workers").Columns("id"), ds.Tables("vacations_jun").Columns("workerid"))
[code]....
I breaked point the debuging and I found that the serial number column I added is fine and has it's values, but when I reach the line relations.add(the_relation) the serial number column loses it's values and turn into an empty column with no numbers in it....why this is happening?
Note: I added another relations but the only relations that clear the serial number column are the relations that has a datatable that is a datasource to the datagridview that has the serial number column.
I have devices with unique serial number (string incremetation) ex : AS1002 and AS1003. I need to figure out an algorithm to produce a unique activation key for each serial number. What would be the best approach for this ?
How can I retrieve HDD Firmware Serial number in .net? I am able to retrieve HDD Serial number using WMI calls but not able to find any way to retrieve HDD Firmware Serial number.
i am making a program in visual basic 2008 and when the program first starts up on acomputer/device i want it to come up with a screen that asks for a serial key. i also only want the serial key (that i give to the person i am giving the program to) to be accepted once.eg. if he copies the program and gives it to another person who takes it home, they have to enter a new one (that i would have to give them). if they enter the same key as person 1, i want to deny access.
I am using the following code to get the Motherboard serial:[code]But when i run the app, i get this error:A first chance exception of type 'System.NullReferenceException' occurred in Appname.exe..Object reference not set to instance of an object.