Greg Robinson's Blog

I report it, you decide

Click Once

Custom Authentication in Windows Forms

DataBinding Stuff

Favorite Links

My book contribution

My Book Reviews

My Personal Life

Richmond, VA .NET Users Group

Smart Client Stuff

What I am reading

October 2003 - Posts

Happy Halloween

http://dotnetrocks.blogspot.com/Pumpkins%202003%20001.jpg

[Now Playing: Pieces of a Dream - Pieces (05:10)]

Richmond, VA .NET UG
This is a weekly reminder that our first meeting will take place next Thursday - November 6th, at 6:30PM.  The meeting will be held at Fahrenheit Technology (http://www.hottechnology.com).  They are located at the following location in Innsbrook:
 
4501 Highwoods Parkway, Suite 270
Glen Allen, VA  23060
Phone:  804-935-5600
 
If you have any questions or need more directions, please feel free to let me know.  Again, we will be having two guest speakers, Paul Ballard from INETA (International .NET Association) and Pablo Saez from Microsoft.  Paul will be discussing some different facets of using Windows Forms and Pablo will be talking about cryptography.  Paul may also be talking about some of the exciting stuff that he has found out at the PDC this week (Longhorn!)
 
Once again, feel free to bring your friends.  We are really trying hard to have a nice turnout for our first meeting.
more cool stuff coming

Developer Tools Roadmap

http://msdn.microsoft.com/vstudio/productinfo/roadmap.aspx

[Now Playing: Simply Red - Home Loan Blues (05:00)]

PDC Bloggers

In case you missed this feed, it is a good one:

http://pdcbloggers.net/Feed.rss 

[Now Playing: Simply Red - Sunrise (03:19)]

Business Logic in your Data Tier....what the!

I have been waiting for MS's position on this.  Seems they have stated their position:

http://hyperthink.net/blog/PermaLink.aspx?guid=851f30ac-04ef-43fa-b8db-cd9e7ff09eb5

[Now Playing: Simply Red - Something for You (05:59)]

Cobol to .NET

I have been waiting for someone to write this:

http://www.apress.com/book/bookDisplay.html?bID=112

Use a FCL Exception or create my own

I debate this almost daily.  As an example:

Our Middle Tier logic takes a DataSet for an Update. I want to confirm, in

this particular Update method, that the DataTable to update is contained in

the Tables collection. If it's not, I want to throw an exception.

I can throw 'InvalidOperationException' or throw a custom user defined

exception like '<tablename>MissingException'. The sdk states to use FCL

exceptions when possible, however a custom one in this case might be more

meaningful.

What are folks doing in cases like this? That is, cases where a FCL

exception kind of fits but a custom one might be more meaningful.

DataAdapter.Update...how to handle inserts into multiple tables

When users add a new record in our app, we need to do an insert into 5 sql server tables. This insert needs to run in a transaction, and, if one insert fails, we need to do a Rollback on all the Inserts.  The first 4 inserts return keys that are used as part of the last insert.  Meaning, prior to doing the last insert, we need the key values from the first 4 inserts. 

Our initial select returns 5 resultsets, which are stored in 5 DataTables on the client.  DataRelations are built between these 5 DataTables. 

Now, on an AddNew on the client, 5 Added DataRows are created, one in each of the 5 Datatables.  If we use DataAdapter.Update, we have to send each DataTable seperately, therefore we cannot run the Insert as a whole, under one transaction.

Is therer a feature of DataAdapter.Update that I am not aware of that will allow us to somehow send all 5 DataTables at one time?  The insert sprocs are currently written as 1:1 to each sql server table.  We can easily create one sproc that executes all 5 insert sprocs, however getting the values into this main sproc is not possible unless we have one DataTable.  That is if we want to use the DataAdapter.Update model. 

One solution is to add all of the Added DataRows to one new custom DataTable just prior to the call to update, however this feels like a hack and I am not even sure this will work.

So, I have concluded this simply cannot be done with DataAdapter.  Can anyone prove me worng?  

  

DAAB V 2.0 and Updates

This version adds code for Updates like this:

Public Overloads Shared Sub UpdateDataset(ByVal insertCommand As SqlCommand,
ByVal deleteCommand As SqlCommand, ByVal updateCommand As SqlCommand, ByVal
dataSet As DataSet, ByVal tableName As String)

I am shocked to see Command objects being passed to a DAL.  I used DAAB V
1.0 months ago and extended it for updates, adding the exact same method
name, however the only thing passed in is a connection string and a DataSet.

Our DAL will be for us, and us only.  It will always hit SQL Server.  It is
'OK' to send SqlCommands in this case?  If yes, then this sure makes my job
a lot easier as far as coding for Inserts 'generically' in our DAL.

Richmond, VA .NET Users Group is growing
We are pleased to announce that the Richmond.NET User Group has been accepted to the International .NET Association (INETA). 
More Posts