Hi Tuna,
I moved the mdf and ldf(log) file into the folder where are others
xaml files(GUI Project)
but i receive the same error.
"Cannot open Connection"

______i post my Hibernate.cfg.xml file______

<?xml version="1.0" encoding="utf-8" ?>
<hibernate-configuration
xmlns="urn:nhibernate-configuration-2.2">
        <session-factory>

                <property name="connection.provider">
                        NHibernate.Connection.DriverConnectionProvider
                </property>
                <property name="dialect">
                        NHibernate.Dialect.MsSql2005Dialect
                </property>
                <property name="connection.driver_class">
                        NHibernate.Driver.SqlClientDriver
                </property>

                <property name="connection.connection_string">
                        
Server=ERUSYAKO\SQLEXPRESS;AttachDbFilename=C:\Documents and
Settings\GIORGIO\Desktop\Exercise\ExampleWPF\ExampleWPF
\ExampleWPF.mdf; Database=ExampleWPF;Trusted_Connection=Yes;
                </property>

                <property name="use_proxy_validator">false</property>
        </session-factory>
</hibernate-configuration>

I hope that its can help you to understand better.
Thanks
Bye

On Nov 4, 2:28 pm, "Tuna Toksöz" <[EMAIL PROTECTED]> wrote:
> Move the mdf and ldf files in the project which has the xaml files.
>
> On Tue, Nov 4, 2008 at 9:26 AM, HelpNH <[EMAIL PROTECTED]> wrote:
>
> > Hi Tuna,
> > i added int he Hibernate.cfg.xml the string that you wrote down but
> > sorry
> > what mean "Move the database in  the GUI Project"? Sorry for my
> > ignorance...
> > Thanks so much.
> > Have a good work.
> > Bye
>
> > On Nov 4, 2:07 pm, "Tuna Toksöz" <[EMAIL PROTECTED]> wrote:
> > > Hi
>
> > > For now, move the database in the GUI project and in the
> > hibernate.cfg.xml
>
> > > Server=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|ExampleWPF.mdf;
> > > Database=ExampleWPF;Trusted_Connection=Yes;
>
> > > use this one
>
> > > On Tue, Nov 4, 2008 at 8:40 AM, HelpNH <[EMAIL PROTECTED]> wrote:
>
> > > > Hi Tuna,
> > > > i have got SQLServer but before i got SQLExpress (uninstalled)so i
> > > > have only the instance/name  of SQLExpress .
> > > > DO you think is it a trouble of SQLServer?
> > > > Thanks so much for your care.
> > > > Bye
>
> > > > On Nov 4, 12:05 pm, "Tuna Toksöz" <[EMAIL PROTECTED]> wrote:
> > > > > don't you have a SQLServer installed other than SQLExpress?
> > > > > SqlExpress can be problematic due to various reason.
>
> > > > > On Tue, Nov 4, 2008 at 3:51 AM, HelpNH <[EMAIL PROTECTED]>
> > wrote:
>
> > > > > > HI,
> > > > > > i attack my file on this webpage
>
> > > > > >http://www.badongo.com/fr/file/11950778
>
> > > > > > you can download it so you can understand better.
> > > > > > Have a happy time.
> > > > > > Bye
>
> > > > > > On Nov 4, 8:21 am, HelpNH <[EMAIL PROTECTED]> wrote:
> > > > > > > Hi Tuna,
> > > > > > > i tried to change the string that you advice me but when i wish
> > add a
> > > > > > > contact appear:
>
> > > > > > > ________ADOException was unhandled_________
>
> > > > > > > cannot open the connection
>
> > > > > > > instead with my configuration i could add a contact and Phone
> > number
> > > > > > > but when i clicked
> > > > > > > on the button save appear this error:
>
> > > > > > > _________GenericADOException was unhandled by user
> > > > code_______________
> > > > > > > could not insert: [Domain.Contact][SQL: INSERT INTO ContactTbl
> > (Name)
> > > > > > > VALUES (?); select SCOPE_IDENTITY()]
>
> > > > > > > I will post my project on the web.
> > > > > > > Let me try!!!
> > > > > > > Thanks so much for your take care.
> > > > > > > I wish you happy day
> > > > > > > Bye
>
> > > > > > > On Nov 4, 12:42 am, "Tuna Toksöz" <[EMAIL PROTECTED]> wrote:
>
> > > > > > > > Eventhough ugly, please try
>
> > > > > > > >         <property name="connection.connection_string">
> > > > > > > >             Data Source=.\SQLEXPRESS;Integrated
> > Security=True;User
>
> > Instance=True;AttachDBFilename=C:\Users\Administrator\Desktop\ExampleWPF\ExampleWPF\Database\ExampleWPF.mdf;Persist
> > > > > > > > Security Info=False
> > > > > > > >         </property>
>
> > > > > > > > I mean the absolute path.
>
> > > > > > > > On Mon, Nov 3, 2008 at 7:13 PM, Tuna Toksöz <[EMAIL PROTECTED]
>
> > > > wrote:
> > > > > > > > > I think the problem is with SQL EXpress connection string
>
> > > > > > > > > Driver={SQL Native Client};Server=.\SQLExpress;
> > AttachDbFilename=
>
> > > > |DataDirectory|mydbfile.mdf;Database=dbname;Trusted_Connection=Yes;
>
> > > > > > > > > connectionstrings.com says
>
> > > > > > > > > On Mon, Nov 3, 2008 at 7:00 PM, HelpNH <
> > [EMAIL PROTECTED]>
> > > > > > wrote:
>
> > > > > > > > >> Hi Tuna,
> > > > > > > > >> thanks for your reply so fast,
> > > > > > > > >> i tried to change as you advice me but nothing instead if
> > use
> > > > this
> > > > > > > > >> configuration :
>
> > > > > > > > >> <?xml version="1.0" encoding="utf-8" ?>
> > > > > > > > >> <hibernate-configuration
> > > > > > > > >> xmlns="urn:nhibernate-configuration-2.2">
> > > > > > > > >>        <session-factory>
>
> > > > > > > > >>                <property name="connection.provider">
>
> > > > > >  NHibernate.Connection.DriverConnectionProvider
> > > > > > > > >>                </property>
> > > > > > > > >>                <property name="dialect">
> > > > > > > > >>                        NHibernate.Dialect.MsSql2005Dialect
> > > > > > > > >>                </property>
> > > > > > > > >>                <property name="connection.driver_class">
> > > > > > > > >>                        NHibernate.Driver.SqlClientDriver
> > > > > > > > >>                </property>
>
> > > > > > > > >>                <property
> > name="connection.connection_string">
> > > > > > > > >>                        Data
> > > > Source=ERUSYAKO\SQLEXPRESS;Integrated
> > > > > > > > >> Security=True; initial
> > > > > > > > >> catalog=ExampleWPF
> > > > > > > > >>                 </property>
>
> > > > > > > > >>                <property
> > > > name="use_proxy_validator">false</property>
> > > > > > > > >>        </session-factory>
> > > > > > > > >> </hibernate-configuration>
>
> > > > > > > > >>  i can debug the project but when i wish save a contact
> > appear
> > > > this
> > > > > > > > >> error:
>
> > > > > > > > >> GenericADOException was unhandled by user
> > code_______________
> > > > > > > > >> could not insert: [Domain.Contact][SQL: INSERT INTO
> > ContactTbl
> > > > > > (Name)
> > > > > > > > >> VALUES (?); select SCOPE_IDENTITY()]
>
> > > > > > > > >> so i dont know where i must put my hand:(.
> > > > > > > > >> Thanks again
> > > > > > > > >> I wish you happy time
> > > > > > > > >> Bye
>
> > > > > > > > >> On Nov 3, 11:40 pm, "Tuna Toksöz" <[EMAIL PROTECTED]>
> > wrote:
> > > > > > > > >> > Ah, it is probably easy.
>
> > > > > > > > >> > In hobermate.cfg.xml change the line with following.
>
> > > > > > > > >> >             <property name="connection.connection_string">
> > > > > > > > >> >                 Server=(local);initial
> > > > > > catalog=nhibernate;Integrated
> > > > > > > > >> > Security=SSPI
> > > > > > > > >> >             </property>
>
> > > > > > > > >> > and set the dialect to following
>
> > > > > > > > >> >             <property
>
> > name="dialect">NHibernate.Dialect.MsSql2005Dialect</property>
>
> > > > > > > > >> > in case the driver is different, use
>
> > > > > > > > >> >             <property
>
> > name="connection.driver_class">NHibernate.Driver.SqlClientDriver</property>
>
> > > > > > > > >> > On Mon, Nov 3, 2008 at 6:36 PM, HelpNH <
> > [EMAIL PROTECTED]
>
> > > > > > wrote:
>
> > > > > > > > >> > > Hi,
> > > > > > > > >> > > yes sorry from the project SimpleDemo of Mr.Quicoli,
> > > > > > > > >> > > i rewrite that project (that's to learn and study
> > Nhibernate
> > > > > > With
> > > > > > > > >> > > WPF)  when i set up the file "Hibernate.cfg.xml" ,
> > > > > > > > >> > > "Contact.hbm.xml" and "Phone.hbm.xml" to connect the Sql
> > > > Server
> > > > > > with
> > > > > > > > >> > > the NHibernate i receive an error...
> > > > > > > > >> > > My Purpose is connect that project with Sql Server
> > changing
> > > > the
> > > > > > > > >> > > original project files(it's for Firebird) of mappings
> > with
> > > > the
> > > > > > new
> > > > > > > > >> > > but i receive only errors:
> > > > > > > > >> > > Do you have some idea where i can wrong?
> > > > > > > > >> > > Thanks so much for the reply.
> > > > > > > > >> > > Have a happy time.
> > > > > > > > >> > > BYE
>
> > > > > > > > >> > > On Nov 3, 11:25 pm, "Tuna Toksöz" <[EMAIL PROTECTED]>
> > > > wrote:
> > > > > > > > >> > > > Can you rephrase what you are trying to do, i am lost
> > a
> > > > > > little.
>
> > > > > > > > >> > > > On Mon, Nov 3, 2008 at 5:22 PM, HelpNH <
> > > > [EMAIL PROTECTED]
>
> > > > > > > > >> wrote:
>
> > > > > > > > >> > > > > Hi ,
> > > > > > > > >> > > > > i 'm searching to work out my mistake but nothing ,
> > > > > > > > >> > > > > do you have some eye to correct my view?
> > > > > > > > >> > > > > Thanks so much
> > > > > > > > >> > > > > I wish you happy time.
> > > > > > > > >> > > > > Bye
>
> > > > > > > > >> > > > > On Nov 1, 10:29 am, HelpNH <[EMAIL PROTECTED]>
> > > > wrote:
> > > > > > > > >> > > > > > HI Sean ,
> > > > > > > > >> > > > > > i tried to change in the mapping <generator
> > > > > > class="identity" />
> > > > > > > > >>  but
> > > > > > > > >> > > > > > when i debug the project
> > > > > > > > >> > > > > > and i wish add a new contact appear this the
> > follow:
>
> > > > > > > > >> > > > > > _______ADOException was unhandled_________
> > > > > > > > >> > > > > > could not execute query
> > > > > > > > >> > > > > > [ SELECT this_.Id_Contact as Id1_1_1_, this_.Name
> > as
> > > > > > Name1_1_,
> > > > > > > > >> > > > > > phones2_.Id_Contact as Id4_3_, phones2_.Id_Phone
> > as
> > > > > > Id1_3_,
> > > > > > > > >> > > > > > phones2_.Id_Phone as Id1_0_0_, phones2_.PhoneType
> > as
> > > > > > > > >> PhoneType0_0_,
> > > > > > > > >> > > > > > phones2_.PhoneNumber as PhoneNum3_0_0_ FROM
> > ContactTbl
> > > > > > this_
> > > > > > > > >> left
> > > > > > > > >> > > > > > outer join PhoneTbl phones2_ on
> > > > > > > > >> this_.Id_Contact=phones2_.Id_Contact
> > > > > > > > >> > > > > > WHERE this_.Id_Contact = ? ]
> > > > > > > > >> > > > > > Positional parameters:  #0>0
> > > > > > > > >> > > > > > [SQL: SELECT this_.Id_Contact as Id1_1_1_,
> > this_.Name
> > > > as
> > > > > > > > >> Name1_1_,
> > > > > > > > >> > > > > > phones2_.Id_Contact as Id4_3_, phones2_.Id_Phone
> > as
> > > > > > Id1_3_,
> > > > > > > > >> > > > > > phones2_.Id_Phone as Id1_0_0_, phones2_.PhoneType
> > as
> > > > > > > > >> PhoneType0_0_,
> > > > > > > > >> > > > > > phones2_.PhoneNumber as PhoneNum3_0_0_ FROM
> > ContactTbl
> > > > > > this_
> > > > > > > > >> left
> > > > > > > > >> > > > > > outer join PhoneTbl phones2_ on
> > > > > > > > >> this_.Id_Contact=phones2_.Id_Contact
> > > > > > > > >> > > > > > WHERE this_.Id_Contact = ?]
>
> > > > > > > > >> > > > > > i don't know why ,however i add into the database
> > ID
> > > > as
> > > > > > Identity
> > > > > > > > >> > > > > > Specification = yes after in the subMenu there
>
> ...
>
> read more »
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to