I found a new entry for an OOM and their example surprised me.
Table Name: tb_Users

Fields:
cod_UserName nvarchar(50) PRIMARY KEY
txt_FullName nvarchar(200)
txt_EmailAddress nvarchar(50)
dat_DateOfBirth datetime
num_Dependents int

In years of doing T-SQL or others, I have not seen examples of binding
the data type into the name of the object.

In VFP code it is the norm for a lot of examples here.

Do you really need to cCompany dStartDate, iPeriods,...  ?  Or would
Company StartDate, Periods work properly but old habits just die hard?

This OOM page is : <http://code.msdn.microsoft.com/XGENOORM>

It is the right price, free!  tiny little dll is all it needs.

this is pretty straight forward as well.  nHibernate looks more robust
in features, but looks real easy.
-------
1) Declare a class for the above structure as below:

public class User
{
public string UserName { get; set; }
public string FullName { get; set; }
public string EmailAddress { get; set; }
public DateTime DOB { get; set; }
public int Dependents { get; set; }
}

2) Make one time setup for database as follows:

DBConfig.SetDB("server=XGENO-DEV;database=Accounting_DB;Integrated
Security=SSPI;");

3) Do the following:

User _user = new User();

_user. UserName = "naweed";
_user. FullName = "Naweed Akram";
_user.EmailAddress = "[email protected]";
_user.dOB = new DateTime(1976, 9, 6);
_user.Dependents = 2;

_user.Save(); //To save the newly created user

Or

User _user = User.GetByID("nakram");
_user.FullName = "Naweed Akram Mughal";
_user.Save(); //To update an existing user
_user.Delete(); //To delete the existing user

Or

List<User> _userList = User.FindAll(); //Find all the users in the system

//Find all the users in the system who have three dependents
List<User> _userList = User.Find ("Dependents", "=", "3");

//Find all the users in the system who have names starting with N
List<User> _userList = User.Find ("FullName", "like", "N%");

//Find all the users in the system who have names starting with N, get
top 5 records and sort by FullName
List<User> _userList = User.Find ("FullName", "like", "N%", 3, "FullName");


-- 
Stephen Russell
Sr. Production Systems Programmer
First Horizon Bank
Memphis TN

901.246-0159

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to