string path = Application.StartupPath.Substring(0, Application.StartupPath.Substring(0, Application.StartupPath.LastIndexOf("\\")).LastIndexOf("\\"));
path += @"\1.mdb";
string constr = "Provider=Microsoft.Jet.OLEDB.4.0;Data source=" + path;
OleDbConnection conn = new OleDbConnection(constr);
conn.Open();
SqlCommand cmd=new SqlCommand();
="select * FROM DB_user where user_id='" + name + "' and password='" + password + "'";
Int32 count =Convert.ToInt32(cmd.ExecuteScalar());
if(count>0)
{
MessageBox.Show("OK");
}
else
{
MessageBox.Show("NO");
Int32 count =Convert.ToInt32(cmd.ExecuteScalar());
怎么老是说这个未初始化呢?不知是何解?