Conversion failed when converting the varchar value '11/3/2012 12:14:12 PM' to data type int?
<p>Hi i need help to resolve the issue which occurred to me..</p>

<p>My issue is when user enter into application user will enter by login. The login detail will store in database by id,user intime, outtime. while entering user intime allow will store in db and outtime will be "0". If user logoff the application only outtime will store in db.
What i want to do mean currently user running the application with intime and outtime will be "0". Without logoff current appli user try to open the same apllication with user login .i want to show the the user is already logged in. Unfortunately i getting this error anyone can be help to resolve this issue?</p>

<p>I'm using c#(windows application) </p>

<p>this is my sqlhelper code:</p>

<pre><code>public string GetConcurrentDetails()
        {

            string count;
            SqlConnection conn1 = new SqlConnection();
            conn1.ConnectionString = GetConnectionString();
            SqlCommand cmd = new SqlCommand();
            cmd.Connection = conn1;
            conn1.Open();
            cmd.CommandType = CommandType.Text;
            cmd.CommandText = "select login_trail from login_table where outtime = 0 " ;

                count = (string)cmd.ExecuteScalar();
                // int value = (int)count1;
                test = count;
                //   DateTime test = Convert.ToDateTime(count1);
                // int test = Convert.ToInt32(count1);
                //  string test1 = test.ToString();
                MessageBox.Show(test);

                return test;

        }
</code></pre>
