日期:2014-05-17 浏览次数:20450 次
OracleConnection conn = new OracleConnection("DATA SOURCE=192.168.1.213/gridmark;Persist Security Info=True;USER ID=WGYX;PassWord=wgyx");
OracleCommand cmd = new OracleCommand();
cmd.Connection = conn;
String strSql = "select tell,name from user_base where name='" + username + "'";
cmd.CommandText = strSql;
cmd.CommandType = CommandType.Text;
DataSet ds = new DataSet();
try
{
conn.Open();
OracleDataAdapter ad = new OracleDataAdapter();
ad.SelectCommand = cmd;
ad.Fill(ds);
foreach (DataRow dr in ds.Tables[0].Rows)
{
Longitudes[count] = System.Double.Parse(dr["lontitude"].ToString());
longitude += Longitudes[count] + "|";//将读取的经纬度存储为字符串形式
Latitudes[count] = System.Double.Parse(dr["latitude"].ToString());
latitude += Latitudes[count] + "|";//将读取经纬度存储为字符串形式
count = count + 1;
}
}