PC Review


Reply
Thread Tools Rate Thread

Ado.net and mdi form

 
 
JFB
Guest
Posts: n/a
 
      10th Dec 2003
Hi,
Can I define just one connection string in the MDI form and use it in all
the forms?
Or Do I need to create a connection for each form?
Tks
JFB
Private connectionString As String = "Data Source=SQLServer;Initial
Catalog=DBName;user=sa;password=pass"


 
Reply With Quote
 
 
 
 
Armin Zingler
Guest
Posts: n/a
 
      10th Dec 2003
"JFB" <(E-Mail Removed)> schrieb
> Hi,
> Can I define just one connection string in the MDI form and use it in
> all the forms?
> Or Do I need to create a connection for each form?
> Tks
> JFB
> Private connectionString As String = "Data
> Source=SQLServer;Initial Catalog=DBName;user=sa;password=pass"


You can pass the connection or only the connectionstring.


--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

 
Reply With Quote
 
JFB
Guest
Posts: n/a
 
      10th Dec 2003
Tks for reply Armin,
How can I pass the the connectionstring?
Sorry but I'm new....
JFB


"Armin Zingler" <(E-Mail Removed)> wrote in message
news:#(E-Mail Removed)...
> "JFB" <(E-Mail Removed)> schrieb
> > Hi,
> > Can I define just one connection string in the MDI form and use it in
> > all the forms?
> > Or Do I need to create a connection for each form?
> > Tks
> > JFB
> > Private connectionString As String = "Data
> > Source=SQLServer;Initial Catalog=DBName;user=sa;password=pass"

>
> You can pass the connection or only the connectionstring.
>
>
> --
> Armin
>
> http://www.plig.net/nnq/nquote.html
> http://www.netmeister.org/news/learn2quote.html
>



 
Reply With Quote
 
EricJ
Guest
Posts: n/a
 
      10th Dec 2003
in addition
if you declare the string in your parent form as public shared you can
access it from the other forms 2


"JFB" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Tks for reply Armin,
> How can I pass the the connectionstring?
> Sorry but I'm new....
> JFB
>
>
> "Armin Zingler" <(E-Mail Removed)> wrote in message
> news:#(E-Mail Removed)...
> > "JFB" <(E-Mail Removed)> schrieb
> > > Hi,
> > > Can I define just one connection string in the MDI form and use it in
> > > all the forms?
> > > Or Do I need to create a connection for each form?
> > > Tks
> > > JFB
> > > Private connectionString As String = "Data
> > > Source=SQLServer;Initial Catalog=DBName;user=sa;password=pass"

> >
> > You can pass the connection or only the connectionstring.
> >
> >
> > --
> > Armin
> >
> > http://www.plig.net/nnq/nquote.html
> > http://www.netmeister.org/news/learn2quote.html
> >

>
>



 
Reply With Quote
 
Armin Zingler
Guest
Posts: n/a
 
      10th Dec 2003
"JFB" <(E-Mail Removed)> schrieb
> Tks for reply Armin,
> How can I pass the the connectionstring?
> Sorry but I'm new....
> JFB


You can write a procedure. A procedure can have arguments. An argument is
something you pass to the procedure. In this case it is the connection
string.

http://msdn.microsoft.com/library/en...nArguments.asp

Alternatively, you can add a property to the object that needs the string.
By setting the property the object also gets the string.

http://msdn.microsoft.com/library/en...Properties.asp

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

--
Armin


 
Reply With Quote
 
JFB
Guest
Posts: n/a
 
      10th Dec 2003
Tks for reply Eric,
I just declare my connection like below but looks like is not declare in my
child form. Do I need to do something special in my child form?
JFB
Public Shared connectionString As String = "DataSource=SQLServer;Initial
Catalog=DBName;user=sa;password=pass"



"EricJ" <ericRé(E-Mail Removed)> wrote in message
news:3fd6d245$0$27220$(E-Mail Removed)...
> in addition
> if you declare the string in your parent form as public shared you can
> access it from the other forms 2
>
>
> "JFB" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > Tks for reply Armin,
> > How can I pass the the connectionstring?
> > Sorry but I'm new....
> > JFB
> >
> >
> > "Armin Zingler" <(E-Mail Removed)> wrote in message
> > news:#(E-Mail Removed)...
> > > "JFB" <(E-Mail Removed)> schrieb
> > > > Hi,
> > > > Can I define just one connection string in the MDI form and use it

in
> > > > all the forms?
> > > > Or Do I need to create a connection for each form?
> > > > Tks
> > > > JFB
> > > > Private connectionString As String = "Data
> > > > Source=SQLServer;Initial Catalog=DBName;user=sa;password=pass"
> > >
> > > You can pass the connection or only the connectionstring.
> > >
> > >
> > > --
> > > Armin
> > >
> > > http://www.plig.net/nnq/nquote.html
> > > http://www.netmeister.org/news/learn2quote.html
> > >

> >
> >

>
>



 
Reply With Quote
 
Armin Zingler
Guest
Posts: n/a
 
      10th Dec 2003
