Connection to a SQL Server database canbe achieved in vb.net quite easily. The Windows Forms based applications as well as ASP.NET based applications can connect to the SQL Server database in a similar way. But the way the ConnectionStrings are stored is slightly different. 1. Windows Forms Applications – How to make a connection in […]
Copy a file in the file system Supply a source file name and the destination file name CopyFile(“c:\temp\firstfile.txt”, c:\temp\secondfile.txt”) Function Copyfile(ByVal sSource As String, ByVal sDest As String) As Boolean FileCopy(sSource, sDest) If Err.Number = 0 Then Copyfile = True End Function
If you are getting this error while trying to use the DataRepeater in you Visual Studio 2010,12,13 project then look for the References under your project, if you project reference has two rows of Microsoft.VisualBasic.PowerPacks then remove one. You should end up with one entry in your references.
You start with a new project and you have created a winform with graphics and the functionality which you want to use in all your other forms in the same project. One would think that it is easily done as we can simply copy and paste the existing form and rename it and then suddenly […]
The following function returns the file extension only. eg. using the following function GetFileExtension(“c:\test\file.aspx”) will return “.aspx” Here is the complete function, copy and paste it in your form or a module Function GetFileExtension(ByVal sFilePath As String) As String ‘ Dim fullPath As String = “c:\MyDirectory\MYFile.txt” Dim sExtension As String = IO.Path.GetExtension(sFilePath) Return (sExtension) End […]
Scenario: If you have two controllers with the same name in different areas, then you would end up with errors as shown below, while there are numerous examples available on the web but it took me a while to figure out the correct solution for VB. Hope it help you and saves you time. Problem […]
If you have the need to print the address labels then this script will get you started, this is a very simple script which will get you started. You can visit Dymo website site and checkup the SDK for complex scenarios. Assumption I assume that you have already attached a Dymo Label printer to […]
Here is small function which will allow you to send the emails programatically using any SMTP server or you can also use the Google SMTP server if you have a GMAIL account. Function SendMail(ByVal strFrom As String, ByVal strTo As String, ByVal strSubject As String, ByVal strBody As String) As Boolean Dim mailmsg As New […]
In VB.NET Use tablControl1.SelectedTab = MyTabName In C# use tabControl1.SelectedTab = MyTabName; MytabName will automatically be displayed.