vb.net-2010

Multi Key Hotkeys in VB 2010

孤街浪徒 提交于 2019-12-11 11:33:38
问题 I've written a simple WAV player in VB 2010 - a Windows Form App with no menus. I'm trying to create a hotkey, like CTRL-D that would make a text box visible. Typing the correct password in the box will expand the form and show some Administrative functions. I'm having issues creating the hotkey with more than one key. I've got the following code, but it does not work. I do have KeyPreview set to True. Private Sub _KeyDown(sender As Object, e As System.Windows.Forms.KeyEventArgs) Handles Me

DataSet.Designer.vb does not get updated

≯℡__Kan透↙ 提交于 2019-12-11 11:16:30
问题 I have added some fields in my database table and added them on my dataset with the help of the wizard. In my code I have two queries an insert and update which do not pick up the changes made to the dataset. This means that they are some somehow forgotten to get updated. Therefore, when I type this: Me.TransactionTableAdapter.updTransaction(1,2,3) it works using the previous database version instead of being like this Me.TransactionTableAdapter.updTransaction(1,2,3,4) Any ideas how to get it

ASP.NET 4 ACCESS DATA TO APPLY TO NavigateUrl

。_饼干妹妹 提交于 2019-12-11 10:04:50
问题 I am currently learning .net and have come to a brick wall with trying to implement url rounting. I have most of it working fine, but I am trying to generate hyperlinks from information in my database. I am getting the data out fine using: 'portfolio navigation data Dim rdrPortfolioNav As SqlDataReader Dim cmdPortfolioNav As SqlCommand = New SqlCommand() cmdPortfolioNav.CommandText = "SELECT TOP 6 [id], [date], [client], [category], [title], [body], [website], [navimage], [navdesc] FROM

Insert multiple rows in access database using oledb parameters

[亡魂溺海] 提交于 2019-12-11 09:49:09
问题 I am trying to insert multiple rows in a listitems to a database using parameters. But it won't give me any errors, and also won't insert any data in the table. does anyone have any ideas on this one? strSQL = "insert into tbltrans2 (transid,itemcode,itemname,qty,price,[total],btw) values ( ?,?,?,?,?,?,?)" Using cn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Application.StartupPath + "\\POS.mdb"), _ cmd As New OleDbCommand(strSQL, cn) cmd.Parameters.Add("?",

How to bind a DataGridView to a list of custom classes

拥有回忆 提交于 2019-12-11 09:38:12
问题 I have a list of custom classes that I am building using a TableAdapter . I want to add these to a DataGridView binding certain columns only. I have tried the code below to fill and bind the data: lAllBookings = (From r As DataRow In BookingsTableAdapter1.GetDataWithItems().Rows Select New Booking With {.bookingID = r.Item("BookingID"), _ .itemID = r.Item("ItemID"), _ .bookedOutDate = r.Field(Of DateTime?)("BookedOutDate"), _ .bookedInDate = r.Field(Of DateTime?)("BookedInDate"), _ .identType

Printing scrollable form

半城伤御伤魂 提交于 2019-12-11 08:45:27
问题 I have a scroll-able form which I would like to print entirely. I have already tried using this code to print it: Private Sub btnPrint_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPrint.Click Me.PrintForm.PrintAction = Printing.PrintAction.PrintToPreview Me.PrintForm.Print(Me, PowerPacks.Printing.PrintForm.PrintOption.Scrollable) End Sub And the result isn't accurate at all. To demonstrate my issue, here are some photos: This is the result I want (Of course I

Launch and watch a process from VB.NET 2010

橙三吉。 提交于 2019-12-11 08:25:43
问题 I am working on an application that needs to launch Microsoft Word, and then resume when the user closes Word. The code below should work, but it does not. I get an 'object not set to an instance of an object' 1 Dim pInfo As New ProcessStartInfo 2 Dim P As New Process 3 pInfo.FileName = "C:\test\LLR.doc" 4 P = Process.Start(pInfo) 5 ''# Here is where it goes bad 6 P.WaitForInputIdle() 7 P.WaitForExit() I put p into the watch window and it shows a a system.diagnostics.process in the watch

VB.Net Method appears to be called multiple times when it actually isn't, and returns inconsistent results

隐身守侯 提交于 2019-12-11 08:13:43
问题 I have been staring at this problem all day and I'm completely baffled by what I'm seeing. There are two issues occurring, and unfortunately, one of them only happens in Production so I can't test it the way I'd like. I will give all the background and relevant information up front with the code at the end. Some of what I say in these next couple sections won't make much sense until you review the code. Background info: (I have triple verified all this information) This class is being called

Detect -Debug and -Verbose function parameters in VB.NET

被刻印的时光 ゝ 提交于 2019-12-11 08:06:01
问题 I am using Microsoft Visual Studio 2008 Visual Basic, and am creating a custom PowerShell Cmdlet. How do I detect if either the -Verbose or -Debug parameters are used? I have tried If Debug.IsPresent Then , but that does not appear to work. 回答1: You have to examine the parameters that are passed into the cmdlet. Use the $PSBoundParameters automatic variable to determine which parameters were specified. For more information, see: Get-Help -Name about_Automatic_Variables; 回答2: It is not VB.Net,

having trouble updating/edit database

北慕城南 提交于 2019-12-11 07:57:04
问题 I want to create an application where I can register person info. but I am having a problem updating/edit the data in my gridview. Below is the set of code which I've created. Imports System.Data.SqlClient Public Class Form1 Dim connectionString As String Dim cnn As SqlConnection Dim cmd As SqlCommand Dim sql As String below is my ADD statement and it work just fine Private Sub btnADD_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnADD.Click connectionString =