Imports System.Data.SqlClient
Imports System.Data
Partial Class _Default
Inherits System.Web.UI.Page
Protected Sub btnOk_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnOK.Click
lblname1.Text = txtname.Text
lblsname1.Text = txtsname.Text
lblsex1.Text = DropDownList1.SelectedValue
lbladdr1.Text = txtaddr.Text
lblemail1.Text = txtemail.Text
lblid1.Text = txtID.Text
lblpass1.Text = txtpass.Text
'Connectoin
Dim strConnectionString As String = _
"Data Source=202.29.52.59;Initial Catalog=it46042970151;User ID=itsql46042970151 Password=1234"
Dim objConnection As New SqlConnection(strConnectionString)
Dim txtSQLcommand As String = "Insert into Regist.MDF ( name,sname,sex,address,email,id,password) values ()"
'Command"
Dim objCommand As New SqlCommand(txtSQLcommand, objConnection)
objCommand.CommandType = Data.CommandType.Text
Dim objDataAdapter As New SqlDataAdapter
Dim objDataset As New DataSet
objDataAdapter.SelectCommand = objCommand