Click here to Skip to main content
15,885,985 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi!

I would like to ask how to deploy console applications made in Visual Studio C#. (by the way, I made a server-client program using sockets.) Currently, I have a publish settings file for Microsoft Azure and I plan on putting my socket program in Microsoft Azure so that I could upload any "trend "data I put in my program.

Do I have to convert it into an ASP.NET file? If yes, can you guide me? I'm quite new to this programming language. Thank you!
Posted
Comments
Sinisa Hajnal 24-Oct-14 2:38am    
You cannot "convert" it. There is no direct change from one to the other. You can write asp.net application that shows the content of your file (formatted as you will).

Sorry, I never worked with Azure so in that regard I cannot help.
Matthew Chua 24-Oct-14 3:28am    
Hi! Can you guide me on how to write programs in asp.net, given the instance that I have a code that is a server-client program? Thank you.
Sinisa Hajnal 24-Oct-14 3:35am    
Forget your existing code. That may serve as data provider to your clients, but then everyone needs to have your client installed.
Matthew Chua 24-Oct-14 3:50am    
Okay, thank you :) I'll try checking out .NET web forms application :)

1 solution

1. Open your Visual studio
2. Click New project, select asp.net web forms or MVC project - for beginner, I'd suggest web forms
3. In web config, define your database access connection string[^] if you have it or data file if you go that route -
4. Add GridView, DataList, DataRepeater or other table like control - I'd suggest GridView due to simple use <asp:GridView id="myData" runat="server" AutoGenerateColumns = "true"/>
5. In code behind, access the database[^]</pre>


I hope this helps. You could also go to Fiverr or freelancer site oDesk, eLance or Guru for example and pay some little money for that.


C#
protected void Page_Load(object sender, EventArgs e){
    // do some code that runs always

    if (!IsPostback) {
        // do code that runs on initial page load
    }

    // do some more processing that runs always

    if (IsPostback) {
        // do some code that runs ONLY on reload
    }
}
 
Share this answer
 
v2
Comments
Matthew Chua 24-Oct-14 3:53am    
Hi. Thank you for the solution you posted. Although I wanted to clarify what you meant in number 5? Thank you.
Sinisa Hajnal 24-Oct-14 4:24am    
asp.net has two parts, your html page (aspx) and your code page (.cs or .vb). Code behind is server side code where you put your functionality (in this case database access as per the link provided)
Matthew Chua 24-Oct-14 4:55am    
Oh, thank you for clarifying. I was confused actually when I made a Web forms application because only the .aspx file was shown in VS. Thank you so much.

I also wanted to ask how can I access the code behind in VS? Sorry.
Sinisa Hajnal 24-Oct-14 5:13am    
Right click the page is your solution explorer and click View Code or simply expand the file (there is small + sign on the left. You should see three files, aspx, (cs|vb) and designer (this one holds definitions of server controls and you shouldn't change it)
Matthew Chua 24-Oct-14 6:40am    
Okay, I saw it. Thank you very much.

One last thing, I'll put everything in the PageLoad() of the cs/vb file right? (codes in accessing the database). And can I access a RTF file here? Thank you.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900