 |
|
[VB.NET] ข้อมูลที่เก็บใน MySQL แสดงผลถาษาไทยเป็นภาษา "????????" แก้ยังไงดีครับ |
|
 |
|
|
 |
 |
|

ข้อความที่เป็น "????" เป็นภาษาไทยเท่านั้นนะครับ
Code
Imports MySql.Data.MySqlClient
Public Class Form_coun
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim Conn As MySqlConnection
Conn = New MySqlConnection()
Conn.ConnectionString = "Server=112.121.151.206;User Id=xxxxxxx; Password=xxxxxx; Database=ycklninh_counselor;"
Try
Conn.Open()
Catch myerror As MySqlException
MsgBox("ติดต่อฐานข้อมูลไม่ได้")
End Try
Dim myAdapter As New MySqlDataAdapter
Dim sqlquery = "SELECT * FROM data WHERE code = '" + txtcode.Text + "' "
Dim Mycommand As New MySqlCommand()
Mycommand.Connection = Conn
Mycommand.CommandText = sqlquery
myAdapter.SelectCommand = Mycommand
Dim mydata As MySqlDataReader
mydata = Mycommand.ExecuteReader()
If mydata.HasRows = 0 Then
Conn.Close()
Conn.Open()
sqlquery = " INSERT INTO data (nickname, email, subj_head, sub_subj,code,type) VALUES ('" + txtnickname.Text + "','" + txtemail.Text + "','" + txtsubj_head.Text + "','" + txtsub_subj.Text + "','" + txtcode.Text + "','ยังไม่ได้แก้ไข')"
Mycommand.Connection = Conn
Mycommand.CommandText = sqlquery
mydata = Mycommand.ExecuteReader()
MsgBox("ส่งข้อมูลเก็บสู่ระบบเรียบร้อยแล้ว")
Me.Hide()
Else
index.Show()
End If
End Sub
End Class
Tag : .NET, VBScript
|
ประวัติการแก้ไข 2012-08-10 22:29:45
|
 |
 |
 |
 |
Date :
2012-08-10 22:25:44 |
By :
namkabz |
View :
1263 |
Reply :
12 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ฝั่งรับ ต้องเป็น utf-8
|
 |
 |
 |
 |
Date :
2012-08-11 21:44:47 |
By :
hackerboy |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ถ้าหากยังฟ้อง error ตอนรัน ให้เปลี่ยนจาก UTF8 ตัวใหญ่ เป็น utf8 ตัวเล็กนะครับ ติดปัญหานี้เหมือนกัน ขอบคุณพี่ mr.win มากๆ เลยครับ
|
 |
 |
 |
 |
Date :
2012-08-15 16:06:40 |
By :
jarun |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
แจ่มครับ
|
 |
 |
 |
 |
Date :
2012-08-15 21:26:17 |
By :
mr.win |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ถามอีกนิดนึงครับ เชื่อมต่อไป Mysql เซิฟเวอร์ข้างนอกเวลาบัยทึกแล้วเปน ??? เหมือนเดิมครับ แต่ว่าถ้าลองบน appserv ใน localhost แสดงเป็นภาษาไทย พอจะมีวิธีแก้มั้ยครับ ตั้งเป็น UTF8_General_ci แล้ว
|
 |
 |
 |
 |
Date :
2012-08-25 23:39:08 |
By :
namkabz |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ข้างนอกนี่ที่ไหนครับ
|
 |
 |
 |
 |
Date :
2012-08-26 08:10:07 |
By :
mr.win |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
เชิฟเวอร์อีกเครื่องนึงไงครับคือโปรแกรมจะส่งข้อมูลไปหา Mysql ที่ออนไลน์ข้างนอก
|
 |
 |
 |
 |
Date :
2012-08-26 19:47:21 |
By :
namkabz |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ใช้ผ่าน Web Service หรือเปล่าครับ ?
|
 |
 |
 |
 |
Date :
2012-08-26 21:05:09 |
By :
mr.win |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ป่าววครับ ตั้งอนุญาติการเชื่อมต่อเป็น % แล้วเชื่อมต่อจากโปรแกรมโดยตรงเลย
|
 |
 |
 |
 |
Date :
2012-08-26 21:22:20 |
By :
namkabz |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|

ให้ไปตั้งในแต่ละแถวก่อน ไม่งั้นมันจะบันทึกเป็น ??????? หมดเลย
|
 |
 |
 |
 |
Date :
2012-08-27 09:03:02 |
By :
angelrings0 |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
อ๋อ ขอบคุณมากครับ
|
 |
 |
 |
 |
Date :
2012-08-28 22:21:01 |
By :
namkabz |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ขอบคุณครับ
|
 |
 |
 |
 |
Date :
2012-08-29 14:03:00 |
By :
SystemError |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|