Home » Open Source » Programming Interfaces » Unable to connect to a remote database through ASP. NET ( ASPHostPortal.com) (SQL, 2012, Windows Server)
Unable to connect to a remote database through ASP. NET ( ASPHostPortal.com) [message #638127] Wed, 03 June 2015 03:30 Go to previous message
regina21
Messages: 1
Registered: June 2015
Junior Member
I have a ASP.NET website and an hosting account on asphostportal.com

I created a SQL Server Database with Direct Access and updated the connection string with the one provided by Go Daddy.

There are no errors, but I see no data being stored in the database on a form submit.

Code to insert a row is as follows:

public int run_sql(string msg)
{
    SqlConnection conn = new SqlConnection();
    SqlCommand cmd = new SqlCommand();
    SqlDataAdapter da = new SqlDataAdapter();
    DataSet ds = new DataSet();
    conn.ConnectionString = connString;
    cmd = conn.CreateCommand();
    cmd.CommandText = msg;
    conn.Open();
    cmd.ExecuteNonQuery();
    conn.Close();
    return 1;

}


What could be the issue?
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: ODBC Connection Fails connection to Oracle 10g database
Next Topic: Locked individual records only for individual users on MS ACCESS
Goto Forum:
  


Current Time: Thu Mar 28 07:20:22 CDT 2024