Joined: Fri Mar 20, 2009 4:19 am Posts: 11
|
I am using Hibernet Asp.NET and i need help in delleting a record which is having composite key.
For Primary key I am using this code.
NHibernate.Cfg.Configuration config = new NHibernate.Cfg.Configuration();
config.AddAssembly(typeof(CSTS.Main.Fund).Assembly);
factory = config.BuildSessionFactory();
session = factory.OpenSession();
Fund fund = session.Get<Fund>(txtCode.Text);
if (fund == null)
{
ShowMessageBox("This account information does no exisits!");
}
else
{
try
{
session.Transaction.Begin();
session.Delete(fund);
session.Transaction.Commit();
ShowMessageBox("Account Deleted");
For Composite key, What shd be in this below code.. I am having 3 column in composite key.
Fund fund = session.Get<Fund>(txtCode.Text);
|
|