im trying to parse the result of arr[0] through a sql command to get the result and then put it in replacment of arr[0] result.
the first result arr[0] gives me is: 34
so i want to get the result 34 parse it through my SQL connection to return the result "Trtanium".
Here is the code im working with;
private void JitaOrePrices() { ListViewItem itm; //listview settings. listView1_Jita.View = View.Details; listView1_Jita.GridLines = true; listView1_Jita.FullRowSelect = true; //convert to string. string string1 = "http://api.eve-central.com/api/marketstat?typeid=34&minQ=1&typeid=35&minQ=1&typeid=36&minQ=1&typeid=37&minQ=1&typeid=38&minQ=1&typeid=39&minQ=1&typeid=40&minQ=1&typeid=11399&minQ=1&usesystem=30000142"; // add colums to put into. listView1_Jita.Columns.Add("Type", 45); listView1_Jita.Columns.Add("(B)", 70); listView1_Jita.Columns.Add("(S)", 70); //set arrays to put into. string[] arr = new string[3]; XmlDocument doco = new XmlDocument(); doco.Load(string1); XmlNodeList Blist = doco.SelectNodes("/evec_api/marketstat/type"); foreach (XmlNode xnod in Blist) { SqlConnection SQLC = new SqlConnection("user id=No_IdeaV2;" + "password = ********;server =******;" + "Trusted_Connection=yes;" + "database = 12345;" + "connection timeout = 30"); SQLC.Open(); SqlCommand SQLLookup = new SqlCommand("SELECT typeName FROM invTypes WHERE typeID = 'THIS IS WHERE I AM STUCK'"); XmlNode znod = xnod.SelectSingleNode("buy"); XmlNode dnod = xnod.SelectSingleNode("sell"); if (xnod.Attributes["id"] != null) { arr[0] = xnod.Attributes["id"].InnerText; arr[1] = znod.SelectSingleNode("max").InnerText; arr[2] = dnod.SelectSingleNode("max").InnerText; } itm = new ListViewItem(arr); itm.Font = new Font("Tahima", 9); listView1_Jita.Items.Add(itm); } }