-
Similar Content
-
By wisel
Mencari Vb Developer Utk Handwriting Recognition System Using Svm
harga kalau boleh dibincang kan utk yg berminat
tolong email sy di [email protected]
-
By saya nurul
salam,
saya create login page dlm c# dan mysql database, dan saya hadapi masalah untuk hantar user(customer, admin) ke homepage berlainan selps login. Ni koding yang sya tlh buat, tp still ad error. harp ada yg boleh membntu sya..
terima kasih
-----------------------------------------------
using System;
using System.Collections.Generic;
using System.Linq;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using MySql.Data.MySqlClient;
using System.Data;
using System.Text.RegularExpressions;
namespace WebApplication6
{
public partial class logmasuk : System.Web.UI.Page
{
public DbConnection connection;
string sqlQ;
DataSet myData;
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
bool closeConn;
MySqlDataReader myData;
sqlQ = "SELECT userType FROM login WHERE ic='" + TextBoxnp.Text.ToString() + "' AND pass ='" + TextBoxkl.Text.ToString() + "'";
DbConnection myDB = new DbConnection();
//myData = myDB.Retrieve(sqlQ, "login");
myData = connection.RetrieveDR(sqlQ, "login");
while (myData.Read())
{
if (myData.GetString("userType").Equals("3"))
{
Response.Redirect("adminHome.aspx?Id=" + this.TextBoxnp.Text);
}
else if (myData.GetString("userType").Equals("2"))
{
Session["ic"] = TextBoxnp.Text;
Response.Redirect("userHome.aspx?Id=" + this.TextBoxnp.Text);
}
else
{
Response.Redirect("logmasuk.aspx");
}
}
//myData.Close();
//closeConn = connection.CloseConnection();
}
}
}
-