Hi group, I'm attempting to populate a listview with data from my test database created via Visual Studio 2019. I'm getting a syntax error that says, "Incorrect syntax near the keyword 'FROM'." It's not clear to me what the error is. The code I've written is as follows: Dim strQ As String = String.Empty Dim datasource As String = "Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=C:\Users\Don\Documents\Visual Studio 2019\SalesForm\DWHRPT.mdf;Integrated Security=True" conn = New SqlConnection(datasource) Dim searchID As String = tbxCompanyName.Text strQ = "SEARCH CUST_ACCT_NO, CUST_COMPANY_NAME, CUST_FIRST_NAME, CUST_MIDDLE_INITIAL, CUST_LAST_NAME FROM CUSTREC WHERE CUST_COMPANY_NAME LIKE '" & searchID & "%'" cmd = New SqlCommand(strQ, conn) da = New …

Member Avatar
Member Avatar
+1 forum 5

Hi group, I've just installed Visual Studio 2019 and have started my first app using this. Within the program I created a database using the tools provided in Visual Studio. I now want to begin writing to the tables I've created. But I'm stumped on how to do this. Hopefully you can help. This database is installed on my laptop and is called DATAWHOUSE. Will I need some kind of connection string to write to the data table (and to read from it and/or make changes to it in the future)?

Member Avatar
Member Avatar
+0 forum 2

Hi this is my first time using this site, so please bare with me. I'm also pretty new at coding and got thrown into connecting to a database in one of my classes. But anywho, I keep receiving a syntax error and I was wondering if anyone could help me figure out why. Thank you! Imports System.Data Imports System.Data.SqlClient Public Class PatientForm1 Dim con As New SqlClient.SqlConnection("deleted for privacy") Private Sub TextBox1_TextChanged(sender As Object, e As EventArgs) Handles lname.TextChanged End Sub Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load End Sub Private Sub Label14_Click(sender As Object, e As …

Member Avatar
Member Avatar
+0 forum 2

I want when click on the Name Listed on a Listbox from the database to fill Textboxes with Username and Password of particular user from SQL database. I am able to see Names stored on the database on the listbox but when i click on the name its unable to fill the Textboxes. Here is the code that fills the Listbox with data from database (NOTE: I am able to view a list of names on the Listbox with the code below) Public Sub ListBox() Try If con.State = ConnectionState.Open Then con.Close() End If con.Open() Dim cmd As SqlCommand cmd …

Member Avatar
Member Avatar
+0 forum 4

dear all i have a invoice table now in that datagrid table i have 4 columns itemcode itemdescription qty price now what i need is user come to itemcode and whenever he type itemcode, he should get a list of initial alphabetic itemnames like if i type A so itemcode must show all items codes related to A and when i get my required itemcode, after pressing enter it should fill the related field (item description,qty,price) please guide with codes thanks

Member Avatar
Member Avatar
+0 forum 7

Hi everyone! I'm making an application which requires users with different permissions/previleges to login and use the application.For example, if the user is "admin", all menu items in the menu bar are shown and enabled. If the user is say "user_group1", some of the menu items are to be hidden. The same for "user_group2", "user_group3", "user_group4" and so on. I could put a code for each specific user in each form but that's a great deal since users and their user groups may be added after application deployment. So it has to be something flexible. I want the user "Administrator" …

Member Avatar
Member Avatar
+0 forum 24

Hi guys, i'm having a difficulty to set the path in vb.net.i put the code in the module and every time i run the code it throws error "Could not find file 'C:\Users\Abdueie\Desktop\BMS\Bridge Asset Management\Bridge Asset Management\bin\Debug\Adigrat.accdb'." here's the code Public conn As OleDbConnection = New OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0; Data Source= .\\Adigrat.accdb;Persist Security Info=False")

Member Avatar
Member Avatar
+2 forum 12

Hello all, I was wondering if I could get some questions answered about how cupons work in the work place. I have an idea which involves creating a very flexible cupon service, but would require knowing the rudiments of how cupons work. The main question I have is how is tax calculated on a ware as it is sold under a cupon service. I believe that would be the only thing I would have to stringently mandate as far as the cupon goes, since the institution wishes to clear the merchendise from the floor. The service would involve some C# …

