Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / August 2006

Tip: Looking for answers? Try searching our database.

Creating a Windows App version of a Web App

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
jonefer - 15 Aug 2006 08:24 GMT
I have a fully functional web app that I created in Visual Studio 2003.
I've even managed to translate it to a functional working 2005 version.  

What are the best steps to creating a Windows based form version in a manner
that I can preserve a lot of the routines that I have written?

For example, I have a connection string in a WebConfig file that I refer to
in my Data Access Layer. I didn't use the graphical objects to do this, I
wrote most of the code and I would like to use this setup to take a lot of
business logic along for the ride:

For example, this routine fils a DataGrid on a Patient Screen with Lab results

Public Shared Function GetLabs (ByVal lMRN as integer) as dataset

Dim conMembers as SqlConnection = GetMembershipConnection()
Dim strLabsSQL as string

strLabSQL = "SELECT Proc_Name as [Lab Procedure], Comp_Name " _
& "as Component,  Result " _
& "FROM tbl_Lab " _
& "WHERE MRN = @MRN " _
& "ORDER BY Result_Date desc"

Dim cmdGetLab as new sqlCommand(strLabSQL, conMembers)
cmdGetLab.CommandType = CommandType.text

Dim daLab as New SqlDataAdapter
daLab.SelectCommand = cmdGetLab
Return dsLab
End Function

'=============================

I know there are new graphical ways to do this, but to save time, I would
like to use the types of tools I have already created,   and not spend time
trying to learn about a more simple redesign using the new graphical tools.
Unless their is a simple way of illustrating how I could change the above
sample.  The majority of my tools are setup this way.  We are trying to
quickly migrate into a stand-alone desktop version which connects to a
subscribed replicated SQL Express version.

A replacement for my connection reference in WebConfig setup using the
AppConfig tool would be very valuable.   Thanks!
Bob Powell [MVP] - 15 Aug 2006 08:49 GMT
If you've been sensible about decoupling the data access layer from the
graphics you should be ok. There's not much yo can do to directly translate
the web app into a Windows Forms application but reuse of the DAL is
defeinitely possible.

Signature

Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.

>I have a fully functional web app that I created in Visual Studio 2003.
> I've even managed to translate it to a functional working 2005 version.
[quoted text clipped - 45 lines]
> A replacement for my connection reference in WebConfig setup using the
> AppConfig tool would be very valuable.   Thanks!

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.