Hi, Thank you for your reply. 

<script 
type="text/javascript">google.load('visualization','1.0',{'packages':['corechart','controls']});google.setOnLoadCallback(function(){drawVisualization([{"ColumnName":"ADAGI","Value":59,"Type":"CVR","Date":"\/Date(1358294400000)\/"},{"ColumnName":"AXIUS","Value":32,"Type":"CVR","Date":"\/Date(1358294400000)\/"},{"ColumnName":"BACCH","Value":75,"Type":"CVR","Date":"\/Date(1358294400000)\/"},{"ColumnName":"MSIMC","Value":75,"Type":"CVR","Date":"\/Date(1358294400000)\/"},{"ColumnName":"EGLXY","Value":75,"Type":"CVR","Date":"\/Date(1358294400000)\/"}],'Text
 
Example','Text Example','Name,type,');});</script><script 
type='text/javascript'>new Sys.WebForms.Menu({ element: 'NavigationMenu', 
disappearAfter: 500, orientation: 'horizontal', tabIndex: 0, disabled: 
false });</script>

I have tried adding a 'ParseExtact' but it seems to have no affect on the 
output.  Any help much appreciated. 
Thank you.

On Friday, February 28, 2014 4:17:08 PM UTC, asgallant wrote:
>
> What do those datetime values look like when converted via the Serialize
>  method?
>
> On Friday, February 28, 2014 9:12:17 AM UTC-5, Missy wrote:
>>
>> Hi, 
>>
>> I am currently getting the following error - Type mismatch. Value 
>> /Date(1358294400000)/ does not match type datetime in column index 3.
>>
>> Does this error suggest, i need to convert the datetime type to string or 
>> do i need to add in a conversion code on the server side?
>>
>> This is currently my updated code on server-side:
>>
>>
>> protected void Page_Load(object sender, EventArgs e)
>>     {
>>
>>         JavaScriptSerializer jss = new JavaScriptSerializer();
>>         ClientScript.RegisterStartupScript(this.GetType(), 
>> "TestInitPageScript",
>>         string.Format("<script 
>> type=\"text/javascript\">google.load('visualization','1.0',{{'packages':['corechart','controls']}});google.setOnLoadCallback(function(){{drawVisualization({0},'{1}','{2}','{3}');}});</script>",
>>         jss.Serialize(GetData()),
>>         "Text Example",
>>         "Text Example",
>>          "Name,type,"));
>>
>>     }
>>
>>     [WebMethod]
>>     public static List<test> GetData()
>>     {
>>         SqlConnection conn = new SqlConnection("#############");
>>         DataSet ds = new DataSet();
>>         DataTable dt = new DataTable();
>>         conn.Open();
>>         var yesterday = DateTime.Today.AddDays(-1);
>>         string cmdstr = "select top 500 Name, [Decimal price],Cover, 
>> UploadDate from [dbo].[database]";
>>         SqlCommand cmd = new SqlCommand(cmdstr, conn);
>>         SqlDataAdapter adp = new SqlDataAdapter(cmd);
>>         adp.Fill(ds);
>>         dt = ds.Tables[0];
>>         List<test> dataList = new List<test>();
>>         string cat = "";
>>         float val = 0;
>>         string typ = "";
>>         DateTime dat = DateTime.Now;
>>
>>         //dat.ToString("ddmmYYYY", 
>> System.Globalization.CultureInfo.InvariantCulture);
>>
>>         foreach (DataRow dr in dt.Rows)
>>         {
>>             try
>>             {
>>                 cat = dr[0].ToString();
>>
>>                 val = Convert.ToInt32(dr[1]);
>>
>>                 typ = dr[2].ToString();
>>
>>                 dat = (DateTime)dr[3];
>>
>>             }
>>             catch
>>             {
>>             }
>>             dataList.Add(new test(cat, val, typ, dat));
>>         }
>>         return dataList;
>>     }
>>
>> *Test class:*
>>
>>
>> public string ColumnName = ""; public float Value = 0; public string Type 
>> = ""; public DateTime Date = DateTime.Now; public test(string columnName, 
>> float value, string type, DateTime date) { ColumnName = columnName; Value = 
>> value; Type = type; Date = date; }
>>
>>
>> Any help much appreciated. Many thanks for your time and help.
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to