1
Answer

How to mange multiple logins for same user ASP.NET MVC

Mallesh kumar

Mallesh kumar

6y
3.3k
1
How to mange multiple logins for same user on different browsers or from diffrent locations.
Able access from more than 1 device.
how this can be acheived in ASP.NET MVC? 
Answers (1)
0
Sanjeeb Lenka

Sanjeeb Lenka

NA 15.3k 2.4m 9y
try like this.
 
 
string s = System.Configuration.ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;

SqlConnection con = new SqlConnection(s);

SqlCommand cmd = new SqlCommand("select * from table where Id='" + value + "'", con);

cmd.CommandType = CommandType.Text;

cmd.Parameters.AddWithValue("@Id",value);



cmd.Connection = con;

con.Open();



SqlDataReader dr = cmd.ExecuteReader();

while (dr.Read())

{

TextBox1.Text = dr["username"].ToString();

TextBox2.Text = dr["password"].ToString();

TextBox3.Text = dr["fname"].ToString();

TextBox4.Text = dr["gender"].ToString();

}



dr.Close();

con.Close();