Click here to Skip to main content
15,890,423 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 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
by Doug- VisualBasic VB.NET
A quick Function to get UTC / NTP time

All Articles

Sort by Title

Visual Basic 10 

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,...
30 Sep 2012 by Sergey Alexandrovich Kryukov
No, it is not ambiguous is you reference proper assembly. With Visual Studio, for example, you need to reference an assembly using the ".NET" tab of the "Add Reference" window. When you do it, you add the reference to the "interop" assembly for a specific Office version. You will see the...
30 Sep 2012 by Sm.Abdullah
Your Question is not clear. but take a look here it may help full for you.I had also face situation similar to this.In my case "the error is an ambiguous reference between System.Windows.Forms.Label and ZedGraph.Label"actually both of these name spaces having same class name...
1 Oct 2012 by mikcutu
well, starting from your Sergey's solution, I was looking closely to the references and saw there are few other references to Office (different versions).I just removed all of them and added the right one (Microsoft.Office.Interop.Excel) and it passed over this error....just hope this...
18 Feb 2012 by Ganesan Senthilvel
Nice tutorial is available at: http://www.eziriz.com/help/index.html[^]
16 Jul 2011 by adadero
I'm learning to use crystal report in my project. When I move my project folder to another folder the report can't load the "new data" inserted into database. My original project folder is D:\Learning\ and when I copied to D:\Deploy\Learning\ the report can't load the new data. Please, help me...
19 Jul 2011 by Kschuler
Is your database also kept in your project? If so...you may have to go the crystal report, right click on Database Fields in the Field Explorer, select Set Database location and find the database the new location.You might find more help in some of the CP Articles[^].
9 Sep 2011 by derodevil
I try to learn how to populate sdf database from sql server compact into datagridview through codes. In sql server (mdf database) should look like thisImports System.DataImports System.Data.SqlClientPublic Class Form1 Dim cn As SqlConnection Private Sub MyConnection() ...
9 Sep 2011 by Wendelius
With SDF you probably mean a SQL Server CE database file. If that's correct, then I guess you have a problem with your connection string.SQL Server CE doesn't have a database engine like for example Express edition has. Because of this, CE databases are used by connecting directly to the...
22 Apr 2013 by Member 9993496
i see that you're programming using sdf files.do you know about .sdf files? its use for databases. i am going to make a sdf viewer but i dont know where to start. can you help me?i need to make a sdf viewer application using vb.net (window-based)
2 Aug 2016 by ProgrammingEnthusiast
i have created an application that runs in background. when i minimize it, it will appear on the task bar. it is working fine, but when i turn off my computer, windows says that my application is blocking the shut down process. how do i close my application when i shut down my computer? i...
2 Aug 2016 by Kornfeld Eliyahu Peter
There are certain talks (messages) between the Os and your application while OS try to shut down...OS actually sent a WM_QUERYENDSESSION to your application, but as you didn't handled it it got a false response, marking your application as blocking...Read this paper, to see how prepare your...
2 Aug 2016 by ProgrammingEnthusiast
i have already resolved it by adding this code during form_closing event of my main form.If e.CloseReason = CloseReason.WindowsShutDown Then Me.Dispose
9 Mar 2011 by RadethDart
Alright, I am having the hardest time figuring this out. I have done research on fixing this for a couple days and I am stuck. It is time to ask for help.In my project I am trying to delete a row out of the database and I read how to do that from many different sources telling me to use Ole...
10 Mar 2011 by Dave Kreskowiak
I suggest reading the documentation on AcceptChanges and Update. Update writes the dirty records in the DataSet/DataTable back to the database. AcceptChanges tells the DataSet/DataTable that the changes that were made are now the current state of the records. The two operations are completely...
27 May 2012 by Sander Rossel
So I'm having a small problem when working with numerics. I can't really imagine that I am the only one with this problem, yet I can't find any solutions. So here it goes.I am making an Attribute[^] which takes a numeric in its constructor (ANY numeric). Now here is the problem, there are...
27 May 2012 by Mehdi Gholam
Usually attributes are processed once (type interrogation etc.) so performance is not critical so boxing is a viable option which reduces your code size.I am afraid you can not escape a big switch statement [or a nested IF] (if you can let me know! I have tried :) [DataTypes.cs in RaptorDB...
27 May 2012 by Zoltán Zörgő
Have you considered using ValueType[^] as argument type of your constructor? As it is a larger subset than numerics, the utility in the above msdn article could be also of use.
28 May 2012 by Sander Rossel
As far as I can see there is no way to have one single constructor. Using a ValueType[^] is an idea, but not very user friendly (since ValueType[^] can be more than just numerics, in which case I would have to throw an Exception[^]). By storing the numerics into a Private field as an...
28 May 2012 by Andreas Gieriet
How about dynamic?If you are willing to pay the run-time cost, and if you are willing to give up on compile-time type check, dynamic could help.C# really lacks generics specialization and (especially if run-time performance matters) compile-time elaboration of generics.In C++ you can...
29 May 2012 by Andreas Gieriet
As a followup to solution #4: if you don't have the dynamic feature at hand (VB.Net, .Net version before 4.0), you may employ casts (see the As(...) method): [AttributeUsage(AttributeTargets.Class)] public class MyAttrAttribute : Attribute { private object _arg; ...
19 Sep 2011 by Member 7835126
Hello!I'm trying to use a async Delegate to show and populate a form but the form show up and stays Not Responding.Normally the form opens OK when it's sync with the code.Example situation:Before Class:Public Delegate Sub MyAsyncDelegate()In primary sub:Dim del As...
5 Sep 2013 by Mr. xieguigang 谢桂纲
Object-oriented evaluator of the mathmatics expression
19 Sep 2009 by jebarson
New features of Visual Studio 2010 discussed
24 Feb 2012 by tepet123
http://t0.gsta...
24 Feb 2012 by Abhinav S
TryMyDownloa...
17 Feb 2011 by zafi24
I manage to publish my my program to project. Its partially working. When I try to use Hot key function ALT Z, (To capture image) this error appears:Seriously I don't know what to do next. It seems working before I publish it without wany warning or errors. See the end of this message for...
11 Feb 2013 by Sander Rossel
Journey to the center of the .NET Framework with a chance of IL along the way!
17 May 2012 by Sander Rossel
Hi all,I'm having a little problem designing an Interface I have (not the GUI).What I basically have is two Interfaces that do the same, but one of them needs to get an extra parameter to a Function.Public Interface IDoSomething(Of T) Function DoSomething(ByVal something As T) As...
19 May 2012 by Sergey Alexandrovich Kryukov
I see no problem here at all. The interfaces may inherit one from another or not. A class or a structure can implement either of the two or both of them. How exactly you build this hierarchy depends on the application of all those types and does not depend on signatures of the methods you show...
2 Nov 2011 by gndzero
A threaded application to identify if system VB6 OCX files are exploitable and generate a batch file to register updated OCX controls.
4 Mar 2010 by acmamr
Hello,Thank you for your application AccountPlus.I am learning Dont Net now, so i hope study your application well.so i hope you help me.My e-mail is ahmedcheinane@hotmail.comRegards..
4 Mar 2010 by Khaniya
I think you are thanking on wrong placethis is question answers pageclick below to thanks Ashish TripathiAccountPlus[^]
14 Aug 2011 by sandy_1126
long COPCData::WriteVariable(LPCTSTR VariableName, const VARIANT& Value, long TimeOut){ long result; static BYTE parms[] = VTS_BSTR VTS_VARIANT VTS_I4; InvokeHelper(0x11, DISPATCH_METHOD, VT_I4, (void*)&result, parms, VariableName, &Value, TimeOut); return...
25 Aug 2011 by Leslie Zhai
VARIANT v1;v1.iVal = 111;XXX_OPCDataControl.WriteVariable("XX.XX.XX", &v1, 0);
25 Mar 2011 by drummerboy0511
If I was to include an image file as an embedded resource in a dll in Visual Basic, how could I access that image and put it in a PictureBox control in my application?
25 Mar 2011 by willempipi
www.google.com > http://www.rohitab.com/discuss/topic/15242-images-in-dll/[^]
25 Mar 2011 by drummerboy0511
I managed to find an article that helped...Using embedded resources with .NET[^]
27 Dec 2012 by SandiegoSSD
Hey guys, I have a GUI in VB10 that's controlling some relays (cycling between 4 or sometimes 8 of them) and I'm using several timers to set delays between each 'switch' action. I want to somehow throw in another independent timer (ideally display the time in a textbox) to keep track of how...
27 Dec 2012 by Adam R Harris
Put a new timer on your form, set the interval to 1000 (1 second). Them on the Elapsed (or Tick i can never remember) event update your textbox. When your process starts call Start on the Timer and when its done call Stop on your timer.*** EDIT *****Oh yea, if you are running long...
27 Dec 2012 by Sergey Alexandrovich Kryukov
No, to time a procedure execution time, you don't need a timer at all. Instead, you need a stopwatch: http://msdn.microsoft.com/en-us/library/system.diagnostics.stopwatch.aspx[^].Also, correct timing needs some understanding of how JIT compilation works:...
29 Aug 2013 by PythonProgrammer
For my column Total i want to add up the numbers in my column. So say there are 10 people and only 8 inputed data...then it would be 8/10 * 100..... then i want to divide the number >=14 by the number inputed which would be 8 peopleDim ccount22 = 0 Dim ccount55 = 0 For...
29 Aug 2013 by OriginalGriff
The problem is two fold: First, you don't appear to set a value of count so there is no guarantee that it is anything like what you want - I would suggest that you should set it to myTable.Rows.Count, or set it to zero and increment it in the loop.More importantly, you are doing integer...
15 Aug 2013 by PythonProgrammer
I have Columns 4 5 and 6 and i want to display them in colm 7 ex.Name Col4 col5 col6 TotalStephen 2 3 6 JOhn 5 9 11this is what i have so farDim col1 As IntegerDim col2 As IntegerDim col3 As IntegerPrivate Sub dataGridView1_CellLeave(sender As Object, e As...
15 Aug 2013 by sv sathish
U can try thisImports System.Data.OleDbPublic Class help Dim con As OleDbConnection Dim cmd As OleDbCommand Dim adp As OleDbDataAdapter Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click con = New...
15 Aug 2013 by sv sathish
http://www.dotnetperls.com/dat...
10 Mar 2011 by basheer.j
hey ppl,can ny1 suggest me hw to go bout the following.I'm creating a simple application which includes 3 forms,which takes i/p,stores in the database(i'm using sql server 2008) and display back the searched item,now my problem is tat i want to create a setup file for the above application,in...
10 Mar 2011 by luisnike19
If you don't have sql server in your other machine, you could install the DB using a sql script and pointing to another machine (instance of sql server)script[^]Depends if you are going to use installshield, VisualStudio, or another how you will do it.
10 Mar 2011 by Dalek Dave
You asked this question in the VB Forum.Do not cross post.Also, do not speak like a child.If you feel only able to communicate in the digital equivalent of clicks and grunts then try another developer site.Txtspk is for insolent teenage girls and morons who cannot be bothered to type...
10 Mar 2011 by Sandeep Mewara
Look at the answers given for the similar question asked here[^].Various article links are present in it that will help you achieve the same.Have a look at these too:Creating setup With support for database creation Using VS.NET[^]Create database during installation of a .NET...
15 Dec 2011 by Muhammady
Hello guys Can you help me out by telling me how to add all my computer fonts to combobox?
15 Dec 2011 by Himachandra
Need not to add....... Already all the fonts are available in properties column of ComboBox...........
13 Jan 2012 by Simon_Whale
Dim fnts As New InstalledFontCollection For Each f As FontFamily In fnts.Families() ComboBox1.Items.Add(f.Name) Nextfurther reading Find all installed fonts[^]
7 Mar 2016 by rangachisi
I cant run my application developed in vb.net2010 dot net framework 4 on client machines. i am getting this error messageCould not Load type 'ADODB.FieldsToInternalFieldsMarshaler' from assembly 'BBSSystem, Version=1.0.0.0, Culture-nuetral, PublicKeyToken=null'Someone please help
7 Mar 2016 by Yavuz Sevgi
find "adodb" in references and see adodb.dll properties. "Embeded Interop Types" set to false than you can set "Copy Local" to true .
15 Mar 2012 by SandiegoSSD
Hi folks, I wrote a small API gui to communicate over foundation fieldbus.I've used a While loop that constantly reads some parameter values from the bus.At the end of the While loop, I putApplication.DoEvents()so that I can use another button to stop the reading process. It all...
15 Mar 2012 by Sergey Alexandrovich Kryukov
Yes, and not just this. Never use DoEvents for such purposes. Always use a separate thread for anything which has it's own linear or circular logic, and for anything which contains blocking calls or contain lengthy operation. Even though DoEvents can work as a quick and dirty UI thread based...
22 Jul 2009 by DaveyM69
A complete overview and implementation of SNTP from a client perspective.
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 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....
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...
2 Feb 2020 by OriginalGriff
No. Several reasons, but you probably already know them given the number of questions you have posted so far. 1) We aren't a "code to order" service. While we are more than willing to help those that are stuck: but that doesn't mean that we are here to do it all for you! We can't do all the...
10 Mar 2012 by rspercy65
How Would I Check if a program has or needs a "runas admin" permission during runtime? using vb9, VB10, or VB11 beta. Thanks in advance for any answers, or (directions to an article), that could possibly resolve this little problem.
10 Mar 2012 by Sergey Alexandrovich Kryukov
I don't think you can do it automatically, even though some static code analysis algorithm could help. You just need to understand what causes permission problems and write code accordingly. Also, you can simply test the code without elevated privileges, but it can give you 100% guarantee, as...
15 Nov 2015 by David Vanson
A small application to pretty print Arduino code with syntax highlighting
22 Jun 2015 by Terence Wallace
The primary purpose of this article is to provide quality sample source code for VB.NET developers interested in building data-centric applications using the .NET Framework.
14 May 2013 by Amy Adams
I have the following code in VB6. How can I re-write this in Visual Studios 2012? As it is written below, I get the following error message: "Arrays declared as structure members cannot be declared with an initial size. "I've seen possible alternatives to how this should be written...
14 May 2013 by Sergey Alexandrovich Kryukov
Please see: http://msdn.microsoft.com/en-us/library/tey4z3ca%28v=vs.110%29.aspx[^].—SA
14 May 2013 by AspDotNetDev
Does this work:Structure selectStruct Dim options() As String Sub New(ByVal size As Integer) ReDim options(size - 1) End SubEnd StructureNote that I used "size - 1" because I'm guessing the original code should say "options(0 To 299)".
14 May 2013 by Maciej Los
Please, read my comment. You did not provide enough information to post exact answer.VB6 vs. VB.NET[^] - there are similar languages both not the same.Array class (VB.NET)[^]I would suggest you to use custom class. Please, follow this link: Using Classes and Structures in Visual Basic...
14 May 2013 by lewax00
My VB is rusty, but I think you want:Dim options(300) As Stringinstead of the line you have declaring it.
26 Oct 2011 by adadero
I have a very simple question regarding to .Net Sockets. What are differences between Class Socket and Class TcpClient or TcpListener in System.Net.Sockets namespace. Please, could you give me a link how to learn these? I'm looking for the tutorial everywhere and only finding console tutorial. I...
26 Oct 2011 by Mehdi Gholam
Read this : http://social.msdn.microsoft.com/Forums/en-US/ncl/thread/379cca53-9920-4167-bd51-d685b25ac0dc/[^]
26 Dec 2011 by Drag0nHunter
ASM.Net a assembly x86 emulator which emulates the language the managed way
30 Jul 2012 by Ndamulelo Savhase
I'm working on a project, the main goal of which is to generate a PDF to be generated and sent as an Email attachment.A User Logs in/Registers..., then answers a set random of questions, and submits the answers.The user is redirected to an asp page after this, which has the results as they...
30 Jul 2012 by woutercx
An article about working with images and iTextSharp:It's about putting images at certain positions in a pdf with C#.But couldn't you have found it using Google?http://www.mikesdotnetting.com/Article/87/iTextSharp-Working-with-images[^]About the other question you had: this pdf doc...
30 Jul 2012 by Rene Bustos
Hello .Recently i develop a web service that generate a PDfthe first step is to load an image in png format with graphics class . then write the datagridview data over the png . and then load with itextsharp the image (bytes) and save in pdf format .This way is very very good cause the...
19 Sep 2013 by Ron Schuler
ASP.NET PDF document viewer control that does not require any Acrobat product to be installed
26 Apr 2013 by Sebastien Lebreton
Reflexil is an assembly editor and runs as a plug-in for Reflector or JustDecompile. Reflexil is able to manipulate IL code and save the modified assemblies to disk. Reflexil also supports "on-the-fly" C#/VB.NET code injection.
27 Sep 2012 by Sergey Alexandrovich Kryukov
The code you show won't even compile, because of "GetExecutingAssembly." in first line. It's "GetExecutingAssembly()...".Use Copy/Paste and create a decent code sample and then come again.—SA
27 Sep 2012 by rspercy65
This is the VB version and below is the C# version. C# version works. I used (in the VB version) Dim myStream As Stream = ... and I used GetEntryAssembly() to no avail. Still get the same MessageBox to trap the Null exception that gets thrown. Private Overloads Sub Refresh(tag As String) ...
27 Sep 2012 by Sergey Alexandrovich Kryukov
Unfortunately, I cannot see what is the difference between posted code and the C# code, because you did not show the C# code. It's more likely that the difference is in the arguments of GetManifestResourceStream. I can also suspect that executing assemblies are different, or the resources. By...
21 Apr 2013 by Ashok19r91d
How to Assign a Panel Control with all its child Controls to Another Control?Let my form contains two Panels say PanelA and PanelB.PanelA in my form contains some Controls, but PanelB is empty panel by Default. During time, When a Button Click, I just need to Fill All Controls From...
21 Apr 2013 by Idle_Force
Use a UserControl that you populate with the control which you speak of. When you need to duplicate it, it is as simple as initializing 1 object the UserControl and placing it in the other panel.
12 Sep 2015 by Mr.PoorEnglish
After simple introduction the Article turns to less known, but useful/important/interesting Aspects of unblocking the Gui with Async/Await
22 Jan 2016 by Member 12280808
can anyone give me a code for auto contrast and auto brightness ?
22 Jan 2016 by F-ES Sitecore
Google[^]
7 Sep 2012 by D-Bar
Hello All, Thanks for reading my first post. My question is: In VS2010 I have a command button on my web app, when I click on the button I want it to act like it is entering keystrokes (Ctrl+o)to run my autohotkey macro. Is there any way to do this, and if so, how?Thank-you very muchD-Bar
12 Jul 2017 by Khabibb Mubarakk
i have code here ... If Not dr.HasRows Then penfaktur.Text = "" + Format(Now, "ddMMyyyy") + "NF" + "0001" Else penfaktur.Text = Val(Microsoft.VisualBasic.Mid(dr.Item("no_faktur").ToString, 11, 4)) + 1 If Len(penfaktur.Text) = 1 Then ...
12 Jul 2017 by CPallini
Maintain the last assigned Datetime and compare its Date part with the one of the Datetime you are currently assigning. On mismatch restart the counter.
29 Nov 2011 by Ashu Mahajan
Hi Experts, I want to create an custom control just like an Autosuggest control for my windows application. When I type, it should show a grid for the suggestion have the typed value. for an example if I want to search a student "ashish". As soon as I type A in textbox, it should show...
19 Dec 2011 by coded007
You can use ajax auto complete for this operationfor ref:http://www.asp.net/ajaxLibrary/AjaxControlToolkitSampleSite/AutoComplete/AutoComplete.aspx
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...
29 Aug 2013 by Keith L Robertson
Write synchronous-looking asynchronous methods without async/await in Visual Studio 2010.
13 Sep 2012 by CorvetteGuru
Backup Stored Procedures in SQL Server.
24 Aug 2010 by Santiago Santos Cortizo
How to show a bar chart in a DataGridView
31 Oct 2009 by Abhishek Sur
This article will enable you to add custom search rules to your application using Bing Search API with much more
23 Jan 2011 by GaryV100
I am trying to draw random patterns in a picture box that has a black panel over the surface hiding the drawing below. But when I make the panel disappear (panel.visible = false), the graphics in the picture box UNDER the panel are also erased. In the code below (most of which was grabbed from a...