PC Review


Reply
Thread Tools Rate Thread

Data Environment... newbie question...

 
 
José Araujo
Guest
Posts: n/a
 
      14th Oct 2003
Hi,

Data Environment no longer exist in VB.NET, however, I am trying to
accomplish what they provided in VB 6.0.

It was a good way of having all the connection related information
centralized in one point in the program.

I was wondering if somebody could point me to the appropiate documentation,
or give a brief introduction in the subject.

Thanks,
José Araujo.

PS: i posted the question in this forum, if somebody think that there is a
better place to post it just let me know.


 
Reply With Quote
 
 
 
 
Justin Weinberg
Guest
Posts: n/a
 
      14th Oct 2003
Where to put a SQL Server connection string is a little more tricky in .NET.
In a web app, I would recommend placing it in the web.config. In a windows
app, add an application config and putting it there is good.

If you're using an OLEDB source, you still have the data link as an option.
You do not have this option if you are using the SQLClient namespace.

In terms of using the connections, there's so many options now... I
recommend checking out the MSDN data design pattern.

--
Justin Weinberg

Designing a PrintDocument? Drawing to forms?
Check out GDI+ Architect at www.mrgsoft.com


"José Araujo" <(E-Mail Removed)> wrote in message
news:%23O%(E-Mail Removed)...
> Hi,
>
> Data Environment no longer exist in VB.NET, however, I am trying to
> accomplish what they provided in VB 6.0.
>
> It was a good way of having all the connection related information
> centralized in one point in the program.
>
> I was wondering if somebody could point me to the appropiate

documentation,
> or give a brief introduction in the subject.
>
> Thanks,
> José Araujo.
>
> PS: i posted the question in this forum, if somebody think that there is a
> better place to post it just let me know.
>
>



 
Reply With Quote
 
Jay B. Harlow [MVP - Outlook]
Guest
Posts: n/a
 
      14th Oct 2003
José,
You can approximate a Data Environment object in .NET using a Component.

1. Use "Project - Add Component" to add a new component class to your
project.
2. Drag a Connection object onto the design surface of the Component, set
any properties.
3. Drag Command & Data Adapter objects onto the design surface, setting
properties.
4. Switch to code view to add any instance methods to encapsulate the above
objects.

Alternatively you can drag items from the Server Explorer onto the above
design surface. You can actually drag Server Explorer objects onto any
design surface (forms or user controls also).

Hope this helps
Jay

"José Araujo" <(E-Mail Removed)> wrote in message
news:%23O%(E-Mail Removed)...
> Hi,
>
> Data Environment no longer exist in VB.NET, however, I am trying to
> accomplish what they provided in VB 6.0.
>
> It was a good way of having all the connection related information
> centralized in one point in the program.
>
> I was wondering if somebody could point me to the appropiate

documentation,
> or give a brief introduction in the subject.
>
> Thanks,
> José Araujo.
>
> PS: i posted the question in this forum, if somebody think that there is a
> better place to post it just let me know.
>
>



 
Reply With Quote
 
José Araujo
Guest
Posts: n/a
 
      14th Oct 2003
Thanks.

