Click here to Skip to main content
15,890,282 members
Everything / Programming Languages / Visual Basic 10

Visual Basic 10

VB10

Great Reads

by CS Rocks
This is a slideshow that works in a Silverlight 3 UserControl.
by Abhishek Sur
Gives an introduction of how to create SQL CLR managed objects in SQL server.
by kirkaiya
A very simple, XAML-based month-view calendar that shows appointments, exposes events, and allows dragging appointments in the current month.
by Mr. xieguigang 谢桂纲
Mathematical method of S-system equation to simulate a biochemical network system

Latest Articles

by Robert Gustafson
I've created an enhanced version of the Extended RichTextBox created by Razi Syed.
by Doug- VisualBasic VB.NET
A quick Function to get UTC / NTP time
by Richard Atkins
Create a fluid, multi-column, vertically ordered list using nested, floating divs
by Alexandros Pappas
Example of a self hosted WCF service over HTTPS with transaction

All Articles

Sort by Updated

Visual Basic 10 

N 1 May 2024 by Member 16140179
When I was Using MS office 2003/7, at that time I faced This Error. Actually, This Is Excel Error Means There Is Bug In earlier Version of MS Office Excel. So To Solve This Error I Used MS office 2013 & Good New Is That My Problem Solved. So Use...
23 Dec 2023 by M Imran Ansari
The issue may caused by third-party Excel COM plug-in, refer to the provided link, and it is anticipated that your issue will be resolved. https://superuser.com/questions/1124945/excel-interop-remote-procedure-call-failed-or-rpc-e-serverfault[^]
23 Dec 2023 by OriginalGriff
To be honest, we can't help you with that little info, and probably can't give you a "full solution" at all - simply because we have no way to access your spreadsheet on your system while you code is running, and you need that to begin diagnosing...
23 Dec 2023 by Jayanta Modak
The server threw an exception. (Exception from HRESULT: 0x80010105 (RPC_E_SERVERFAULT)) when run my project get this error please help me solve the problem What I have tried: Private Function GetXlUsedRange(ByVal filePath As String) As...
4 Aug 2023 by NyikoB
I've been working with project using VB.NET and access as database. however when I have to update data stored I get the following error message: "No value given for one or more required parameters" What I have tried: Private Sub...
4 Aug 2023 by OriginalGriff
The code looks OK from here - but we have no access to your data, so we can't test it. So it's going to be up to you to gather information. Fortunately, you have a tool that will help you: the debugger. Run your code in the debugger, and put a...
25 May 2023 by Joebpn1
Dim constring As String = "dsn=mysql_tabel;database=db1;server=localhost;iud=root" Dim con As New OdbcConnection(constring) con.Open() Dim query As String = "SELECT *FROM tbdata_reservasi WHERE tanggal_masuk >= @ST " 'AND tanggal_keluar
25 May 2023 by Dave Kreskowiak
So where's the line that actually executes the command? Something like OdbcDataReader reader = cmd.ExecuteReader() Or whatever you should have for your requirements...
22 May 2023 by Joebpn1
Sub read() Dim constring As String = "dsn=mysql_tabel;database=db1;server=localhost;iud=root" Dim con As New OdbcConnection(constring) 'Dim con As New OdbcCommand(SQL) 'dataload() con.Open() Dim...
22 May 2023 by OriginalGriff
At a guess, DG1 is a DataGrid of some form, and you are trying to set the background colour for rooms, but boy are there problems with that code ... Your For loop runs from 1 (which isn't the index of the first row - they are numbered from 0 in...
22 May 2023 by CPallini
It looks your DG1 array (whatever it is) has not enough rooms... :-) I suggest you to use the debugger to gain some insight.
20 Apr 2023 by rstbarre
Hi everyone, i'm Olivier from France and I'm new to the Code Project. I search a solution to copy/paste one or multiple cell(s) from a datagridview1 (selected with a left mouse click) to a datagridview2 placed on the same form using a right...
20 Apr 2023 by Graeme_Grant
A quick Google Search turned up many answers and YouTube videos that will help answer this question with code examples: winform datagridview copy cells from one to another - Google Search[^]
19 Mar 2023 by Amitkumaryadava
Hello Great Minds ! I have Difficulties to read text where notepad have large data and strings character like ---- and ... The Data i Want to read data in datagrid Like Below Village Grower Mobile Aadhar 50305 ...
19 Mar 2023 by OriginalGriff
The code you show doesn't try to do what you describe: in fact it doesn't do anything useful at all. It looks like you found some "read a file" code and threw two lines into it in the hope it would work: ResultText.Text = line.ToString...
16 Mar 2023 by Graeme_Grant
Why are you using both SetDesktopLocation and Location? They both do the same thing in subtly different ways:" 1. SetDesktopLocation[^] Quote: Sets the location of the form in desktop coordinates. 2. Location[^] Quote: The Point that represents...
16 Mar 2023 by Hannes1993
I'm having some trouble setting up my SetDesktopLocation coordinates for my program, specifically the X-position. It's supposed to be used in a dual screen setup where it will open on the 2nd monitor/TV. The X-position value is stored in a...
4 Mar 2023 by ionMEMBER
Hi everyone I have made a browser with cefsharp chromium and want to save html or to open it on textbox. Tried: Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click ...
25 Jan 2023 by sarfarazbhat
Hello everyone, I am currently developing a project in VB.Net and Ms Access and now, I got stuck while creating a crystal report where I need to display columns from three access tables which I am able to fetch using a query in Access. But the...
23 Nov 2022 by Beginner213456
i have searched from the internet as i am trying to create a system that doesnt use the databinding source is it possible to fetch data from ms access and display it in the vb textbox by code? What I have tried: dbprovider = "PROVIDER =...
23 Nov 2022 by KrirkDev
1. You have to learn how to display the data on a textbox control. We do it by setting the property Text ob object textbox. For example. txtName.Text = "John" 2. You have to learn how to retrieve the data from the database. In your...
11 Nov 2022 by Robert Gustafson
I've created an enhanced version of the Extended RichTextBox created by Razi Syed.
28 Sep 2022 by Gary Corbell 2021
I have a program with various VB.Net menustrip items set to certain keyboard shortcuts. However, if Windows ease of access has the keyboard shortcuts turned off, I am looking for a way to turn them on with VB.net code. What I have tried: I have...
28 Sep 2022 by OriginalGriff
Quote: Well, I did not ask for your 'opinion' about the etiquette I should be adhering too. Rather I ask a question of how to do some particular coding. And if you will read the question fully you will see my intentions are to turn it off after...
26 Sep 2022 by Gary Corbell 2021
Is there a way, at design time to add a text file to my.resources with code. It will only be read when the exe is run by the client. I know how to add to my.resources through the normal way but need to add it with code because the text file will...
26 Sep 2022 by OriginalGriff
That's a pretty bad idea: it causes configuration problems that can quickly spiral out of control because you need effectively a different EXE file for each client, and there is no obvious way to work out which EXE is which without effectively...
26 Sep 2022 by Dave Kreskowiak
I don't think you're going to be able to execute any code in your project during the compile to do this. AFAIK, you would have to write an MSBuild extension (called a Task) to do it, then manually add this Task to your VB project file (.vbproj)...
24 Sep 2022 by Gary_Corbell
Howdy everyone: 1. I am using VB2010 2. I have a button on a form without any text. 3. In debug mode, the button is assigned text. 4. The assigned text is written to my.settings.btnText 5. When the application is built and the executable move to...
24 Sep 2022 by OriginalGriff
The problem is that - rightly - debug and release configurations (including the settings file) are completely independent. If they weren't, then there would be a high risk of dev builds accessing production databases for example - which could be...
6 Sep 2022 by mikcutu
hello,I was building an application under vb.net 2008 which worked OK.Now, I was trying to migrate it into vb.net 2010 and I still receive errors relate to different ambiguous in namespace Microsoft.Office.Interop.Excel. This is refering to DataTable, Workbook, Worksheet,...
23 Aug 2022 by Jayanta Modak
how can i configure ip address, submask, getway, DNS1 and also DNS2 please help me i use this code but DNS not added what is the actual code for add all with DNS1 &2 Please help me What I have tried: Protected Sub Button1_Click(ByVal sender...
23 Aug 2022 by rnbergren
to get your current setup. go to a command line on a working network computer. Type ipconfig or ipconfig /? The second will give you options to use and look up. I believe the option /all will give you the dns server entries.
18 Jul 2022 by Beginner213456
I have a crystal report and a subreport in vb.net I want to Filter the records to be displayed in the sub report by typing the name in the textbox and after clicking a button it will show all records that have the same name in the textbox. I...
18 Jul 2022 by Member 15710858
there might be the error in backend(SQL or any) or sub-report(if exists)
25 May 2022 by Member 11004533
{ "Record": [ { "Wagon_Details": [ { "Rake_No1": "", "Rake_No2": "", "Rake_ID": "", "SL_No": "", ...
25 May 2022 by OriginalGriff
What you have created isn't really JSON - it's a "map" of a couple of objects which almost certainly have the wrong value types embedded in them. JSON isn't about "class descriptions" it's about data transfer - a JSON text is a set of object...
24 May 2022 by Gunawan Harijadi
The arithmatic calculation of &H10000 * GetScrollPos(RichTextBox1.Handle, SBS_VERT) is not correct, it will cause OverflowException to rise. The correct calculation is GetScrollPos(RichTextBox1.Handle, SBS_VERT)
24 May 2022 by Gunawan Harijadi
It looks like SendMessage user32 API cannot exceed beyond integer value. I'm making a text editor application using vb2010 WinForm. Instead of scrolling with scrollbar, users can scroll directly on the richtextbox with the mouse, similar to...
23 May 2022 by Richard MacCutchan
The POINT structore comprises two LONG values, not a single integer. See POINT structure (Windows) | Microsoft Docs[^]. So you should recreate that structure in your code and pass its address in the LPARAM variable.
18 May 2022 by Justin David Sanduco
This is my code: Public Class Form1 Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load openCon() MsgBox() con.Close() loadTable() End Sub Private...
18 May 2022 by OriginalGriff
First off, don't do it like that! Never concatenate strings to build a SQL command. It leaves you wide open to accidental or deliberate SQL Injection attack which can destroy your entire database. Always use Parameterized queries instead. When...
15 May 2022 by Jayanta Modak
I want to change the date time format of datagridview1 but is it not work please help me change date time format no 6 to No 11 column format is dd/MMM/yyyy hh:mm:ss tt" My Code is Private Sub loadfiles_1() Dim dt As New DataTable ...
15 May 2022 by Richard Deeming
DataColumnCollection.Add Method (System.Data) | Microsoft Docs[^]: By default, the DataType for the new column is string. Specify the correct data-type for the columns when you add them: Dim dt As New DataTable dt.Columns.Add("Name",...
6 Apr 2022 by Jayanta Modak
How can I check special characters are there (String) or Display on label? I Use this but it is only count how to display what special Chr are there in this string What I have tried: Dim input As String = "Hi! Hello, How are you?" ...
6 Apr 2022 by Patrice T
Quote: How to get special characters from a string in VB.NET Those links should help you to build and debug RegEx. Here is a link to RegEx documentation: perlre - perldoc.perl.org[^] Here is links to tools to help build RegEx and debug them:...
6 Apr 2022 by Maciej Los
Your regex pattern is wrong. Use this: [!""#$%&'()*+,\-.\/:;?@[\\\]^_`{|}~\s] In other words: / An unescaped delimiter must be escaped with a backslash (\)
13 Mar 2022 by Talha Muneer
How we can calculate the value of Datagridview cell like if cell value is 6+2+9 and result is shown in second column Coulumn A Cloumn B 6+6+2 ??? What I have tried: i tried this code but second cell not show result of first cell Dim...
13 Mar 2022 by OriginalGriff
Your cell already contains a string: "6+6+2", so calling ToString on it doesn't do anything useful. And strings that contain equations can't be "converted" to numbers by calling CDbl - all that will do is throw an exception - which you catch -...
2 Dec 2021 by NyikoB
I'm working with a program that I called Ordering System using visual basic.net and sql database. I use textboxes to capture required information and transfer to database/datagridview. I have column called Total where this column handled all...
2 Dec 2021 by OriginalGriff
First off, that's pretty poor code: don't use "magic numbers" like ...Cells(13)... as it's far, far too easy to miscount and cause problems - and that may be the source of your problem! Use column names instead ...Cells("Total")... and they work...
21 Nov 2021 by Beginner213456
How do i Fill Windows Form TextBoxes and Datagridview programmatically in vb.net from MS Access What I have tried: Me.TableAdapter.Fill(DataSet.Table) I guess this is for bound Database But is it possible to do it without binding the database?
21 Nov 2021 by OriginalGriff
The Fill operation has nothing to do with databinding: it instructs the system to execute the SELECT command you previously specified on the database, and return the results in the form of DataTables as part of the DataSet. That isn't databinding...
16 Nov 2021 by Beginner213456
I am trying to use the Nested If in picking a value from the ComboBox and Display a certain Form for example if i choose 1 and click a button it will show the form1 if i choose 2 and click a button it will show the form2 I have 13 items I...
16 Nov 2021 by OriginalGriff
That's clumsy: and probably not going to work too well as you almost certainly need to create a new instance of the form in order to display it anyway. The first improvement is to use switch instead of if: Dim f As Form = Nothing Select...
30 Oct 2021 by Ryder-Chris
Hi. I am using a class module to simplify accessing my database (Access at the moment but will be MYSQL) The Class module uses a routine called ExecSQL(SQL as string). When I use this for selecting or filtering records it works perfectly. ...
30 Oct 2021 by Dave Kreskowiak
Well, for one, you cannot use a DataAdapter to execute an INSERT query. You're going to have to provide another method for your code to call to execute non-SELECT queries.
19 Oct 2021 by Beginner213456
I have read some articles having to use the rdlc report in vb.net instead of crystal report. but upon trying crystal report is much easier to manipulate but when it comes to setup and development, you will encounter too many errors. now i want...
19 Oct 2021 by Maciej Los
I'd strongly suggest to read this: Use WinForms ReportViewer Control - SQL Server Reporting Services (SSRS) | Microsoft Docs[^] There you'll find complete tutorial about loading rdlc report. Note: do not forget to use links on the left pane of...
19 Oct 2021 by CHill60
This is not a tuition site and your question is too expansive for a Quick Answers forum. I suggest you continue your research into how to use RDLC - there is a little bit more to it than the code you have shared. You could start here (not an...
12 Oct 2021 by Beginner213456
The report i want to create is 1 3 5 2 4 5 Total: 3 7 10 What I have tried: I tried the summary and the running total function in the crystal report field explorer and chose sum but it just counts the number of the records what...
12 Oct 2021 by CHill60
See the responses to this CP post HOW to sum column in crystal report[^] or any of the links in the "Related Questions" list to the right of this post. If you are just getting a count of the number of records then you have forgotten to change...
10 Oct 2021 by Beginner213456
If you installed an application developed from VB.net using Ms access as the Database to a computer and decided to use another computer how can you access the updated database from the old computer using the application . What I have tried: i...
10 Oct 2021 by Wendelius
If the database is used only by one user and the application, then if the user changes the computer, you can just copy the database to the new computer. However, if two or more computers use the same database, then the database should be located...
28 Sep 2021 by Beginner213456
I'm trying to generate a summary report using crystal report Content: District Grade 1 Grade 2 Grade 3 District 1 5 10 6 District 2 6 11 8 District 3 4 13 9...
19 Sep 2021 by Dave Kreskowiak
You've already been told you can NOT put your database under Program Files. It will not work there since everything under that folder is ReadOnly to users.
18 Sep 2021 by AdvenSQL
Plz Help I am using visual studio 2017, sql server 2016 I need to fill listview2(Containing Sub Departments) with checkboxes, based on another listview1 checked items & when I select an item in listview1 its all sub departments from Sql server...
18 Sep 2021 by Richard MacCutchan
Check the documentation: ListView.ItemCheck Event (System.Windows.Forms) | Microsoft Docs[^]
9 Sep 2021 by Beginner213456
Im using vb2010 and ms access to create a simple app now when i add a password in my ms access the system can't access. there is an error popping out I tried the code below to locate the ms access database. Also can crystal report generate...
9 Sep 2021 by CHill60
To answer your first comment to solution 1 - ACE supersedes JET and is fully backward compatible. It will also run on 64bit whereas JET will not. In response to your second comment to solution 1 - you are not using the correct connection...
8 Sep 2021 by Dave Kreskowiak
Error messages are a must when troubleshooting problems. But, this one appears to be very easy. Just look up the connection string at Access connection strings - ConnectionStrings.com[^]
1 Sep 2021 by Beginner213456
I am trying to make an application that's using crystal report that generates report i am confused how to use the formula function I tried the Parameter Function but It only shows the details with the same value with the textbox What im trying...
1 Sep 2021 by Wendelius
Based on the example it looks like you could use a crosstab report to do the calculation fot both rows and columns. For example, have a look at Crystal Reports Tutorial - Cross-tab report (Lesson 7) - YouTube[^]
24 Aug 2021 by Beginner213456
I'd like to create a setup wizzard for my application now i'm not sure if i should add the database,crystalreport,exe file and others in the set up? may i know some recommendations? What I have tried: I tried File>New Project>Setup and...
24 Aug 2021 by OriginalGriff
Your database file is a good idea, and the Crystal redistributables aren't difficult: How to create a .NET setup project with crystal report prerequisite? - Stack Overflow[^]
23 Aug 2021 by Beginner213456
I don't know if this is a solution I can't find the problem in the code, i checked my parameters,columns. its correct but it says the "cant find the column "name" ". so I used parameters fields instead so before loading the crystal report I...
22 Aug 2021 by Richard Deeming
You haven't told us which line the error is thrown from. At a guess, it's the crParameterFieldDefinitions.Item("Name") line, which means your report doesn't contain a parameter with that name. You need to examine your report to find out what the...
19 Aug 2021 by Beginner213456
Situation: Show all Records from a certain Table that has the same record in a row. Question: How to show all records that has the same name in the textbox Expected Output: If a Name is input in a textbox the crystal report will show all...
19 Aug 2021 by Wendelius
You can use parameters in Crystal. Have a look at Crystal Reports - Parameters[^]
16 Aug 2021 by VBeginner.NET
After the splash screen appears and fades away, the main form appears but goes behind some other program's windows like Windows Explorer or Firefox. What do I have to do so that it comes and stays in the front of all other windows? Thanks for any...
16 Aug 2021 by OriginalGriff
You'll have to use user32.dll: c# - How to make a window always stay on top in .Net? - Stack Overflow[^] See the clammum solution - it's not in VB, it's pretty obvious code.
16 Aug 2021 by Richard MacCutchan
You can use the Form.TopMost Property (System.Windows.Forms) | Microsoft Docs[^].
14 Aug 2021 by Kalila
Hello Everyone,I am new in the Visual Studio world. I created a clickonce application. I publish the application, everything looks good, BUT, my application is not getting the updates.It is reading the manifest, but not updating. I thing it could be because I am not sure What files...
12 Aug 2021 by Beginner213456
Situation: Adding New Records while avoiding duplicates. Question: How to Cancel the Insert Function when there is a duplicate Problem: the code detects if there is a duplicate and shows in a pop-up , but it still adds in the record anyways. ...
12 Aug 2021 by OriginalGriff
First off, don;t do it like that! Never concatenate strings to build a SQL command. It leaves you wide open to accidental or deliberate SQL Injection attack which can destroy your entire database. Always use Parameterized queries instead. When...
11 Aug 2021 by Beginner213456
Is it possible to compute Records in the Datagridview or MS access using the Crystal Report? or in a Datagridview like I have a Field Named Male,Female,school,District,Total,DistrictTotal,DistrictMale,DistrictFemale Now what i'm trying to...
9 Aug 2021 by CHill60
As Maciej has suggested, you are going to get far better answers if you provide a clear description of the problem, some sample data and some expected results for the data provided. First point, totals are not the sort of thing you should store....
7 Aug 2021 by VBeginner.NET
I have learnt the basics and am able to draw various kinds of things on forms with persistent graphics and colour them. Now I would like to learn more but cannot find good tutorials. Do you know of such free tutorials on the Internet? I still do...
7 Aug 2021 by OriginalGriff
Classes, methods, events: these are the fundamental elements of any .NET programming - so if you don;t understand them, then whatever you do is wrong, even if it appears to work at the moment! :laugh: They are all far too big a subject to go...
7 Aug 2021 by Richard MacCutchan
Quote: I still do not understand classes and methods well (my background being in QBasic and VB3 and VB6). I do not understand the parameters that are passed in control event handling routines at all - sender, e, EventArgs, PaintEventArgs, etc....
5 Aug 2021 by Beginner213456
Problem: The sum of the 2 textboxes are computed and stored in the result textbox. And After Pressing the Save Button To save it in the Database a msgbox pops up saying "INVALID" like 3 times. What I have tried: For the Compute...
5 Aug 2021 by OriginalGriff
Start by not assuming that "text" is the same as "number". Instead of passing string values, do the TryParse operation in the Save method to generate numeric values and pass those to your DB instead of passing the text you assume is correct. That...
4 Aug 2021 by Beginner213456
Still Learning in Vb.net and MS access How to compute 2 or more textboxes and save it in 1 textbox and Show the result without button click I tried to insert the code in the timer Question: is my code fine or are there more ways to compute...
2 Aug 2021 by OriginalGriff
Why use a timer? Instead, consider using the TextBox.TextChanged event[^] and update your result only when there is something to do? And do yourself a favour: stop using outdated VB constructs and start using .NET properly - instead of CDbl use...
1 Aug 2021 by Beginner213456
I have a searchbox named TextBox1.Text . I want that when i type a letter or a number, the data gridview will display the data that matches to what I've inputted in the searchbox. I have already a code for that but im having an Error Saying...
1 Aug 2021 by OriginalGriff
This is one of the most common problems we get asked, and it's also the one we are least equipped to answer, but you are most equipped to answer yourself. Let me just explain what the error means: You have tried to use a variable, property, or a...
29 Jul 2021 by Beginner213456
My Insert/Add Button is now working fine Problem: How to check if a record has duplicate and if there is, t would show some error. I used the parameterized query for update and Insert. I am not familiar on how insert records and avoid...
29 Jul 2021 by Beginner213456
Problem: Can't Update my Access Database Error: No value Given for one or more required parameters. Additional Info: I'm using SchoolName as my PK. so iremoved it from the Update SQL. Also I dont know if my where clause is correct or not. OR ...
29 Jul 2021 by Dave Kreskowiak
Access doesn't use named parameters. If you've got a value that's used more than once, like your KM in the UPDATE and the WHERE clause, you have to specify it twice. You query string has 24 parameters and you supplied 23. Oh, and you do not...
29 Jul 2021 by Code Fan
If SchoolName is your primary key & you want to ensure you update 1 record at a time, you probably want to use it in your WHERE clause instead of anything else. Also, it's a good idea to explicitly name your parameters rather than use ? for them,...
26 Jul 2021 by Beginner213456
Try Dim sqlconn As New OleDb.OleDbConnection Dim sqlquery As New OleDb.OleDbCommand connstring = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Application.StartupPath & "\Plan.mdb" ...