vb.net

Convert Data from SQL Server to DBF file (Date Error)

╄→гoц情女王★ 提交于 2021-01-29 18:00:36
问题 I want to export data from sql server to dbf file. Below query is working without date. But when I add date it's not working. Please solve my issue, thanks in advance. [Error is : Error in INSERT INTO] Dim dv As DataView = datacls.fnGetdata(sql_X, ClsDataConnection.DMode.D_DataView) Dim dt As New DataTable ' // assuming this is already populated from your SQL Database. Dim buildInsert As StringBuilder = New StringBuilder Dim connectionString As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data

Parent/Child ComboBoxes

若如初见. 提交于 2021-01-29 17:37:19
问题 I have 2 combobox, each having different items but somehow it's a hierarchy of characteristics of the next combobox ie: Combobox1 has VEHICLES, MOTORBIKES and NONE as items. I want to be able to choose Vehicles in combobox1 and Combobox2 updates with items only associated with vehicles ie Sportscar, Sedan etc. The same should happen when I choose Motorcycles in combobox1, it should update combobox2 with items only related to motorcycles. 回答1: Put this sample code inside the ComboBox1

Update statment using vb.net to update all fields

家住魔仙堡 提交于 2021-01-29 17:34:22
问题 I create table using sql developer create table tablenodes ( nodeNo int , nodeName varchar2(50), centerX int , centerY int, radius number(7,2), fileNo int ) And I want to update all fields in this table, so I wrote the following code: Friend Function UpdateNodeToTable(ByVal FN As Integer, ByVal nd As classNode) As Boolean Try Dim con As New OracleConnection con.ConnectionString = "Persist Security Info=False;User ID=manal;password=manal;Data Source=xe" con.Open() Dim cmd As New OracleCommand

Best practices on load a form inside a main form, both residing in an external DLL assembly

人走茶凉 提交于 2021-01-29 17:17:35
问题 I've loaded an external DLL into your project like this Dim assembly As Assembly = Assembly.LoadFile(libraryPath & "filename.dll") Dim type As Type = assembly.[GetType]("NameSpace.ClassName") // i'm loading as a form here but can be any control Dim frm As Form = TryCast(Activator.CreateInstance(type), Form) What are the best practices if you're loading a class or a control inside the loaded form (above) that resides also inside the same assembly ? for instance: Lets say you loaded an assembly

How do I define multiple EF DbContexts that share the same structure so they can use methods interchangeably?

落花浮王杯 提交于 2021-01-29 16:00:11
问题 I am using a single database design for 3 different SQL Server locations (production, backup, master). The design is simple, shown below for the production location: Public Class ProductionDbContext Inherits DbContext Public Sub New() MyBase.New("ProductionDbConnection") End Sub Public Sub New(connectionString As String) MyBase.New(connectionString) End Sub Public Property Tables As DbSet(Of Table) 'Table includes a List(Of Topic) Public Property Topics As DbSet(Of Topic) 'for direct access

Loopings In VB.NET (FOR EACH)

◇◆丶佛笑我妖孽 提交于 2021-01-29 15:39:11
问题 I am currently making a program in vb.net. it has lots of Text box inside of it. how do i clear them using for each loop. I have here my code but nothing happens in my program, my text boxes still have data. For Each txt As TextBox In personalInfo.Controls txt.Enabled = False Next by the way i have three group boxes with text boxes how do i clear all of text boxes with this code. 回答1: Use txt.Clear(); for clearing a TextBox. Are you sure that all controls in personalInfo are TextBoxes? If not

Is it possible to use String.Split() when NewLine is the delimiter?

好久不见. 提交于 2021-01-29 15:24:14
问题 I have a question which asks me to calculate something from an input file. The problem is, the lines in the file don't use any special character as delimiter, like , or | . I will show it down below. Data Communication 20 Visual Basic 40 The output I need to write to another file should look like this: Data communication 20 Visual Basic 40 Total Books : 60 The problem is, how can I specify the delimiter? Like when there is a symbol as in strArray = strLine.Split(",") . Since there is nothing

File Not Found error System.Data.SQLite, Version=1.0.113.0

帅比萌擦擦* 提交于 2021-01-29 14:53:43
问题 I have a WinForms project that is using System.Data.SQLite.Core with VS 2019 ver 16.7.2 with Net,Framework 4.8.03761 On a Windows 7 64 bit computer I will post a screen shot of my NuGet configuration I have used both PackageReference and Packages.config Here is the error after trying to run the installed project The EXE and MSI are created no error ************** Exception Text ************** System.IO.FileNotFoundException: Could not load file or assembly 'System.Data.SQLite, Version=1.0.113

Load data from SQL Server to datagridview using a thread

夙愿已清 提交于 2021-01-29 14:47:36
问题 I'm trying to load data from a SQL Server database into a DataGridView using threading with delegates and later will try to add a loading or waiting form. But I can't make it work. Dim t1 As Thread Private Delegate Sub delegate_updatedgv() Private Sub mainform_Load(sender As Object, e As EventArgs) Handles MyBase.Load t1 = New Thread(AddressOf load_dgv) t1.Start() End Sub Private Function load_dgv() Try If DBCon.State = ConnectionState.Closed Then DBCon.Open() End If DBCmd = New SqlCommand(

VB.NET 2010 - Extracting an application resource to the Desktop

女生的网名这么多〃 提交于 2021-01-29 13:43:56
问题 I am trying to extract an application resource from My.Resources.FILE I have discovered how to do this with DLL & EXE files, but I still need help with the code for extracting PNG & ICO files. Other file types also. (If possible) Here is my current code that works with DLL & EXE files. Dim File01 As System.IO.FileStream = New System.IO.FileStream("C:\Users\" + Environment.UserName + "\Desktop\" + "SAMPLE.EXE", IO.FileMode.Create) File01.Write(My.Resources.SAMPLE, 0, My.Resources.SAMPLE.Length