I can do that (i didn't know i could, thanks for the information)... but my
problem now is that when i try to use the property window to connect a
SqlCommand to a SqlConnection that is in another Component, it doesn't
show...

The property window only let me link SqlCommand to SqlConnections that are
created in the same form (even though the SqlConnections in other forms are
public, and i have a module which creates a public instance of my Component
Class).

I can imagine how hard it is for the property window to understand what i am
trying to accomplish. I understand the reason why my objects doesn't show up
there.

My question stills being what the recommended way of doing this is... If i
want to create a project with 20-30 data screen, i don't want to have 20-30
SqlConnections objects in my program, but i don't want to do everything
programmatily, i want to take advantage of the IDE at much as i can.

Also i just noticed that the drag&drop feature that the data environment had
does exist anymore (or at least, i can't find it).

Thanks a lot,
José Araujo.


"Jay B. Harlow [MVP - Outlook]" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> José,
> You can approximate a Data Environment object in .NET using a Component.
>
> 1. Use "Project - Add Component" to add a new component class to your
> project.
> 2. Drag a Connection object onto the design surface of the Component, set
> any properties.
> 3. Drag Command & Data Adapter objects onto the design surface, setting
> properties.
> 4. Switch to code view to add any instance methods to encapsulate the

above
> objects.
>
> Alternatively you can drag items from the Server Explorer onto the above
> design surface. You can actually drag Server Explorer objects onto any
> design surface (forms or user controls also).
>
> Hope this helps
> Jay
>
> "José Araujo" <(E-Mail Removed)> wrote in message
> news:%23O%(E-Mail Removed)...
> > Hi,
> >
> > Data Environment no longer exist in VB.NET, however, I am trying to
> > accomplish what they provided in VB 6.0.
> >
> > It was a good way of having all the connection related information
> > centralized in one point in the program.
> >
> > I was wondering if somebody could point me to the appropiate

> documentation,
> > or give a brief introduction in the subject.
> >
> > Thanks,
> > José Araujo.
> >
> > PS: i posted the question in this forum, if somebody think that there is

a
> > better place to post it just let me know.
> >
> >

>
>



 
Reply With Quote
 
Jay B. Harlow [MVP - Outlook]
Guest
Posts: n/a
 
      14th Oct 2003
José,
I do not include SqlConnections in forms, except for quick & dirty, will
this work type forms. On these quick & dirty forms, they get thrown away
almost immediately.

Think logical n-tier architecture. (where you have data, business &
presentation logical layers). Remember you can have Logical layers within a
single program, a single executable, as opposed to physical n-tier layers
across machines.

Your data access is "isolated" from your presentation.

> My question stills being what the recommended way of doing this is... If i
> want to create a project with 20-30 data screen, i don't want to have

20-30
> SqlConnections objects in my program, but i don't want to do everything
> programmatily, i want to take advantage of the IDE at much as i can.

I would have 1 data component, that has my 1 SqlConnection on it, plus 20-30
data adapters. You can use drag & drop within the IDE to build this one
component. I would manually add methods to update & fill one or more dataset
based on one or more data adapters, depending on the requirements for
handling the data.

You can then drag this one component to each form (which I would not do). Or
you can reference the single instance of this component via code (which I
would do).

If you don't have it, David Sceppa's book "Microsoft ADO.NET - Core
Reference" from MS Press covers ADO.NET in great details, including a
chapter on effective Windows based applications.

Hope this helps
Jay

"José Araujo" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Thanks.
>
> I can do that (i didn't know i could, thanks for the information)... but

my
> problem now is that when i try to use the property window to connect a
> SqlCommand to a SqlConnection that is in another Component, it doesn't
> show...
>
> The property window only let me link SqlCommand to SqlConnections that are
> created in the same form (even though the SqlConnections in other forms

are
> public, and i have a module which creates a public instance of my

Component
> Class).
>
> I can imagine how hard it is for the property window to understand what i

am
> trying to accomplish. I understand the reason why my objects doesn't show

up
> there.
>
> My question stills being what the recommended way of doing this is... If i
> want to create a project with 20-30 data screen, i don't want to have

20-30
> SqlConnections objects in my program, but i don't want to do everything
> programmatily, i want to take advantage of the IDE at much as i can.
>
> Also i just noticed that the drag&drop feature that the data environment

had
> does exist anymore (or at least, i can't find it).
>
> Thanks a lot,
> José Araujo.
>
>
> "Jay B. Harlow [MVP - Outlook]" <(E-Mail Removed)> wrote in

message
> news:(E-Mail Removed)...
> > José,
> > You can approximate a Data Environment object in .NET using a Component.
> >
> > 1. Use "Project - Add Component" to add a new component class to your
> > project.
> > 2. Drag a Connection object onto the design surface of the Component,

set
> > any properties.
> > 3. Drag Command & Data Adapter objects onto the design surface, setting
> > properties.
> > 4. Switch to code view to add any instance methods to encapsulate the

> above
> > objects.
> >
> > Alternatively you can drag items from the Server Explorer onto the above
> > design surface. You can actually drag Server Explorer objects onto any
> > design surface (forms or user controls also).
> >
> > Hope this helps
> > Jay
> >
> > "José Araujo" <(E-Mail Removed)> wrote in message
> > news:%23O%(E-Mail Removed)...
> > > Hi,
> > >
> > > Data Environment no longer exist in VB.NET, however, I am trying to
> > > accomplish what they provided in VB 6.0.
> > >
> > > It was a good way of having all the connection related information
> > > centralized in one point in the program.
> > >
> > > I was wondering if somebody could point me to the appropiate

> > documentation,
> > > or give a brief introduction in the subject.
> > >
> > > Thanks,
> > > José Araujo.
> > >
> > > PS: i posted the question in this forum, if somebody think that there

is
> a
> > > better place to post it just let me know.
> > >
> > >

> >
> >

>
>



 
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
newbie question on environment variables etc. pauldepstein@att.net Windows XP General 3 11th May 2007 07:10 PM
newbie question on data in code Neil Microsoft ASP .NET 2 23rd Feb 2007 10:39 AM
Newbie question on data binding larrywoods@gmail.com Microsoft Dot NET 2 28th Feb 2006 06:26 PM
Newbie question: Can I create environment variables in AD and push them to clients? pshroads@gmail.com Microsoft Windows 2000 Active Directory 3 8th Aug 2005 01:57 PM
newbie vba environment question lester Microsoft Outlook VBA Programming 2 27th Jan 2004 12:34 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:24 AM.