using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.SqlClient;
/// <summary>
/// Summary description for Currancyrate
/// </summary>
public class Currancyrate
{
string connStr = ConfigurationManager.ConnectionStrings["shivcn"].ConnectionString;
public String[] GetCurrancyrate(string exchangerate)
{
string rate="0";
string symble="0";
SqlConnection connection = new SqlConnection(this.connStr);
connection.Open();
SqlCommand command = new SqlCommand("select * from shiv.exchange_rate where country ='" + exchangerate + "'", connection);
SqlDataReader reader = command.ExecuteReader();
if (reader.Read())
{
rate = reader["rate"].ToString();
symble = reader["symbol"].ToString();
}
connection.Close();
connection.Dispose();
reader.Close();
reader.Dispose();
command.Dispose();
return new String[] { rate, symble };
}
} |