I am retrieving data from an MSSQL server using SqlDataAdapter and DataSet. From this DataSet, I create a DataTable. My goal is to convert each column of the table to a row where the elements are separated by a comma. I decided that I would try to convert the string first before getting the delimiter to work.
The code runs in code for the ASP.Net page. The ultimate goal is to pass the string to the jscript variable, this is a “functional requirement” that I create a column delimited row from the columns and that it should end as a jscript variable.
Here is what I still have:
DataSet myDataSet = new DataSet();
mySqlDataAdapter.Fill(myDataSet);
DataTable temperature = myDataSet.Tables["Table"];
foreach (DataRow row in temperature.Rows)
{
foreach (DataColumn col in temperature.Columns)
{
Response.Write(row[col] + " ### ");
}
Response.Write("<br>");
}
foreach (DataColumn column in temperature.Columns)
{
Response.Write(column.ToString() + "<br>");
}
In LOOP1, everything works fine. My data has 4 columns, all of them are respectively displayed with one record per line on the web page.
LOOP2 http://msdn.microsoft.com/en-us/library/system.data.datacolumn.tostring.aspx, , , , , , , .
, LOOP2, 4 -. , . , , , DataColumn .toString. , . .
EDIT:
SQL-, :
@ImageShack
, , : "-6.7, -7, -7.2, -7.3, -7.3".