Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Best Way Help
Message
From
10/07/2006 14:13:01
 
 
To
10/07/2006 13:50:45
General information
Forum:
ASP.NET
Category:
Forms
Title:
Environment versions
Environment:
VB 8.0
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01135032
Message ID:
01135054
Views:
13
This message has been marked as a message which has helped to the initial question of the thread.
Not all books are wrong. I've read "Data Binding with Winforms 2.0: Programming Smart Client Applications". In his very first example, he creates table adapters for 3 tables. And creates a DLL out of it.

He does complain how not enough books do it this way.


>>I'm starting to layout the transition from VFP to a .NET/Winform application. One of the first concerns I for this development is that we write our application and sell it basicly as a verticial market product. When we sell it, we distrubute the software, and each facility is responsible for having a server for SQL. Right now, in our current application, I store that information servername and database name in a MEM file. If that file isn't there the first time the application is run, I pop up a dialog and get the information, make the connection and then save those values. It works great. The question is, where/how do I store that information for the .NET app. I'm sure there are multple ways do this, I'm hoping for the KISS way that will work for all users no matter what their workstation rights are.
>>
>>The second is an understanding question. I've played around with the .NET now for the last year making little forms and learning some of the controls. But here is something that seems great but I don't know how it works when the application is distrubuted. That being, the connection controls to the database. In all the books and examples, you use the server explorer, and drag a table or database to the form, and it creates the connection information. When I distrubute this, or even go into the test environment, that server and connection information used will be totally different than what I develop on. I'm sure I'm missing how this can be more "generic" and useful in a distrubuted setting.
>

>
>Caveat: I don't do NET WinForms (I use VFP for that), but I do .NET WebForms where the connection info is kept in Web.Config (and sometimes a connector in Global.asax.cs).
>
>In your case I think the easiest place to write configuration to a file is in XML format as XML is easy to access (R/W) from .NET
>
>The connection string is kept in a config file (web.config in my case) and retrieved in code as so:
>
>private string sConnString =
>  System.Configuration.ConfigurationManager.ConnectionStrings["MyConnString"].ToString();
>
>Look at ConfigurationManager class in Help.
>
>Hopefully someone will chime in with more appropriate WinForm info.
>
>The books and examples you mention, that "drag a table or database and it creates the connection information" are IMHO wrong. They perpetuate a 2-Tier (or the old monolithic) approach. It is much better to use 3-Tier from the start, by creating a program file (.cs or .vb) that contains the data access layer (DAL) and binding the UI Controls to the data access methods.
>
>My .02

(On an infant's shirt): Already smarter than Bush
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform