-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathContactUs.aspx.vb
35 lines (24 loc) · 938 Bytes
/
ContactUs.aspx.vb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
Imports System.Data
Imports System.Data.Sql
Imports System.Data.SqlClient
Imports System.Configuration
Partial Class ContactUs
Inherits System.Web.UI.Page
Protected Sub btnsubmit_Click(sender As Object, e As EventArgs) Handles btnsubmit.Click
Dim con As New SqlConnection("Data Source=SHUBHAM\SRKING;Initial Catalog=carrentals;Integrated Security=True")
Dim str As String
str = "Insert into con values(@n,@m,@mobi,@mg)"
Dim cmd As New SqlCommand(str, con)
cmd.Parameters.AddWithValue("@n", txtname.Text)
cmd.Parameters.AddWithValue("@m", txtmail.Text)
cmd.Parameters.AddWithValue("@mobi", txtmobino.Text)
cmd.Parameters.AddWithValue("@mg", txtmsg.Text)
con.Open()
cmd.ExecuteNonQuery()
con.Close()
txtname.Text = ""
txtmail.Text = ""
txtmobino.Text = ""
txtmsg.Text = ""
End Sub
End Class