Get The Current State Of Num Lock?
Sep 2, 2009How do I get the current state of Num Lock in VB.NET?
View 1 RepliesHow do I get the current state of Num Lock in VB.NET?
View 1 RepliesI'm trying to detect the state of num lock but haven't had any luck. using a windows 7 x64 machine.
Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As System.Windows.Forms.Keys) As Short
'num lock check timer
[Code]....
I am making a little program for the Game "Flight Simulator X" and I need to monitor the Process state of the Program.My Main Question is How do you manage a Process so on a Label you can set maybe an If...Then...End If Statement to tell it what to say.
View 3 RepliesDuring Loading of form I call connectpaybox to show the list in the combobox, but after that it will result in the error "Operation is not valid due the current state of the object"
but the combobox items that was taken from the database shows. I tried
"select CAGECOST from CAGETYPE where CAGENAME like 'Normal'"
where Normal is one of the items in cagename and it works.
Private Sub Paybox_Load(ByVal sender As System.Object, ByVal e As
[Code].....
how can I get the current cursor state (Hand or IBeam or ...etc) .. at any active window not only at my form
View 3 RepliesOk, i am really in need of finding a way to do this via a string to clob instead of using the update query to to do all.
Dim theXMLCode As OracleClob
Dim OracleConnection2 As New OracleConnection()
Dim dr2 As OracleDataReader
[code].....
Before, my codes are working properly.. But not..I am getting this run time error. What the error means?
Operation is not valid due to the current state of the object.
During Loading of form I call connectpaybox to show the list in the combobox, but after that it will result in the error "Operation is not valid due the current state of the object" but the combobox items that was taken from the database shows. I tried "select CAGECOST from CAGETYPE where CAGENAME like 'Normal'" where Normal is one of the items in cagename and it works.
[code]...
Using VS 2005 and SQL Express 2005. This WinForm application runs fine on 5 out of 6 stand alone computers that is it installed on. The 6th computer is slightly older running XP sp2.As I understand it, using DbDataAdapter will perform the open, close and dispose functions for you. Therefore, Pooling should not be an issue. I am thinking that the default 15 second time out setting may be the cause?? There is some MultiThreading that will also use DbDataAdapters in the same manner but only 3-4 would be firing at the same time.The connection string is Data Source=(local)DataBase;Initial Catalog=Code;Integrated Security=True The command which throws the exception is If CodeDataAdapter.Fill(CodeDataSet.CodeTable) > 0 Then...So I am thinking that adding Connect Timeout = 60 to the connection string even though the 15 second default seems like a lifetime. Could this 15 seconds be eaten up if some other process or application takes over?
View 3 RepliesI am a ASP Classic Programmer, professionally for a little over a year, I have developed some rather nice sites, including the one in my signature (Still a work in progress).
I have been forced to use ASP.NET (VB) for a FileUpload control, as it offers a self controlled way of creating Thumbnails, without the use of 3rd party controls, which is great, as my hosting server does not allow for 3rd party installs on their servers.
So.
The code below is what I have so far for connecting to the database and displaying a record is the "cookie" exist on the users computer.
Unfortunantly, this is not working, and to be honest with you, their is not a whole lot of resources available to show how to do this correctly.
So I am stuck with a lot of post and hoping that someone can actually assist me with this and tell me what I am doing wrong and maybe correct my code.
I am getting an error about the "Connection is closed"
If you want to re-write my code, I prefer something simple and basic, as the only thing that I am doing to checking rather the user is logged in, and if so, display a record from the database. I am NOT in the need for the DataGrid, so please do not suggest it, as I am only needing to check this one thing.
I would like to also add, that I have successfully contect to my database with the FileUpload control and save file names of the images uploaded, so I know that my connection string is done properly> But, for some reason the "SELECT" statement is causing a HUGE issue. (It was easier to insert, than to select, I am not use to that)
CODE:
i have an application. which is executed after every 5 mins. i have an open connection but it gives me the following error:
ExecuteScalar requires an open and available Connection. The connection's current state is closed.
my code is something like this. I have shown where all i am using ExceuteScalar()
Sub Main()
Try
connection.open()
cmd.ExecuteScalar()
[code]....
Try If functionmode = "ADD" Then
[Code]...
I got this error..The connection was not closed. The connection's current state is open.
This is coding to add data in Ms access in vb...
Imports System.Data.OleDb Public Class Form1
[Code]...
I'm trying to insert a new records into database, one of those records is a "datetime"...when I type a wrong date, and try to insert those values into database, i get an error (about wrong typed date etc.)...ok, that's fine, things need to work that way. But here comes the problem, I correct the date, and then try to insert values again...here I get an error from the post title. And this doesn't work until I close that form and run it again...here's part of my code:
Dim cvLicence As New SQL
Try
cvLicence.upis("INSERT INTO blabla (itsnotimportant) VALUES ('something')")
MsgBox("everything's fine", MsgBoxStyle.Information)
[code]....
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
exitwithout()
[code].....
I have following link in a.aspx file:
<a href="a.htm" target="iframe">A</a>
I want to set link from a.aspx.vb page according to what person is viewing the page. How can i change this so that if user clicks on link it will replace current frameset contained in current window with a url provided according to user?
Or in another way:
How will i replace href code in aspx page by giving it value from aspx.vb page?
Is that possible to get current Enumerator (...or iterator? Don't know which tern is the correct one) in a LINQ query ? For example, I try to create a XML output (via LINQ to XML) of all currently loaded assemblies. [code] is it possible to somehow get current "index" (counter?) from LINQ's Selects? I would like to use it in XML. [code]
View 1 RepliesI have a datagridview having 3 columns (qty,scraft factor,actuall qty). What I want is if the user encode 50 in qty and 2 in scraf factor, actuall qty will automatically computed based on qty multiply by 2. I was using keyup event. Now I am using endedit to get the current value of the current row and column, now the problem is if the amount to be encoded is more than one digit it will not accept because of endedit. What event do I have to used? or any solution with this scenario.
[Code]...
Is there analogue of lock statement from c# in vb.net?
View 3 RepliesBasically,I had a button in my form1,when I click it,then form2 will be display...Now I would like to lock form2 until a button in form2 had been clicked,then only I can do anything in other forms...I means form2 must be closed before I can remain to form1.
View 1 RepliesVB.net how to lock a computer screen using a form
View 3 RepliesHow do I lock a row in MySQL and then only allow the app that locked it to change the values of that row?
View 7 RepliesWrote this code:
Function ReadRegistry(ByVal regType As String, ByVal RegPath As String, ByVal KeyName As String)
Dim regKey As RegistryKey
[Code].....
What I want to do is raise an error if I get passed a value that isn't listed in the case statement.. or it there a way to define it better?
I have a form and its filled from a VIEW of two tables on SQL server. When its opened i dont want other users opening that customers details from either table.I know SQL itself prevents writes if its opened but i want to stop people opening the record in the first place.[code]...
I then tried writing these values to the db on the form loading but it doesent work - it just sends back NULLs. I tried the same code in the on load event into a button and it works fine there. So im thinking i should do this as a Trigger on SQL itself, but im unsure how i could get the users computername or Windows Login name, or even username from the front end im building.
I am using XML files to store some iformation that are to be processed. I use this code to interact with the XML file:
Dim xmlDoc As New XmlDocumentxmlDoc.Load("theXMLFile")
Do XML stuff such as add elements...
xmlDoc.DocumentElement.AppendChild(oAlarm)xmlDoc.Save("theXMLFile")
What I want to do is to lock the file so that no other process can use the file. If a process wants to use the file, I also want it to wait and try again until file is available.
how to lock PC using VB.net? So that any user cannot do anything on my PC?
View 10 RepliesHow do I force users to save the current record (if current record has changed) and not let user go to the next record unless the save button is pressed?
View 5 RepliesBut not my application.A app i use refuses to be brought forward, so wondered if there was a way for a vb app to run in the bg that can force a specified application to stay on top, & even maybe set its screen position and lock it there???
View 6 RepliesIn my project i am using begin transaction commit or rollback changes. but this causes lock to the tables in that particular functionality.
So if the any other user does any other functionality those locked table are not available until the transaction is completed. I want to know if there is any alternative to transaction which insures data security but the tables are not locked out.
Dim bmi As New BitmapImage(New Uri(fiInfo.FullName, UriKind.Absolute))
bmi.CacheOption = BitmapCacheOption.OnLoad
this does not Use OnLoad
[code].....