I did a small sample with three tier architecture and i need to know whether the flow of the program is correct or not.The pgm works fine.
Inside web.config
Inside Data Access Layer
Inside Business access layer
Inside Presentation layer
I need to know whether my program flow is correct or is there any modifications need to be done.
Thanks
Regards
Raghul
Inside web.config
Code:
<configuration> <appSettings> <add key="Connection" value="server=.;trusted_connection=true;initial catalog=sanjay"/> </appSettings></configuration>
Code:
private string username; private string password; public string UserName { get { return username; } set { username = value; } } public string PassWord { get { return password; } set { password = value; } } public int checking(string username,string password) { int temp = 0; SqlDataReader dr; string con = ConfigurationManager.AppSettings["Connection"].ToString(); SqlConnection connection = new SqlConnection(con); connection.Open(); SqlCommand cmd = new SqlCommand("select * from pass where username='" + username + "' ", connection); dr = cmd.ExecuteReader(); while (dr.Read()) { string a = dr.GetValue(0).ToString(); string b = dr.GetValue(1).ToString(); if ((a.Equals(username)) && (b.Equals(password))) { temp= 1; } else { temp= 0; } } return temp; dr.Close(); connection.Close(); }
Code:
public int checking(string username,string password) { Dal d = new Dal(); return d.checking(username,password); }
Code:
protected void Button1_Click(object sender, EventArgs e) { string uname = TextBox1.Text; string pwd = TextBox2.Text; if (Convert.ToBoolean(b.checking(uname,pwd))) { Button1.Text = "valid"; } else { Button1.Text = "Invalid"; } }
Thanks
Regards
Raghul
Comment