Click here to Skip to main content
15,902,892 members

Comments by Member 13552848 (Top 1 by date)

Member 13552848 2-Dec-17 2:59am View    
please help me out m using 3tier and in my dal i found a command type error

public virtual int Insert(PAL_registration pl)
{


SqlConnection conn = new SqlConnection();
SqlCommand cmd = new SqlCommand("Pro_registration", conn);

cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue("@UserName",pl.UserName);
cmd.Parameters.AddWithValue("@Password", pl.Password);
cmd.Parameters.AddWithValue("@Email", pl.Email);
cmd.Parameters.AddWithValue("SecurityAnswer", pl.SecurityAnswer);

try
{
conn.Open();
cmd.ExecuteNonQuery();
}
catch
{ }

}

}

in connection string m using sqlhelper class file bt connection is nt established