Partial Class _Default
Inherits System.Web.UI.Page
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
'Dim conString = ConfigurationManager.ConnectionStrings("LocalSqlServer")
'Dim strConnString As String = conString.ConnectionString
Dim nn = Tb_n
Dim ss = Tb_s
Dim ii = Tb_id
End Sub
End Class
Imports MySql.Data.MySqlClient
Imports System.Data.SqlClient
Imports System.Data
Partial Class _Default
Inherits System.Web.UI.Page
Dim objConn As MySqlConnection
Dim objCmd As MySqlCommand
Protected Sub BB_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles BB.Click
Dim objConn As New SqlConnection
Dim objCmd As New SqlCommand
Dim strConnString, strSQL As String
strConnString = "Server=localhost;UID=root;PASSWORD=123456;database=test;Max Pool Size=400;Connect Timeout=600;"
strSQL = "INSERT INTO ss (name,ser) " & " VALUES " & " ('" & TT1.Text & "','" & TT2.Text & "')"
objConn.ConnectionString = strConnString
objConn.Open()
With objCmd
.Connection = objConn
.CommandText = strSQL
.CommandType = CommandType.Text
End With
objConn.Close()
objConn = Nothing
End Sub
End Class
Imports MySql.Data.MySqlClient
Imports System.Data.SqlClient
Imports System.Data
Partial Class _Default
Inherits System.Web.UI.Page
Dim objConn As MySqlConnection
Dim objCmd As MySqlCommand
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim objConn As New MySqlConnection
Dim objCmd As New MySqlCommand
Dim strConnString, strSQL As String
strConnString = "Server=localhost;User Id=root; Password=123456; Database=story; Pooling=false"
strSQL = "INSERT INTO std (IDstd,Sname,Sgrade,Sroom,Sbra,Sboard) " & " VALUES " & " ('" & TB_idstd.Text & "' ,'" & TB_name.Text & "','" & TB_grade.Text & "','" & TB_room.Text & "','" & TB_sbra.Text & "' ,'" & TB_sboard.Text & "')"
objConn.ConnectionString = strConnString
objConn.Open()
With objCmd
.Connection = objConn
.CommandText = strSQL
.CommandType = CommandType.Text
.ExecuteNonQuery()
End With
End Sub
End Class