By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,181 Members | 1,147 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,181 IT Pros & Developers. It's quick & easy.

How to Run C#.NET Windows App on N/W with centralized DB using SQL SERVER 2000

P: 3
How to Run C#.NET Windows App on N/W with centralized DB using SQL SERVER 2000

Hello All...i m really grate full to c such a website where developers try to help people like us who face problems in s/w develepment...I am shobhit Gupta...23 years of age prusuing B.Tech in I.T. Engg. Final Year from Kurukshetra University, Kurukshetra. Recently, i have been working on a project which is to be implemented in a hospital for real life use...Its a s/w for hospital management which, basically, will be used for record keeping and reports generating... Records will containg info about patients and various tests conducted on them... i have made this s/w in C#.NET and tht a windows application..not a web application.....its almost complete....bt the final stage is the major problem for me...i dnt know how to run this project on network.....here is wat the customer i.e. hospital owner wants :-
A CENTRALIZED DATABASE....i.e. the .exe file of the s/w will be copied on clients and server but the Database will be present only in the main server and the clients must retrieve and save data directly fron and in the server.....i.e. transanctions shuld b made b/w client-server...but i wil b using the same application on client as well as on server...no seperate applications...
i am a new developer and its my first project so, i will request you to please help me in details bcause i may not be having adequate knowledge...please help me...please...

i tried to run in a simpler way...i shared the directory of the server in which .exe file is present...then i accessed that folder on client and created a shortcut of the .exe file so that being accessed from client,...the main works shul be done on server...but, its got failed.....it is not able to acces the data from the database.....here is the lisst of errors that i got.....ERROR LIST BEGINS


Expand|Select|Wrap|Line Numbers
  1. See the end of this message for details on invoking 
  2. just-in-time (JIT) debugging instead of this dialog box.
  3.  
  4. ************** Exception Text **************
  5. System.Security.SecurityException: Request for the permission of type 'System.Data.SqlClient.SqlClientPermission, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
  6.    at System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet)
  7.    at System.Security.PermissionSet.Demand()
  8.    at System.Data.Common.DbConnectionOptions.DemandPermission()
  9.    at System.Data.SqlClient.SqlConnection.PermissionDemand()
  10.    at System.Data.SqlClient.SqlConnectionFactory.PermissionDemand(DbConnection outerConnection)
  11.    at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
  12.    at System.Data.SqlClient.SqlConnection.Open()
  13.    at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
  14.    at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
  15.    at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable)
  16.    at Hospital_Management.opddisplay.button1_Click(Object sender, EventArgs e)
  17.    at System.Windows.Forms.Control.OnClick(EventArgs e)
  18.    at System.Windows.Forms.Button.OnClick(EventArgs e)
  19.    at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
  20.    at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
  21.    at System.Windows.Forms.Control.WndProc(Message& m)
  22.    at System.Windows.Forms.ButtonBase.WndProc(Message& m)
  23.    at System.Windows.Forms.Button.WndProc(Message& m)
  24.    at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
  25.    at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
  26.    at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
  27. The action that failed was:
  28. Demand
  29. The type of the first permission that failed was:
  30. System.Data.SqlClient.SqlClientPermission
  31. The Zone of the assembly that failed was:
  32. Internet
  33.  
  34.  
  35. ************** Loaded Assemblies **************
  36. mscorlib
  37.     Assembly Version: 2.0.0.0
  38.     Win32 Version: 2.0.50727.42 (RTM.050727-4200)
  39.     CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
  40. ----------------------------------------
  41. Hospital Management
  42.     Assembly Version: 1.0.3239.24658
  43.     Win32 Version: 1.0.3239.24658
  44.     CodeBase: file://192.168.0.1/New%20Folder/Hospital%20Management.exe
  45. ----------------------------------------
  46. System.Windows.Forms
  47.     Assembly Version: 2.0.0.0
  48.     Win32 Version: 2.0.50727.42 (RTM.050727-4200)
  49.     CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
  50. ----------------------------------------
  51. System
  52.     Assembly Version: 2.0.0.0
  53.     Win32 Version: 2.0.50727.42 (RTM.050727-4200)
  54.     CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
  55. ----------------------------------------
  56. System.Drawing
  57.     Assembly Version: 2.0.0.0
  58.     Win32 Version: 2.0.50727.42 (RTM.050727-4200)
  59.     CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
  60. ----------------------------------------
  61. System.Data
  62.     Assembly Version: 2.0.0.0
  63.     Win32 Version: 2.0.50727.42 (RTM.050727-4200)
  64.     CodeBase: file:///C:/WINDOWS/assembly/GAC_32/System.Data/2.0.0.0__b77a5c561934e089/System.Data.dll
  65. ----------------------------------------
  66. System.Xml
  67.     Assembly Version: 2.0.0.0
  68.     Win32 Version: 2.0.50727.42 (RTM.050727-4200)
  69.     CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
  70. ----------------------------------------
  71. System.Configuration
  72.     Assembly Version: 2.0.0.0
  73.     Win32 Version: 2.0.50727.42 (RTM.050727-4200)
  74.     CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
  75. ----------------------------------------
  76.  
  77. ************** JIT Debugging **************
  78. To enable just-in-time (JIT) debugging, the .config file for this
  79. application or computer (machine.config) must have the
  80. jitDebugging value set in the system.windows.forms section.
  81. The application must also be compiled with debugging
  82. enabled.
  83.  
  84. For example:
  85.  
  86. <configuration>
  87.     <system.windows.forms jitDebugging="true" />
  88. </configuration>
  89.  
  90. When JIT debugging is enabled, any unhandled exception
  91. will be sent to the JIT debugger registered on the computer
  92. rather than be handled by this dialog box.
i created the connection by makin g a class in whic this coding was written in a constructor :::

com.ConnectionString = "user id = sa; password = sa; database = hosital_manag";

Please show me a way to run ma project on netwrok
Nov 13 '08 #1
Share this Question
Share on Google+
3 Replies


Plater
Expert 5K+
P: 7,872
There are a couple of ways you can try and do this.
There are settings, for managed/.NET code located on EACH computer, that you can walk around and edit to allow your program.

The BETTER way, would be to look at the properties of your project and go to the Security tab and then the Publish tab.
With ClickOnce security and publishing, you can declare that your program requires "full trust" and then "publish" your program to the share directory, where other users can then run it.
Nov 13 '08 #2

P: 3
Thanx a lot sir for such a quick reply and i hope you will help me more....sir, please tell me where the Project Properties option relies??acuallu, i have very basic knowledge of .net bcoz my teacher taught me limited bcoz of his limited knowledge...........
is there any simpler way to solve m problem???if yes then please....guide me in a detailed manner where please meantion all the options which i have to follow in sequence .. i will b very thankful to u...i dnt want to get failed int he very 1st project of ma career...and tht's going to b used in real life so, please help me out...
Nov 14 '08 #3

Plater
Expert 5K+
P: 7,872
In visual studio you have the solution explorer (where it shows the files in your project(s)/solution)
Right click on the top of your project tree and choose properties.
Along the side will be tabs for SECURITY and PUBLISH
You will find the clickonce security stuff there.
Nov 14 '08 #4

Post your reply

Sign in to post your reply or Sign up for a free account.