Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- string con = "Data Source=xxx.database.windows.net;User id=xxx;password=xxx;Database=Playvoice;encrypt=true;";
- private SqlConnection sqlConnection;
- try {
- SqlCommand sqlCommand;
- string sql = "UPDATE last_login SET date=getdate(), ip=@param1 WHERE id_user=@param2";
- sqlCommand = new SqlCommand(sql, sqlConnection);
- sqlCommand.Parameters.AddWithValue("@param1", GetIPAddress());
- sqlCommand.Parameters.AddWithValue("@param2", auth.eid);
- sqlCommand.Connection = sqlConnection;
- sqlConnection.Open();
- sqlCommand.ExecuteNonQuery();
- sqlConnection.Close();
- }
- catch (Exception ex)
- {
- MessageBox.Show("Blad z polaczeniem SQL");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement