G
Guest
I have a Solution File containing 2 SmartDevices Projec
One is Smartdevice Application (VB), another was Smartdevice Class (C#
The Program failed on conn.open() inside class method loginServer() in the C# code belo
The source for class is as below, these version is modified by my previous .NET Framework class
using System
using System.Data.SqlClient
using System.Collections
namespace COR
public class clsSE
/// <summary
/// Summary description for clsMLM
/// </summary
public string g_ConnectionStr = ""
public string g_ErrMsg = ""
public clsSEM(
g_ConnectionStr = "Persist Security Info=False;User ID=mlsdba;Password=notellingu;Initial Catalog=mls;Data Source=localhost";
public string loginServer(string i_userID, string i_pwd
string p_sql = "EXEC sp_login '" + i_userID + "', '" + i_pwd + "'";
string intReturnValue = ""
SqlConnection conn = new SqlConnection(g_ConnectionStr)
SqlCommand cmd = new SqlCommand(p_sql, conn);
tr
conn.Open()
SqlDataReader rs = cmd.ExecuteReader()
if ( rs.Read() == true
intReturnValue = rs["login_status"].ToString();
rs.Close()
catch(Exception e
// g_ErrMsg = "[" + e.Source + "]" + e.Message
g_ErrMsg = e.Message
finall
conn.Close()
return intReturnValue
public string changePassword(string i_studentID, string i_studentOldPassword, string i_studentNewPassword
string p_sql = "EXEC sp_changepassword '" + i_studentID + "', '"
+ i_studentOldPassword + "', '"
+ i_studentNewPassword + "'"
string sReturnValue = ""
SqlConnection conn = new SqlConnection(g_ConnectionStr)
SqlCommand cmd = new SqlCommand(p_sql, conn)
SqlDataReader rs = null
tr
conn.Open()
rs = cmd.ExecuteReader()
if ( rs.Read() == true
sReturnValue = rs["return_status"].ToString();
rs.Close()
catch(Exception e
// g_ErrMsg = "[" + e.Source + "]" + e.Message
g_ErrMsg = e.Message
finall
conn.Close()
return sReturnValue
public string removeStudent(string i_studentID
return null
--------------------------------------------------------------------------
My Smartdevice contains of 3 textbox and a butto
below is the button click event's cod
Dim o_login As New CORE.clsSE
TextBox3.Text = o_login.loginServer(Trim(TextBox1.Text), Trim(TextBox2.Text)
--------------------------------------------------------------------------
I've write both VB.NET Windows Application and Web Application to test this class. but now I try to port it into
PocketPC.
Please help..
Thanks
Ron
One is Smartdevice Application (VB), another was Smartdevice Class (C#
The Program failed on conn.open() inside class method loginServer() in the C# code belo
The source for class is as below, these version is modified by my previous .NET Framework class
using System
using System.Data.SqlClient
using System.Collections
namespace COR
public class clsSE
/// <summary
/// Summary description for clsMLM
/// </summary
public string g_ConnectionStr = ""
public string g_ErrMsg = ""
public clsSEM(
g_ConnectionStr = "Persist Security Info=False;User ID=mlsdba;Password=notellingu;Initial Catalog=mls;Data Source=localhost";
public string loginServer(string i_userID, string i_pwd
string p_sql = "EXEC sp_login '" + i_userID + "', '" + i_pwd + "'";
string intReturnValue = ""
SqlConnection conn = new SqlConnection(g_ConnectionStr)
SqlCommand cmd = new SqlCommand(p_sql, conn);
tr
conn.Open()
SqlDataReader rs = cmd.ExecuteReader()
if ( rs.Read() == true
intReturnValue = rs["login_status"].ToString();
rs.Close()
catch(Exception e
// g_ErrMsg = "[" + e.Source + "]" + e.Message
g_ErrMsg = e.Message
finall
conn.Close()
return intReturnValue
public string changePassword(string i_studentID, string i_studentOldPassword, string i_studentNewPassword
string p_sql = "EXEC sp_changepassword '" + i_studentID + "', '"
+ i_studentOldPassword + "', '"
+ i_studentNewPassword + "'"
string sReturnValue = ""
SqlConnection conn = new SqlConnection(g_ConnectionStr)
SqlCommand cmd = new SqlCommand(p_sql, conn)
SqlDataReader rs = null
tr
conn.Open()
rs = cmd.ExecuteReader()
if ( rs.Read() == true
sReturnValue = rs["return_status"].ToString();
rs.Close()
catch(Exception e
// g_ErrMsg = "[" + e.Source + "]" + e.Message
g_ErrMsg = e.Message
finall
conn.Close()
return sReturnValue
public string removeStudent(string i_studentID
return null
--------------------------------------------------------------------------
My Smartdevice contains of 3 textbox and a butto
below is the button click event's cod
Dim o_login As New CORE.clsSE
TextBox3.Text = o_login.loginServer(Trim(TextBox1.Text), Trim(TextBox2.Text)
--------------------------------------------------------------------------
I've write both VB.NET Windows Application and Web Application to test this class. but now I try to port it into
PocketPC.
Please help..
Thanks
Ron