Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Data;
- using System.Data.SqlClient;
- public partial class _Default : System.Web.UI.Page
- {
- protected void Page_Load(object sender, EventArgs e)
- {
- }
- protected void Button1_Click(object sender, EventArgs e)
- {
- SqlConnection conn = new SqlConnection();
- conn.ConnectionString =
- "Data Source=test\testserver;" +
- "Initial Catalog=tidsregistering;" +
- "User id=zbcuser;" +
- "Password=Asdf1234;";
- conn.Open();
- SqlDataAdapter sda = new SqlDataAdapter("Select count(*) From Bruger Where brugernavn = '" + TextBox1.Text + "' and password= '" + TextBox2.Text + "'",conn);
- DataTable dt = new DataTable();
- sda.Fill(dt);
- if (dt.Rows[0][0]. ToString() == "1")
- {
- Response.Redirect("Default2.aspx");
- }
- else
- {
- Label1.Visible = true;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement