this one works perfectly?
but when i open this in another pc it will give an error message.
i know database file in destination C:\\
but cant i copy that database file in project folder where i can bring this any where by copying it to my pen.
i have created a same database folder in another machine? but that also won't work?
when i open this in another pc it gives me an error saying?
Unhandled exception has occured in your application. if you click continue, the application will ignore this error and attempt to continue. if you click quit, the application will close immediately.
Could not load file or assembly 'System.Data.SqlServerCe, Version=4.0.0.0, Culture=netural, PublicKey Token=89845dcd8080cc91' or one of its dependencies. The system cannot find the file specified.
What i can do for this?
string connetionString = null;
string name = "";
string pass = "";
connetionString = "Data Source=C:\\Users\\businesssupport\\Documents\\stockDb.sdf";
using (SqlCeConnection con = new SqlCeConnection(connetionString))
{
con.Open();
using (SqlCeCommand command = new SqlCeCommand("SELECT * FROM Login WHERE userName=@Usr", con))
{
command.Parameters.AddWithValue("@Usr", uName.Text);
SqlCeDataReader reader = command.ExecuteReader();
while (reader.Read())
{
name = reader.GetString(1);
pass = reader.GetString(2);
}
if (name == uName.Text && pass == uPass.Text)
{
MessageBox.Show("Password Accepted");
}
else
{
MessageBox.Show("Password Incorrect, Please Re-Enter Your Password");
}
}