I have a SQL Server Express database with tables
I use this code to store into a table
SqlConnection con = new SqlConnection(@"Data Source=.\SQLEXPRESS;AttachDbFilename=E:\Company Management System\DBConn.mdf;Integrated Security=True;User Instance=True;");
con.Open();
SqlCommand cmd = new SqlCommand("INSERT INTO [GATE Activity] (activity, date)VALUES ('" +"Closed" + "','" + dateTimePicker1.Value.ToString("dd/MM/yyyy hh:mm:ss tt") + "')", con);
cmd.ExecuteNonQuery();
con.Close();
but now I need to do the exact opposite. I have a table called PASSWORDS with the first column called password
I want to copy the value from the last row into a string in C# called pass from example