Sunday, 24 January 2016

XML : ASP.NET use data retrieved from SQL in API weblink/Weblink

im trying to use data im storing in my SQL DB and put it into a API Weblink;

the link im trying to get data from is:

  https://api.eveonline.com/account/Characters.xml.aspx?keyID=[SQLDATA]&&vCODE=[OTHERSQLDATA]    

so just to be clear at the end of this i want it to look like this:

      https://api.eveonline.com/account/Characters.xml.aspx?keyID=[123]&&vCODE=[1234]    

here is some code;

              SqlConnection conn = null;            try          {              string sql = "SELECT ApiKey, VeriF FROM dbo.Users WHERE UserName = @username";                conn = new SqlConnection(ConfigurationManager.ConnectionStrings["READER"].ConnectionString);                SqlCommand cmd = new SqlCommand(sql, conn);                SqlParameter UserN = new SqlParameter();              UserN.ParameterName = "@username";              UserN.Value = User.Identity.Name;              cmd.Parameters.Add(UserN);                conn.Open();              cmd.ExecuteNonQuery();          }          finally          {              if (conn.State == System.Data.ConnectionState.Open)                  conn.Close();          }      }    

No comments:

Post a Comment