Click here to Skip to main content
15,347,383 members
Home / Discussions / C#
   

C#

 
Questioncombobox problem Pin
akkram2-Aug-07 2:02
Memberakkram2-Aug-07 2:02 
AnswerRe: combobox problem Pin
Martin#2-Aug-07 2:14
MemberMartin#2-Aug-07 2:14 
GeneralRe: combobox problem Pin
akkram2-Aug-07 2:29
Memberakkram2-Aug-07 2:29 
GeneralRe: combobox problem Pin
Martin#2-Aug-07 2:32
MemberMartin#2-Aug-07 2:32 
AnswerRe: combobox problem Pin
Nisar Inamdar2-Aug-07 3:02
MemberNisar Inamdar2-Aug-07 3:02 
QuestionNetResource() in C# Pin
selvasonline2-Aug-07 1:59
Memberselvasonline2-Aug-07 1:59 
AnswerRe: NetResource() in C# Pin
Martin#2-Aug-07 2:03
MemberMartin#2-Aug-07 2:03 
QuestionInsert 20,000 records with NHibernate Pin
Albu Marius2-Aug-07 1:30
MemberAlbu Marius2-Aug-07 1:30 
I am using NHibernate to insert into a database 20,000 records. I would like to know if a time of 15 sec is good or bad and if my method is the best. The code that inserts is this:
private void btnInsertHuge_Click(object sender, EventArgs e)
{
    ITransaction tx = null;
    ISession session = null;

    try
    {
        session = factory.OpenSession();
        tx = session.BeginTransaction();

        InsertHuge(session);

        tx.Commit();
    }
    catch (Exception ex)
    {
        tx.Rollback();
        throw ex;
    }
    finally
    {
        if (session != null)
            session.Close();
    }
}
...........................

private void InsertHuge(ISession session)
{
    for (int i = 0; i < 20000; i++)
    {
        Person person = new Person();
        person.LastName = i.ToString();
        person.FirstName = i.ToString();
        person.PhoneNb = i.ToString();

        Car car = new Car();
        car.LicenseNumber = i.ToString();
        car.Name = i.ToString();
        car.Owner = person;

        session.SaveOrUpdate(car);
    }
 }


NOTE: This is just a test. Smile | :)
AnswerRe: Insert 20,000 records with NHibernate Pin
leppie2-Aug-07 1:55
Memberleppie2-Aug-07 1:55 
GeneralRe: Insert 20,000 records with NHibernate Pin
Albu Marius2-Aug-07 2:03
MemberAlbu Marius2-Aug-07 2:03 
QuestionTransaction in dotNET and SqlServer Pin
Developer6112-Aug-07 1:26
MemberDeveloper6112-Aug-07 1:26 
AnswerRe: Transaction in dotNET and SqlServer Pin
Colin Angus Mackay2-Aug-07 1:39
MemberColin Angus Mackay2-Aug-07 1:39 
AnswerRe: Transaction in dotNET and SqlServer Pin
leppie2-Aug-07 1:56
Memberleppie2-Aug-07 1:56 
Questionwriting xml data from dataset to table Pin
S Palip2-Aug-07 1:09
MemberS Palip2-Aug-07 1:09 
AnswerRe: writing xml data from dataset to table Pin
wilcodk3-Aug-07 0:08
Memberwilcodk3-Aug-07 0:08 
QuestionCorrect Syntax for Multiple "if" Conditions Pin
JamesBarnes2-Aug-07 1:00
MemberJamesBarnes2-Aug-07 1:00 
AnswerRe: Correct Syntax for Multiple "if" Conditions Pin
Seishin#2-Aug-07 1:05
MemberSeishin#2-Aug-07 1:05 
GeneralRe: Correct Syntax for Multiple "if" Conditions Pin
JamesBarnes2-Aug-07 1:07
MemberJamesBarnes2-Aug-07 1:07 
QuestionVideos or Flash files Pin
.NET- India 2-Aug-07 0:14
Member.NET- India 2-Aug-07 0:14 
AnswerRe: Videos or Flash files Pin
il_masacratore2-Aug-07 0:44
Memberil_masacratore2-Aug-07 0:44 
QuestionDatagrid Rows selection Pin
Nisar Inamdar2-Aug-07 0:02
MemberNisar Inamdar2-Aug-07 0:02 
QuestionWhat to do with return type of VARIANT ?? Pin
Yanshof1-Aug-07 23:33
MemberYanshof1-Aug-07 23:33 
AnswerRe: What to do with return type of VARIANT ?? Pin
Christian Graus1-Aug-07 23:44
mveChristian Graus1-Aug-07 23:44 
GeneralRe: What to do with return type of VARIANT ?? Pin
Yanshof1-Aug-07 23:51
MemberYanshof1-Aug-07 23:51 
GeneralRe: What to do with return type of VARIANT ?? Pin
Christian Graus1-Aug-07 23:57
mveChristian Graus1-Aug-07 23:57 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.