vb.net

How to generate a new MS access file programmatically

痞子三分冷 提交于 2021-02-18 07:50:30
问题 I have looked far and wide, in the deepest darkest corners of the internet, but for the life of me, I can not find the correct way to open a NEW Access file and then using vb.net to write data in the database.. The keywords here are NEW database, I don't want to open an existing file. Is this even possible? Thanks in advance! 回答1: I have finally found the way, thanks to a co-worker of mine Neither ADO.NET nor ActiveX Data Object (ADO) provides the means to create Microsoft Access Database.

How do I call a function every x minutes in VB.NET?

ⅰ亾dé卋堺 提交于 2021-02-18 06:43:39
问题 How do I call a function every x minutes. I assume I'd have to add a timer to the form? 回答1: here is a simple example: Public Class SampleCallEveryXMinute Private WithEvents xTimer as new System.Windows.Forms.Timer Public Sub New(TickValue as integer) xTimer = new System.Windows.Forms.Timer xTimer.Interval = TickValue End Sub Public Sub StartTimer xTimer.Start End Sub Public Sub StopTimer xTimer.Stop End Sub Private Sub Timer_Tick Handles xTimer.Tick SampleProcedure End Sub Private Sub

How do i get the data to my database using vb.net (class, module and form)

霸气de小男生 提交于 2021-02-17 06:43:06
问题 I hope the title is enough to understand my problem, I already installed whats need to run the ADO.NET, I already have a connection string in my module and data query in my class, Imports System.Data Imports System.Data.OleDb Module GlobalVariables Public sGlobalConnectionString As String Friend conString As String Public dr As OleDbDataReader Sub Main() Dim sGlobalConnectionString As New OleDb.OleDbConnection Dim sDataserver As String Dim sDatabaseName As String Dim sDatabaseConnection As

Auto increment textbox in VB.NET

送分小仙女□ 提交于 2021-02-17 05:59:09
问题 How do I get to increment a textbox content after clicking on a button? 回答1: Place this in the button click event Dim int As Integer Integer.TryParse(TextBox1.Text, int) TextBox1.Text = (int + 1) 来源: https://stackoverflow.com/questions/2441883/auto-increment-textbox-in-vb-net

Trying to play sounds in console application VB.NET

与世无争的帅哥 提交于 2021-02-17 05:15:51
问题 I want to play a sound file to play in my console application but the following doesn't work: My.Computer.Audio.Play("[file path string]", AudioPlayMode.Background) When hovering over "my computer" it brings brings up the error 'Computer' is not a member of 'JapaneseHelper.My' . And when hovering over Audio.PlayMode it says 'AudioPlayMode' is not declared. It may be inaccessible due to its protection level. I have searched everywhere for this and can't find anything that shows me how to do it

Trying to make WinForms look good in 4K but forms too large after using AutoScaleMode.Dpi?

被刻印的时光 ゝ 提交于 2021-02-17 05:14:43
问题 Here is the situation: I have a form frmCompanyMasterEdit which inherits frmBaseEdit , which inherits frmBase , which inherits System.Windows.Forms.Form . These are all WinForms. So, I am trying to get frmCompanyMasterEdit (a form that lets the user edit details about a company; really all forms but this is just for example) to be 4K compatible, which is why I have changed the property from Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font to Me.AutoScaleMode = System.Windows.Forms

VB.net to MySql Stored Procedure Error

☆樱花仙子☆ 提交于 2021-02-17 04:28:32
问题 I'm a total newb to stored procedures, so I may be missing something easy, but I researched the basics and I'm stuck trying to integrate it from vb.net code. I created a simple stored procedure (I think) that just runs a query of data for today's results: -- Routine DDL -- Note: comments before and after the routine body will not be stored by the server DELIMITER $$ CREATE DEFINER=`root`@`%` PROCEDURE `GetRuntestToday`() BEGIN Select * From runtest.runtest_records where Test_Date=CURDATE()

Using VB.NET to obtain macros in MS Access

独自空忆成欢 提交于 2021-02-16 20:46:06
问题 I'm trying to create a VB.NET button which will connect to an MS Access database and obtain a list of all the macros stored in the access database. After I have the list I want to display the values in a combobox. I've found something online similar to what i'm trying to do but I cannot find anything which will just give me a list of macros. Dim userTables As DataTable = Nothing Dim connection As System.Data.OleDb.OleDbConnection = New System.Data.OleDb.OleDbConnection() Dim source As String

Add name in My.Settings

≯℡__Kan透↙ 提交于 2021-02-16 20:19:58
问题 How to add a new name in My.Settings? So far, I've learned how to read and edit values in it, but how can I add another row/name at run-time? Something like: My.Settings.AddName.String("foo1") My.Settings.Save() My.Settings.foo1 = "fooNew" I can't see such on the web.. Thanks EDIT: will be used for the name,text and location of dynamically added buttons. SeeThisLink 回答1: The My.Settings application settings are compiled into your assembly. The properties cannot be altered at runtime because

Constructing an object without assigning it in Visual Basic.NET

旧城冷巷雨未停 提交于 2021-02-16 20:07:12
问题 I've used VB.net for several years now, but keep coming across little quirks that I don't know how to work around. Curiosity finally got the best of me, so I ask now: is there a way to create an object without assigning it? For example, say I have an Engine class, that I want to instantiate and have it immediately do whatever it needs to do. If there's nothing I need to do with Engine after creating it, I have, till now, done something like: dim myEngine as new Engine() Is there a way to