Visual Basic Source Code, Download, Tutorial, VB .NET, VB 2010, VB6, VB Programming, Free Sample Code
Note: This Code used to search the record using the binding datasource filter Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim filterStr As String filterStr = "Code like '%" & tstxtSearch.Text & "%' or DeptName like '%" & tstxtSearch.Text & "%' " Try DepartmentBindingSource.Filter = filterStr Catch ex As Exception MsgBox(Err.Number & "-" & Err.Description) End Try End Sub
'If you think that this code solved your problem or help your development, please bookmark this page and keep visit.
'I will post of most of my useful codes in Visual Basic.
'This function used to check if record exist in database with SQL statement parameter
' using the visual basic 2008 with SQL Server 2005 Express.
'Note: This code is part of my payroll system can be downloaded at the main page.
Function Check_Record_Exist(ByVal pSQLstr As String) As Boolean
Dim conSQL As New SqlClient.SqlConnection ' for database connection
Dim AdaptSql As SqlClient.SqlDataAdapter ' adapter is use to update the dataset and datasource
Dim Dats As New DataSet
Check_Record_Exist = False
conSQL.ConnectionString = "Data Source=SERVERSQLEXPRESS;Initial Catalog=Payroll;Integrated Security=True;User"
conSQL.Open()
AdaptSql = New SqlClient.SqlDataAdapter(pSQLstr, conSQL)
AdaptSql.Fill(Dats, "Inquiry")
'If Dats.Tables.Count() > 1 Then
If Dats.Tables.Count > 1 Then
Check_Record_Exist = True
MsgBox("Record already exist, please check your entry.", MsgBoxStyle.Information, "Found Record!")
End If
End Function
'If you think that this code solved your problem or help your development, please bookmark this page and keep visit.
'I will post of most of my useful codes in Visual Basic.
Combo box and List box Data Binding in Visual Basic 2008
The tabbed pages of the tab control demonstrate different techniques:
Download Sample Project
Password to extract: combobox1001
Visual Basic 2010 and 2008 sample on how to send email using SMTP Server.
Internet Information Services (IIS) is required to send email via visual basic 2008.
* TheSmtpServerproperty must be set to the IP address or server name where the SMTP Server is running. In most cases this is the “localhost” computer. Therefore, theSmtpServerproperty value can be either the friendly name, “localhost”, or “127.0.0.1″. The latter is the default for this application.
* To find the SMTP server nameOpen the IIS snap-in (InControl Panel, openAdministrative Tools, and then openInternet Information Services).
* Expand theDefault SMTP Virtual Servernode.
* ClickDomains. In the right pane you will see a list ofDomain Names. You may set theSmtpServerproperty to one of these names or its corresponding IP address.
* The Default SMTP Virtual Server must also be running. Be aware that it is possible for the SMTP Service to be running, but the Default SMTP Server in IIS to be stopped. There is a difference between the service itself and the actual server run by the service. If your Default SMTP Virtual Server is not running, a red X icon will be visible over its node in the IIS snap-in.
To start the server, right-click its node and clickStart
* Set the relay restrictions:
* In IIS, right-clickDefault SMTP Virtual Serverand selectProperties.
* In thePropertiesdialog box click theAccesstab.ClickRelay.
* In theRelay Restrictionsdialog box, select the box labeledAll except the list below. The bottom check box can be selected or cleared.
Download Send Mail in Visual Basic 2008
Extract Password : sendmail1000
Download Send Mail in Visual Basic 2010
Extract Password: sendmailvb2010