473,320 Members | 1,814 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

How to deploy asp.net application in asphostportal.com server

I have created a subdomain in which my asp.net appln files are stored in asphostportal.com.

I have created a c# file to create namespacing for refering connection and dataset.

includes.cs (for creatomg namespace Logic)

Expand|Select|Wrap|Line Numbers
  1. using System;
  2. using System.Data;
  3. using System.Configuration;
  4. using System.Web;
  5. using System.Web.Security;
  6. using System.Web.UI;
  7. using System.Web.UI.WebControls;
  8. using System.Web.UI.WebControls.WebParts;
  9. using System.Web.UI.HtmlControls;
  10. using System.Data.SqlClient;
  11. namespace Logic
  12. {
  13.  
  14.  public class Includes
  15.  {
  16.         public void executeQuery(string strsql)
  17.         {
  18.             string conn = ConfigurationManager.ConnectionStrings["conn"].ConnectionString;
  19.  
  20.             SqlConnection con = new SqlConnection(conn);
  21.             SqlCommand cmd = new SqlCommand(strsql, con);
  22.  
  23.             try
  24.             {
  25.                 con.Open();
  26.                 cmd.ExecuteNonQuery();
  27.  
  28.             }
  29.             catch (Exception ex)
  30.             {
  31.                 throw ex;
  32.             }
  33.             finally
  34.             {
  35.                 con.Close();
  36.                 con.Dispose();
  37.                 cmd.Dispose();
  38.             }
  39.  
  40.         }
  41.  
  42.         public DataSet getDataSet(string strsql)
  43.         {
  44.  
  45.             string conn = ConfigurationManager.ConnectionStrings["conn"].ConnectionString;
  46.             SqlConnection con = new SqlConnection(conn);
  47.             SqlCommand cmd = new SqlCommand(strsql, con);
  48.             try
  49.             {
  50.                 con.Open();
  51.                 SqlDataAdapter ad = new SqlDataAdapter(cmd);
  52.                 DataSet ds = new DataSet();
  53.                 ad.Fill(ds);
  54.                 return ds;
  55.  
  56.             }
  57.             catch (Exception ex)
  58.             {
  59.                 throw ex;
  60.             }
  61.             finally
  62.             {
  63.                 con.Close();
  64.                 con.Dispose();
  65.                 cmd.Dispose();
  66.             }
  67.         }
  68.     }
  69.  
  70.  
  71. }
I am refering this namespacein my code

Expand|Select|Wrap|Line Numbers
  1. using System;
  2. using System.Data;
  3. using System.Configuration;
  4. using System.Collections;
  5. using System.Web;
  6. using System.Web.Security;
  7. using System.Web.UI;
  8. using System.Web.UI.WebControls;
  9. using System.Web.UI.WebControls.WebParts;
  10. using System.Web.UI.HtmlControls;
  11. using Logic;
  12. using System.Data.SqlClient;
  13.  
  14.  
  15. public partial class test : System.Web.UI.Page
  16. {
  17.     protected void Page_Load(object sender, EventArgs e)
  18.     {
  19.  
  20.     }
  21.     protected void Button1_Click(object sender, EventArgs e)
  22.     {
  23.         Includes obj = new Includes();
  24.         string uname = uid.Text.Trim();
  25.         string pass = pwd.Text.Trim();
  26.         string sql = "select user_id,user_pass,user_status from user_master where user_id='" + uname + "' and user_pass='" + pass + "'";
  27.         DataSet ds = obj.getDataSet(sql);
  28.         int ctr=ds.Tables[0].Rows.Count;
  29.  
  30.         if (ctr > 0)
  31.         {
  32.             string stat = ds.Tables[0].Rows[0]["user_status"].ToString();
  33.             if ( ds.Tables[0].Rows[0]["user_status"].ToString()== "Y")
  34.             {
  35.                 Response.Redirect("main.aspx");
  36.  
  37.             }
  38.             else
  39.             {
  40.                 Response.Redirect("index.aspx");
  41.  
  42.             }
  43.  
  44.  
  45.         }
  46.         else
  47.         {
  48.             Response.Redirect("index.aspx");
  49.  
  50.         }
  51.  
  52.  
  53.  
  54.     }
  55. }
at last my web.config

Expand|Select|Wrap|Line Numbers
  1. <connectionStrings>
  2. <add name="conn" connectionString=" Server=xxx.db.xxxx.hostedresource.com; Database=xxx; User ID=xxx; Password=xxx; Trusted_Connection=False" providerName="System.Data.SqlClient" /> <remove name="LocalSqlServer"/> <add name="LocalSqlServer" connectionString=" Server=xxx.db.xxxx.hostedresource.com; Database=xxx; User ID=xxx; Password=xxx; Trusted_Connection=False" providerName="System.Data.SqlClient" />
  3. </connectionStrings>
  4. <configuration>
  5. <system.webServer>
  6. <httpErrors errorMode="Detailed" />
  7. <asp scriptErrorSentToBrowser="true"/>
  8. </system.webServer>
  9. <system.web>
  10. <customErrors mode="Off"/>
  11. <compilation debug="true"/>
  12. </system.web>
  13. </configuration>
<div> </div> <div> </div> <div> </div> <div> </div> <div> </div> <div>

Please I need help
Jun 23 '15 #1
0 1215

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

Similar topics

3
by: ^CeFoS^ | last post by:
Hi to everybody, due to I want to use the serial port of a server machine through an applet allocated in html document. > Then one application will run in the server machine and using > the serial...
1
by: Xavier MT | last post by:
Hi, is there something built in to deploy an asp net app to deploy easily to a server I usually compile locally and copy the bin and aspx pages using the windows explorer Is there another way?
5
by: Jim Heavey | last post by:
Hello, I am trying to figure out how to put my application onto the server. I am deploying to a Windows 2000 Server When I bring up Internet Services Manager and navigate to the Default Web...
3
by: BillGatesFan | last post by:
If your web server host multiple sites, is your only deployment choice is XCOPY? Or can you create a web setup to deploy your web app? Every time I use a web setup in installs to the same virtual...
1
by: Jeffrey Jones | last post by:
Hello all, I hope I am posting to the right forum. I have made my very first ASP.NET web app and am trying to deploy my baby to a remote server. All I know about my remote server is that it has...
0
by: simonZ | last post by:
I would like to deploy my asp.net application. First step is to change Active Solution Configuration from Debug to Release. But in the drop-down list in Visual Studio menu I have only debug...
1
by: Doug Bell | last post by:
Hi, I would like to deploy my application adding an option to the Windows File Explorer Right Click Menu similar to the way Win Zip adds an option to open Win Zip with the selected file/s. ...
0
by: David | last post by:
Hi, I am sorry for the long title and I hope you can help me with the small problem I have. I am working on Project and we are very close to deployment phase, Here is the fact I have. 1- The...
1
by: Chetana | last post by:
Hi, I want to run my asp.net application from server.I have uploaded my asp.net files on the server and I want to run it ditectly from server but I am getting authentication error as 'An...
4
by: agarwalsunitadhn | last post by:
Hello.. I had deployed my project and created a setup file. when i install this one to my system. All the pages works but when i have insert query then it shows an error. is it only a backup file...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.