Member Avatar
Member Avatar
+0 forum 3

Hey community, how can i show the connected USB-Device like keyboard, mouse, webcam and so on? Or how can i search in the connected USB-Devices, if I know the name or only a part of the name? I am looking for some examples since 2 days, but no one doesn´t work. So I hope you can help me with some code examples in vb.net. best regards joshi

Member Avatar
Member Avatar
+1 forum 21

Hello, I want to have a manual IP-input-box like windows. ![tcpip_properties.gif](/attachments/large/4/1b3cb2d2b7b2be11e2b4abcef8d6fcc5.gif) I tried by MaskedTextBox but the problem is, the 3 pionts are sliding when i insert some numbers and i can insert letters and numbers higher then 255 (higher is not allowed in IP´s). I hope anyone helps me, maybe with some codesnips!?! :) best regards josh

Member Avatar
Member Avatar
+1 forum 7

Hello, i got a table in Excel (or exported to CSV). There are 3 columns (1. column = specification / 2. columns = value1 / 3. column = value2). On my vb.net form i got a textbox, 2 labels and a button. If i write in in the textbox "5" it should search in the Excel or CSV-File in columns A (specification" the "5" and then it should show the both values in this row in label1 and label2. I tried much things but i can only read and show the complete row in only one label and only from …

Member Avatar
Member Avatar
+0 forum 3

Hi, I Have below table I want all rows with all coloumn from below table where ActCode is 1162828 and sum of DocAmount for DocNo. i.e where the docNo is repeated i want only one row with sum of amount of all repeated rows. ** "Select *, Sum (DocAmount) from TblPurLedTranData whre TblPurLedtranData.ActCode='" & 1162828 & "' Groupby DocNo " ** PosDate DocDate DocNo DocAmount DueDate Status Period DocType FinYear Chan ActCode 10/10/2018 12/10/2018 369896     36980      11/11/2018 INV      5         PUST       2018       PUST       1243684    10/10/2018 12/12/2018 665        36000      11/01/2019 INV …

Member Avatar
Member Avatar
+0 forum 4

[B][COLOR="Green"]Hi Guys :).. I hope you fine :), I need the best and easist way for printing the form ,nested of PrintForm tool coz it is very bad :angry:,it prints the form [U][COLOR="Red"]like screen shot :angry:[/COLOR][/U] ,what I want print entire form on A4 ... Any suggestions ? :( Thanks for your help :)[/COLOR][/B]

Member Avatar
Member Avatar
+1 forum 4

Hello all, I am relatively new to Visual Basic and have managed to muttle my way through creating a 2013 Word document that has some ActiveX controls. The final control I put in place is a Command Button that, when clicked, it sends the form off to an email. That is all working great, however, I would like to have a pop-up message that displays after the button is clicked, letting the form sender know the form has actually been sent. I have put the code I used for this Command Button below. Any help would be much appreciated. Private …

Member Avatar
Member Avatar
+0 forum 9

I am traying to filter Datagrid view based on user type in TbxGlCode (TextBox) Initialy Datatable is populated from SQL table to TempTable (DataTable) getting error at **runtime** at below line Dim Rows As DataRow() = TempTable.[Select]("Code like '%" & VerCode & "%'") Exception Unhandled **System.Data.EvaluateException: 'Cannot perform 'Like' operation on System.Int32 and System.String** How to filter datatable with** Like ** option *My Code* Dim TempTable As DataTable Private Sub FrmGLCodeList_Load(sender As Object, e As EventArgs) Handles MyBase.Load ' Dim TempTable As DataTable 'Create New Table Instance TempTable = New DataTable TempTable.Columns.Add("Code", GetType(Integer)) TempTable.Columns.Add("Name", GetType(String)) 'Adding Rows to TempTable from …

Member Avatar
Member Avatar
+0 forum 5

hi, i am trying to read from a text file and store the data in an array but i don't know how to get started with my code. can someone please get me started here. i have start with the code for locating the file, but i am having difficulty reading the file. Dim strFileName As String OpenAnswerFile.ShowDialog() strFileName = OpenAnswerFile.FileName MessageBox.Show(strFileName) 'message box showing the file path

