Your application or website rely on your database to deliver information about products and services to your customers. You can’t afford to have your database lose performance, lose availability or become unresponsive – even for just a few minutes.
Imports System.Data Imports System.Data.SqlClient Partial Class _Default Inherits System.Web.UI.Page Dim validated As Boolean 'CI Submit and clear Protected Sub btnSubmit2_Click1(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSubmit2.Click ' Submit CI 'Open connection string and insert data into the database, Data table Dim ConnectionString As String Dim Connection As SqlConnection Dim Adapter As New SqlDataAdapter Dim sql As String Dim ds As New DataSet ConnectionString = "Data Source=00.0.000.00;Initial Catalog=QOI;User ID=user;pwd=pwd;" Connection = New SqlConnection(ConnectionString) sql = "insert into Reports_Entry(Customer_ID, Account_Number, Report_Description_1, PBR_ID, Report_Acronym, Date_Occurred, Review_Flag) VALUES ('" & tbCustomerid2.Text & "','" & tbaccountnumber2.Text & "', '" & DropDownList3.SelectedValue & "','" & tbPBRID.Text & "', '" & lblacronym.Text & "', Convert(datetime,'" & Trim(tbDate2.Text) & "',103), '" & "No" & "' );" Try Connection.Open() Adapter.InsertCommand = New SqlCommand(sql, Connection) Adapter.InsertCommand.ExecuteNonQuery() Response.Write("<span style='color: green'>Reference Number ____ has been assigned to your record</span>") Catch ex As Exception Response.Write("<span style='color: red'>Reference Number ____ has NOT been assigned to your record</span>") End Try tbCustomerid2.Text = "" tbaccountnumber2.Text = "" DropDownList3.SelectedIndex = -1 lblacronym.Text = "" lblreportheading.Text = "" ddlreportname.SelectedIndex = -1 tbPBRID.Text = "" lblagentname.Text = "" lblpavilion.Text = "" lblmanager.Text = "" lblarea.Text = "" lblregion.Text = "" lblbusiness.Text = "" lblerror2.Text = "" Employeestatspanel.Visible = False EmployeePanel.Visible = False CIPanel.Visible = False RefNumPanel.Visible = False End Sub End Class
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.