"JFB" <(E-Mail Removed)> schrieb
> Tks for reply Eric,
> I just declare my connection like below but looks like is not declare
> in my child form. Do I need to do something special in my child
> form? JFB
> Public Shared connectionString As String =
> "DataSource=SQLServer;Initial
> Catalog=DBName;user=sa;password=pass"



http://msdn.microsoft.com/library/en...redMembers.asp


--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

 
Reply With Quote
 
EricJ
Guest
Posts: n/a
 
      10th Dec 2003
i normally put my public vars in a module (dous the share automaticly)

"JFB" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Tks for reply Eric,
> I just declare my connection like below but looks like is not declare in

my
> child form. Do I need to do something special in my child form?
> JFB
> Public Shared connectionString As String = "DataSource=SQLServer;Initial
> Catalog=DBName;user=sa;password=pass"
>
>
>
> "EricJ" <ericRé(E-Mail Removed)> wrote in message
> news:3fd6d245$0$27220$(E-Mail Removed)...
> > in addition
> > if you declare the string in your parent form as public shared you can
> > access it from the other forms 2
> >
> >
> > "JFB" <(E-Mail Removed)> wrote in message
> > news:(E-Mail Removed)...
> > > Tks for reply Armin,
> > > How can I pass the the connectionstring?
> > > Sorry but I'm new....
> > > JFB
> > >
> > >
> > > "Armin Zingler" <(E-Mail Removed)> wrote in message
> > > news:#(E-Mail Removed)...
> > > > "JFB" <(E-Mail Removed)> schrieb
> > > > > Hi,
> > > > > Can I define just one connection string in the MDI form and use it

> in
> > > > > all the forms?
> > > > > Or Do I need to create a connection for each form?
> > > > > Tks
> > > > > JFB
> > > > > Private connectionString As String = "Data
> > > > > Source=SQLServer;Initial Catalog=DBName;user=sa;password=pass"
> > > >
> > > > You can pass the connection or only the connectionstring.
> > > >
> > > >
> > > > --
> > > > Armin
> > > >
> > > > http://www.plig.net/nnq/nquote.html
> > > > http://www.netmeister.org/news/learn2quote.html
> > > >
> > >
> > >

> >
> >

>
>



 
Reply With Quote
 
JFB
Guest
Posts: n/a
 
      10th Dec 2003
Cool.. tks for the info folks
JFB

"JFB" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Tks for reply Eric,
> I just declare my connection like below but looks like is not declare in

my
> child form. Do I need to do something special in my child form?
> JFB
> Public Shared connectionString As String = "DataSource=SQLServer;Initial
> Catalog=DBName;user=sa;password=pass"
>
>
>
> "EricJ" <ericRé(E-Mail Removed)> wrote in message
> news:3fd6d245$0$27220$(E-Mail Removed)...
> > in addition
> > if you declare the string in your parent form as public shared you can
> > access it from the other forms 2
> >
> >
> > "JFB" <(E-Mail Removed)> wrote in message
> > news:(E-Mail Removed)...
> > > Tks for reply Armin,
> > > How can I pass the the connectionstring?
> > > Sorry but I'm new....
> > > JFB
> > >
> > >
> > > "Armin Zingler" <(E-Mail Removed)> wrote in message
> > > news:#(E-Mail Removed)...
> > > > "JFB" <(E-Mail Removed)> schrieb
> > > > > Hi,
> > > > > Can I define just one connection string in the MDI form and use it

> in
> > > > > all the forms?
> > > > > Or Do I need to create a connection for each form?
> > > > > Tks
> > > > > JFB
> > > > > Private connectionString As String = "Data
> > > > > Source=SQLServer;Initial Catalog=DBName;user=sa;password=pass"
> > > >
> > > > You can pass the connection or only the connectionstring.
> > > >
> > > >
> > > > --
> > > > Armin
> > > >
> > > > http://www.plig.net/nnq/nquote.html
> > > > http://www.netmeister.org/news/learn2quote.html
> > > >
> > >
> > >

> >
> >

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
If I use a filter on my form, will the recordsetclone reflect the filtered form or the unfiltered form? Chris K Microsoft Access Form Coding 2 19th Aug 2010 11:24 AM
Re: Temporary Form with 2 Sub form Update Main Form And its Sub form ? Jeanette Cunningham Microsoft Access Form Coding 0 25th Nov 2009 02:27 AM
Com Add-in for Publishing a customized form in a public folder and setting this form as deafult form for the calendar Vidya Microsoft Outlook Program Addins 0 17th Sep 2007 09:47 AM
OnClick Event in Form STOPS WORKING when Form is Made a Sub-Form kev100 via AccessMonster.com Microsoft Access Form Coding 10 24th Jul 2006 08:53 PM
Tabbed Form (Main Form/Sub Form) multi-Table Problem =?Utf-8?B?Um9iZXJ0IE51c3ogQCBEUFM=?= Microsoft Access Forms 0 16th Sep 2005 04:42 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:30 AM.