首先,我对我的英语感到抱歉 我有问题插入我的本地数据库字符,字符是泰语 这是我的模块
Imports System.Data
Imports System.Data.SqlClient
Module Module_all
Friend strConnString As String = "Data Source=(LocalDB)\v11.0;AttachDbFilename=D:\VB\Bank_Project\DB\DB1.mdf;Integrated Security=True;Connect Timeout=1000;characterEncoding=UTF-8"
Friend objCmd As New SqlCommand
Friend objConn As New SqlConnection
Friend sql As String
End Module
非常感谢您的回答
sql = "SELECT COUNT(*) FROM Employee "
Dim cmd As New SqlCommand(sql, objConn)
Dim intNumRows As Integer = cmd.ExecuteScalar()
Dim Id As Integer = intNumRows + 1
Dim op As String
If (ListBox1.SelectedIndex = 0) Then
op = "ออมทรัพย์"
ElseIf (ListBox1.SelectedIndex = 1) Then
op = "ฝากประจำ"
End If
cmd = New SqlCommand("Insert into Customer Values('" & Id & "','" & Text_pass.Text.Trim() & "','" & Text_money.Text.Trim() & "','" & Text_name.Text.Trim() & "','" & Text_ad.Text.Trim() & "','" & Text_mail.Text.Trim() & "','" & Text_tel.Text.Trim() & "','" & Text_money.Text.Trim() & "')", objConn)
cmd.ExecuteNonQuery()