473,408 Members | 2,832 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

Ado.net and mdi form

JFB
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"
Nov 20 '05 #1
8 994
"JFB" <jf*****@directvinternet.com> 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

Nov 20 '05 #2
JFB
Tks for reply Armin,
How can I pass the the connectionstring?
Sorry but I'm new....
JFB
"Armin Zingler" <az*******@freenet.de> wrote in message
news:#4**************@TK2MSFTNGP11.phx.gbl...
"JFB" <jf*****@directvinternet.com> 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

Nov 20 '05 #3
in addition
if you declare the string in your parent form as public shared you can
access it from the other forms 2
"JFB" <jf*****@directvinternet.com> wrote in message
news:u9**************@TK2MSFTNGP12.phx.gbl...
Tks for reply Armin,
How can I pass the the connectionstring?
Sorry but I'm new....
JFB
"Armin Zingler" <az*******@freenet.de> wrote in message
news:#4**************@TK2MSFTNGP11.phx.gbl...
"JFB" <jf*****@directvinternet.com> 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


Nov 20 '05 #4
"JFB" <jf*****@directvinternet.com> 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
Nov 20 '05 #5
JFB
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éMo**@ThiSomnipack.be> wrote in message
news:3f***********************@reader0.news.skynet .be...
in addition
if you declare the string in your parent form as public shared you can
access it from the other forms 2
"JFB" <jf*****@directvinternet.com> wrote in message
news:u9**************@TK2MSFTNGP12.phx.gbl...
Tks for reply Armin,
How can I pass the the connectionstring?
Sorry but I'm new....
JFB
"Armin Zingler" <az*******@freenet.de> wrote in message
news:#4**************@TK2MSFTNGP11.phx.gbl...
"JFB" <jf*****@directvinternet.com> 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



Nov 20 '05 #6
"JFB" <jf*****@directvinternet.com> 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

Nov 20 '05 #7
i normally put my public vars in a module (dous the share automaticly)

"JFB" <jf*****@directvinternet.com> wrote in message
news:uO**************@TK2MSFTNGP10.phx.gbl...
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éMo**@ThiSomnipack.be> wrote in message
news:3f***********************@reader0.news.skynet .be...
in addition
if you declare the string in your parent form as public shared you can
access it from the other forms 2
"JFB" <jf*****@directvinternet.com> wrote in message
news:u9**************@TK2MSFTNGP12.phx.gbl...
Tks for reply Armin,
How can I pass the the connectionstring?
Sorry but I'm new....
JFB
"Armin Zingler" <az*******@freenet.de> wrote in message
news:#4**************@TK2MSFTNGP11.phx.gbl...
> "JFB" <jf*****@directvinternet.com> 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
>



Nov 20 '05 #8
JFB
Cool.. tks for the info folks
JFB

"JFB" <jf*****@directvinternet.com> wrote in message
news:uO**************@TK2MSFTNGP10.phx.gbl...
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éMo**@ThiSomnipack.be> wrote in message
news:3f***********************@reader0.news.skynet .be...
in addition
if you declare the string in your parent form as public shared you can
access it from the other forms 2
"JFB" <jf*****@directvinternet.com> wrote in message
news:u9**************@TK2MSFTNGP12.phx.gbl...
Tks for reply Armin,
How can I pass the the connectionstring?
Sorry but I'm new....
JFB
"Armin Zingler" <az*******@freenet.de> wrote in message
news:#4**************@TK2MSFTNGP11.phx.gbl...
> "JFB" <jf*****@directvinternet.com> 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
>



Nov 20 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: John | last post by:
Dear all, It been more than 3 days I am trying to debug this program, I interpret it using activePerl and it is giving (perl -wc code_process.pl) no error syntax but when I put it online, change...
5
by: Richard Cornford | last post by:
I am interested in hearing opinions on the semantic meaning of FORM (elements) in HTML. I have to start of apologising because this question arose in a context that is not applicable to the...
4
by: Targa | last post by:
Trying to total some price fields in a form but doesnt work when all the referenced form fields dont exisit. This is for an invoice - pulled prom a database and the form doesnt always contain the...
25
by: Lyn | last post by:
Hi, I am working on a genealogy form. The only table (so far) lists everybody in the family, one record per person. Each record has an autonum ID. The parent form (frmMainForm) displays the...
19
by: Raposa Velha | last post by:
Hello to all! Does any of you want to comment the approach I implement for instantiating a form? A description and an example follow. Cheers, RV jmclopesAThotmail.com replace the AT with the...
11
by: Jozef | last post by:
I have some old code that I use from the Access 95 Developers handbook. The code works very well, with the exception that it doesn't seem to recognize wide screens, and sizes tab controls so that...
5
by: RAJ | last post by:
hi plz tell me how to know "how window is going to close"... i have to right code for X button of forms... plz telll me thanks bye
6
by: Gary Miller | last post by:
Does anyone know how to detect a modeless form on closing by the form that invoked the modeless form? form.Show();
4
by: Alex Sibilev | last post by:
Hello, I have a really weird problem I've been trying to solve it without any luck for the last couple of hours :( I'm writing a "conference board" application (quite similar to ASP.NET...
5
by: ortaias | last post by:
I have a form which calls up a second form for purposes of data entry. When closing the data entry form and returning to the main form, things don't work as expected. When I return to the main...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.