Quantcast
Channel: Windows Forms Data Controls and Databinding forum
Viewing all articles
Browse latest Browse all 2535

How to prevent currently loged in user from deleting himself from database?

$
0
0

Hi;

I have a data table contains username and password and type, and a gridview to edit users. Now when I click the delete user button I want it to check if the current user name and selected rows user name is same or not. I have a string called kullaniciadi where I keep last loged in username from textbox1.text like this:

kullaniciadi = UserNametextBox1.Text;

And I tryed this but well it doesn't work for apearently obvious reasons couse I couldn't find anything on the internet about this:

if ( log_InDataGridView.CurrentCell.Value.ToString == kullaniciadi)
                    MessageBox.Show ( "Cannot delete currently loged in user" );
How can I do this?
Thanx.


Viewing all articles
Browse latest Browse all 2535

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>