View: 2428|Reply: 12
|
Windows CE application + MySQL
[Copy link]
|
|
Hye forumers sekalian....
Haritu dah settle pasal Windows Application VB.Net + MySQL....
Skang ni plak, aku ada masalah connection VB.Net + MySQL dalam Windows CE application......kira handheld device, pocket pc, etc...
Anyone??? |
|
|
|
|
|
|
|
wowww.. myamira otai rupanya.... tumpang tanya sket lagi... untuk Handheld.. kita nk connection bloototh dari handheld ke printer (like o'neil printer).. mcm mana plakk arrr.... use dev c++
-cup... cuupp- atas tuh bukan saya taip... member saya.. siot!!!:@
[ Last edited by naikAntena at 3-12-2008 02:01 PM ] |
|
|
|
|
|
|
|
well....sebab tak tau la sy tanya ni...hehehe...
so, ada idea tak? |
|
|
|
|
|
|
|
dah ader ke driver mysql untuk compact framework? |
|
|
|
|
|
|
|
dah ada.....pakai Connector .Net 5.1.7 punya...
tapi dia kluar error....Unable to connect to any of the specified MySQL hosts
kenapa ek? |
|
|
|
|
|
|
|
ni coding saya......for ur reference......
- Imports System.Data
- Imports MySql.Data.MySqlClient
- Public Class Form1
- Dim mycon As New MySqlConnection
- Dim mycmd As New MySqlCommand
- Dim myreader As MySqlDataReader
- Private Sub btnEnter_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnEnter.Click
- 'Dim myconstr As String
- If txtUsername.Text = "" Then
- MsgBox("Please enter the Username", MsgBoxStyle.OkOnly, "No Username")
- txtUsername.Focus()
- Exit Sub
- End If
- If txtPassword.Text = "" Then
- MsgBox("Please enter the Password", MsgBoxStyle.OkOnly, "No Password")
- txtPassword.Focus()
- Exit Sub
- End If
- 'myconstr = "Server=localhost;" & _
- ' "Database=testing;" & _
- ' "Uid=root;" & _
- ' "Pwd=;"
- 'myconstr = "database=testing;Data source=localhost;User Id=root;Password="
- 'myconstr = "datasource=localhost;username=root;password=;database=testing"
- 'mycon = New MySqlConnection(myconstr)
- mycon.ConnectionString = "server=localhost;user id=root;database=testing"
- 'mycon.ConnectionString = "user id = root;database=testing;host=localhost;password="
- 'mycon.ConnectionString = "Server=localhost:3306;Database=testing;User ID=root;Password=xxxx;CharSet=utf8"
- mycon.Open()
- mycmd.Connection = mycon
- mycmd.CommandText = "SELECT username, password, message FROM login"
- myreader = mycmd.ExecuteReader
- While (myreader.Read())
- If myreader.GetValue(myreader.GetOrdinal("username")) = txtUsername.Text Then
- If myreader.GetValue(myreader.GetOrdinal("password")) = txtPassword.Text Then
- Form2.lblUsername.Text = txtUsername.Text
- txtUsername.Text = ""
- txtPassword.Text = ""
- Hide()
- Form2.Show()
- Form2.lblMessage.Text = myreader.GetValue(myreader.GetOrdinal("message"))
- myreader.Close()
- mycon.Close()
- Exit Sub
- Else
- MsgBox("Wrong Password", MsgBoxStyle.Exclamation, "Password Error")
- txtPassword.Text = ""
- txtPassword.Focus()
- myreader.Close()
- mycon.Close()
- Exit Sub
- End If
- End If
- End While
- MsgBox("User does not exist", MsgBoxStyle.OkOnly, "Username Error")
- txtUsername.Text = ""
- txtPassword.Text = ""
- txtUsername.Focus()
- myreader.Close()
- mycon.Close()
- End Sub
- End Class
Copy the Code
[ Last edited by mya_myra at 5-12-2008 08:21 AM ] |
|
|
|
|
|
|
|
macam2 connection string saya pakai....
'myconstr = "Server=localhost;" & _
' "Database=testing;" & _
' "Uid=root;" & _
' "wd=;"
'myconstr = "database=testing;Data source=localhost;User Id=rootassword="
'myconstr = "datasource=localhost;username=root;password=;database=testing"
'mycon = New MySqlConnection(myconstr)
mycon.ConnectionString = "server=localhost;user id=root;database=testing"
'mycon.ConnectionString = "user id = root;database=testing;host=localhost;password="
'mycon.ConnectionString = "Server=localhost:3306;Database=testing;User ID=rootassword=xxxx;CharSet=utf8"
tapi semua kluar error yg sama.....takleh connect.... |
|
|
|
|
|
|
|
Reply #7 mya_myra's post
pocket pc mya tue boleh connect through network ke? |
|
|
|
|
|
|
|
taktau lak leh connect ke tak....
actually, bleh ker install mysql dalam pocket pc ni? |
|
|
|
|
|
|
|
Reply #9 mya_myra's post
baru nak tanya...
cube check mysql ader tak buat untuk mysql mobile..
sting biasa pakai sqlce.. SQL server compact edition.. |
|
|
|
|
|
|
|
Reply #11 mya_myra's post
sqlce dia under microsoft..
rasanye free ... dia adalah sqlserver tapi dibuat untuk mobile/pocket pc.
kalau nak baca kene donwload jugak RAPI ...
rapi nie dll untuk baca sqlce punye database. |
|
|
|
|
|
|
|
saya ada cuba sqlce ni....through this website http://msdn.microsoft.com/en-us/library/aa454892.aspx
tapi dia dah customized khas untuk add and edit...dan dia tak bagi contoh untuk delete dan retrieve.....
saya nak contoh untuk login guna username & password.....stingbeh ada example tak... |
|
|
|
|
|
|
| |
|