I'm making a small application with windows mobile 6.5 using Visual Studio 2008 vb.net and SQLCE 3.51
i try to update the table name "UserSet" when i run the application for testing in my desktop i found No error
but when i look on the table there's no changes
Here is my Code
Public Function App_Path() As String
'return the application path
Return System.IO.Path.GetDirectoryName( _
System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase)
End Function
Private Sub CmdOK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CmdOK.Click
Dim data_base As String = "\\sqlSA1.sdf"
Dim ConnString As String = "Data Source=" & App_Path() & data_base
Try
Me.TextBox1.Text = App_Path() & data_base
Dim conn As SqlCeConnection = New SqlCeConnection(ConnString)
conn.Open()
Dim cmd As SqlCeCommand = conn.CreateCommand
cmd.CommandText = "Update UserSet set UserLogin = @Status where UserName = @UserName and UserPassword = @Password"
Dim Stat As SqlCeParameter
Dim UserN As SqlCeParameter
Dim PassW As SqlCeParameter
Stat = cmd.Parameters.Add("Status", SqlDbType.NVarChar)
UserN = cmd.Parameters.Add("UserName", SqlDbType.NVarChar)
PassW = cmd.Parameters.Add("Password", SqlDbType.NVarChar)
Stat.Value = "Y"
UserN.Value = Me.Text_UserName.Text
PassW.Value = Me.Text_Password.Text
cmd.ExecuteNonQuery()
MsgBox("record updated")
conn.Close()
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
Thank you in advance

New Topic/Question
Reply


MultiQuote





|