Tuesday, June 15, 2004

.Stories of a .NET Newbie (3)

1) From the MSDN Help:

"Applications that implement role-based security grant rights based on the role associated with a principal object"

Well, it sounds less hard than it is actually; at least to me. This Principal thing is a completely new concept to me. I know Users and the use of adding them to Roles of course, but first I totally couldn't grasp why one would use something on top of the User/Role scheme. Well, something to dig into some more the coming days.

2) Man, has Data handling become a simple matter. I'm communicating with my SQL Server now without having written any line of code, right from within my web pages! I always used something like the following to make a custom connection:

Set rst = New ADODB.Recordset
Rst.LockType = adLockOptimistic
Rst.CursorType = adOpenKeyset
Rst.Open "SELECT * FROM MyTable WHERE user = " & verifiedString & "'"
Do Until Rst.EOF
...dostuff
Loop
Rst.Close
Set Rst = Nothing

But now... I opened up the Server Explorer, use the GUI to add a new connection to the SQL Server in the IDE. After entering the password the whole wealth of SQL Server unfolds itself right into the IDE. I can even make table changes on the fly if I want. But, what you're basically doing to enable paging is the putting a Table or Stored Procedure to your form. This automatically adds a SqlConnection1 and SqlDataAdapter1 to the so-called component tray area. No with basically some right-clicking here and there you set up the database connection; set a couple of details like the numbers of rows on your page, the kind of record selectors, and you're done. No more debugging unnecessary, repeating code with lots of typos, or hidden errors which only show up at runtime etc, etc.

For the first time in years coding has become *real* fun again