Member Avatar
Member Avatar
+0 forum 13

Im Stuck With Something, Iv Been Searching, And Searching And I Canot Find Any Information On How To Make SQL Database Show The Samething For Everyone, When Updated Of Coarse... I Can Make The DataTable And Put It On A Form But I Cannot Make It To Where I Add Something And It Update For People That Have Different computers... Please Help!!!!

Member Avatar
Member Avatar
+1 forum 3

Hi! We are a 4 member group for our thesis and we already have submitted 5 topic proposals yet nothing was accepted...and here are the topics: enrollment system, gadgets on track, employment resource system, subdivision technical entry pass Now, I need a help for new ideas that can be developed through visual studio and it can be a web-based or window-based projects. Hope you can help me Thanks in advance!

Member Avatar
Member Avatar
+0 forum 36

Below is my code for adding parameters in my vb .net code for prepared statements of npgsql. Dim xConn As NpgsqlConnection = ConnectDB() Dim xCmd As NpgsqlCommand = xConn.CreateCommand() xCmd.CommandText = "UPDATE " & xTable & " SET previous_tot_adj = @prev_adj ,tot_adj = @tot_adj WHERE version = " & _version & " AND monthly_mq_id = @Index" For Each Index In _Results.Keys If Not IsNothing(_Results.Item(Index)) Then xCmd.Parameters.AddWithValue("prev_adj", NpgsqlTypes.NpgsqlDbType.Double, _Results.Item(Index)) xCmd.Parameters.AddWithValue("tot_adj", NpgsqlTypes.NpgsqlDbType.Double, _Results.Item(Index)) xCmd.Parameters.AddWithValue("Index", NpgsqlTypes.NpgsqlDbType.Bigint, Index) End If Next xCmd.Prepare() xCmd.ExecuteNonQuery() After executing this code i get this kind of error . > A first chance exception of type 'Npgsql.NpgsqlException' occurred in …

Member Avatar
Member Avatar
+0 forum 2

how can i limit a user to enter 10 digit no like telephone no in textbox without using regular expressions?????

Member Avatar
Member Avatar
+0 forum 16

