none
request a Help RRS feed

  • Question

  • Hi

    Im in problem with this code ,Pleas Help me

    SqlConnection con = new SqlConnection();

    SqlCommand com = new SqlCommand();

    con.ConnectionString =

    "Data Source=MADI-HP;Initial Catalog=Ba;Persist Security Info=True;User ID=sa;password=vahid_madi1359";

    com.Connection = con;

    con.Open();

    string strSql1;

    /*strSql1 ="SELECT count(*) FROM UsertaTable WHERE Username='+txt_username.Text+' and pass='+txt_password.Text+'";*/

    strSql1 =

    "SELECT[Username],[Pass] FROM [Herasat].[dbo].[UsertaTable] WHERE Username='+txt_username.Text+' and pass='+txt_password.Text+'";

    SqlCommand mycmd= new SqlCommand();

    mycmd.Connection = con;

    mycmd.CommandText = strCon;

    SqlDataAdapter da = new SqlDataAdapter();

    da.SelectCommand= mycmd;

    DataTable dt = new DataTable();

    da.Fill(ds,

    "UsertaTable");It doesent work.

    Tuesday, February 5, 2013 8:24 AM

Answers