[dba-VB] Create a Module and Write to It

Dan Waters df.waters at comcast.net
Sun Mar 11 13:14:38 CDT 2012


Hi Arthur,

If you are using SQL Server tables it's likely that you can skip all this
entirely by using Linq-to-SQL.  With this method you can drag a table to the
Linq-to-SQL screen to create the class.  Then in code you do things like
Submit() to have LINQ-to-SQL update the data in the database.  It's a
change, but it's a good one.

Just do a search and you'll find a lot of explanation.

Dan

-----Original Message-----
From: dba-vb-bounces at databaseadvisors.com
[mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Arthur Fuller
Sent: Sunday, March 11, 2012 12:41 PM
To: Discussion concerning Visual Basic and related programming issues.
Subject: [dba-VB] Create a Module and Write to It

I've decided to resurrect an old utility I wrote years back, that accepts
the name of a table and then generates a class definition complete with LETs
and GETs for the fields, and methods for Load(), Insert(), Update() and
Delete().

Naturally, I can't locate the code which is somewhere on one of my numerous
CDs. And besides, now that I'm a tad more mature, I can probably do it
better now. The original, for example, just banged its generated code out to
a text file, which I then had to manually import. Which brings me to the
question in the Subject. How can I create a module in code, then write the
generated code directly into it?

TIA.
--
Arthur
Cell: 647.710.1314

The most likely way for the world to be destroyed, most experts agree, is by
accident. That's where we come in; we're computer professionals. We cause
accidents.

-Nathaniel
Borenstein<http://www.quoteland.com/author/Nathaniel-Borenstein-Quotes/63/>
_______________________________________________
dba-VB mailing list
dba-VB at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/dba-vb
http://www.databaseadvisors.com



More information about the dba-VB mailing list