Hi! My name is Jung and I'm new to VBNET I have already tried many ways to write codes for "btnSearch" but seems like nothing works.. I really need help for this as the deadline is around the corner :'( Below are my codes for Search button.. ![btnsearch.PNG](/attachments/large/4/76be068c625e23d9a57e969a97509bee.PNG "align-center")

Member Avatar
Member Avatar
+0 forum 2

hello sir how can I get my system short date format in a label in vb. net. I try this code : Label1.Text = System.Globalization.CultureInfo.CurrentUICulture.DateTimeFormat.ShortDatePattern() but show wrong data. all time show "M/d/yyyy" format. I change it(to "dd/MM/yyyy") manually and by coding result is same("M/d/yyyy") please help me..... For Change the Format: Microsoft.Win32.Registry.SetValue("HKEY_CURRENT_USER\Control Panel\International", "sShortDate", "dd/MM/yyyy")

Member Avatar
Member Avatar
+1 forum 3

Hi, I am currently working on a VB form for a college assignment. I am trying to add quantities from a ListBox and then display the result in a TextBox for a pizza delivery order by using a button. So far, the Listbox shows: pizza type Quantity pizza price Total pizza price The Total pizza price is the value that I want to add together and then show in a TextBox as an Order Price. This is my form and Code for the button: ![form1.PNG](/attachments/small/4/3da7c8769c68d4284e57a3e1644c9627.PNG "align-left") ![form.PNG](/attachments/small/4/a41c26183938bc03cb984f467c5bb361.PNG "align-left") ![form1_buttoncode.PNG](/attachments/small/4/710dcd869220381dab6204948dc6f362.PNG "allign right") The code is a work in progress and as …

Member Avatar
Member Avatar
+0 forum 5

I'm trying to make a button that when pressed for a short while will close the form but when pressed for a long time *e.g. 5s* the form's process will be killed. I'm trying to achieve this with a timer. Private Sub CloseLongTimer_Tick(sender As Object, e As EventArgs) Handles CloseLongTimer.Tick Dim SetTime As Integer = 0 SetTime = SetTime + 1 If SetTime < 500 Then Me.Close() ElseIf SetTime > 499 And SetTime < 1001 Then System.Environment.Exit(1) ElseIf SetTime > 1000 Then CloseLongTimer.Stop() End If End Sub Private Sub CloseButton_MouseDown(sender As Object, e As EventArgs) Handles CloseButton.MouseDown CloseLongTimer.Start() End Sub …

Member Avatar
Member Avatar
+0 forum 4

Dear Friends, Good Day, I am facing an issue in one of the functions the code is given below if someone can help on this actually this function is supposed to check the work ordewr number if it's nulll then it is suppose to take default value as 4999 and add one everytime, but the function is not taking the default value its is starting from 1 and then next record +1 means 2 like this but it supposed to be like 4999+1 means 5000 next record 5000+1 means 5001 like this. Any help in this regard will be highly …

Member Avatar
Member Avatar
+0 forum 4

I have the following problem. when i pres buttun printpreview (button 5) the the print preview fires up. and when i close the print preview without printing and minimize the form (after close the printpreview), and when i maximize the form again the image in the picturebox is turned 90 dergees. How is that pissible ? i have the following code for print preview. Public Class Form1 Dim fotoheight As Integer Dim fotowidth As Integer Private Sub Button5_MouseDown(sender As Object, e As MouseEventArgs) Handles Button5.MouseDown If e.Button = MouseButtons.Left Then If PictureBox1.Image Is Nothing Then MessageBox.Show("Er is niets te printen, …

Member Avatar
Member Avatar
+0 forum 4

Hello All, I have experienced a very strange problem in my application. When I launch my WPF application, it loads fine with a window and button, upon clicking the button, it launches another form which is also fine but in this second form, when I click some button, it launches a window with a blank screen (yet I am quite sure it has got many controls to show on the screen). I have already checked `DelegateCommand`, `Events`, `Methods` but still facing the same issue. I tried deleting some files as suggested by Google in "C:\Windows\ServiceProfiles\LocalService\AppData\Local" as `~FontCache-S-1-5-21-2260904419-1400770398-4175912926-283977.dat`, `~FontCache-System.dat`, `~FontCache-FontFace.dat` but …

Member Avatar
Member Avatar
+0 forum 17

Hi I have a broblem with my label text. The code is Public Class Form5 Dim a As Integer Dim currentDate As DateTime = DateTime.Now Dim jaarnu As Integer = currentDate.Year Private timeLeft As Integer Dim WithEvents timer As New Timer Dim milliseconds As Integer Dim monthnumber As Integer Dim v As Integer Dim h As Integer Dim maand As Integer Dim dagnummer As Integer Dim montnaam As Integer Private Sub Form5_Load(sender As Object, e As EventArgs) Handles MyBase.Load timeLeft = 10 Label30.Text = jaarnu Dim currentDate As DateTime = DateTime.Now Dim days As Integer = currentDate.Date.Month Dim dagmaadn As …

Member Avatar
Member Avatar
+0 forum 4

hello ! i want to develop the keycounter , i mean i want to get the total no. of key pressed by the user in the specific time , i have a code of keylogger , i can use it to get the text in that time period and after that just get its length , but i dont want to use this . here is a code of VB.net which i found so for on msdn Private Shared keyPressCount As Long = 0 Private Shared backspacePressed As Long = 0 Private Shared returnPressed As Long = 0 Private Shared …

Member Avatar
Member Avatar
+1 forum 7

Who can help me with the following For Each Con As Control In GroupBox1.Controls If Con.GetType Is GetType(Button) Then Con.BackColor = SystemColors.Control Con.UseVisualStyleBackColor = True End If Next Can someone help me to fix it with Con.UseVisualStyleBackColor = True or do i have to do the for all buttons separate like Me.Button1.UseVisualStyleBackColor = True Me.Button2.UseVisualStyleBackColor = True i have 32 buttons in groupbox thanks in advice John

Member Avatar
Member Avatar
+0 forum 3

The End.