Click here to Skip to main content
15,881,898 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hey.

I'd start with this that I'm pretty new to C# and WinForms so if needed please treat me like an idiot if it's necessary to explain things the easiest way possible :).

So.. Recently I started a new project, it contains DGV which is binded to SQL Server Table. When user adds new row I'd like to pass information about his login and date when he created new row into DB.

I created in my table 2 columns - UsrCrt and DtCrt. I already found out that to pass the creation date I should simply just DateTime.Now, and for Windows user I should use System.Security.Principal.WindowsIdentity.GetCurrent().Name .

However, I don't really have an idea how should I put those as default values for DGV new row.
Posted

1 solution

When you creat the new row, add data into the columns of that row.
 
Share this answer
 
Comments
Jakub Naduk 12-Jul-14 7:21am    
That's not my point. I don't want to add data manualy. I want those to be added automaticly since those two are not visible for user.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900