在生产服务器的网格中加载数据时,我发现页面左下角出现以下脚本错误(此错误仅在生产服务器上发生,在本地服务器中工作正常) 此错误发生不一致
网页错误详情
用户代理:Mozilla/4.0(兼容;MSIE 8.0;Windows NT 5.1;Trident/4.0;BTRS123646;嵌入式 Web 浏览器来自:http ://bsalsa.com/ ;.NET CLR 1.1.4322;.NET CLR 2.0.50727; .NET CLR 3.0.04506.648;.NET CLR 3.5.21022;.NET CLR 3.0.4506.2152;.NET CLR 3.5.30729;.NET4.0C;.NET4.0E) 时间戳:2012 年 10 月 9 日星期二 12:11:23世界标准时间
消息:未终止的字符串常量 行:111115201 字符:187 代码:0
URI:XYXZ/MYApp/MyPage.aspx
以下是网格中绑定数据的代码
try
{
conGetPost.ConnectionString = ConfigurationManager.ConnectionStrings["ConnStr"].ConnectionString;
conGetPost.Open();
SqlCommand cmdGetPost = new SqlCommand();
cmdGetPost.CommandTimeout = 999999999;
cmdGetPost.Connection = conGetPost;
cmdGetPost.CommandType = CommandType.StoredProcedure;
cmdGetPost.CommandText = "MySP";
if (wdpfrom.Value.ToString() == "1/1/0001 12:00:00 AM" || wdpTo.Value.ToString() == "1/1/0001 12:00:00 AM")
{
ShowMessage("Please select proper Date range");
wdgPost.DataSource = "";
wdgPost.DataBind();
return;
}
else
{
cmdGetPost.Parameters.AddWithValue("@dateFrom", wdpfrom.Value);
cmdGetPost.Parameters.AddWithValue("@dateTo", Convert.ToDateTime(wdpTo.Value.ToString()).Add(new TimeSpan(23, 59, 59)));
}
cmdGetPost.Parameters.AddWithValue("@ID", ID);
SqlDataAdapter daGetPost = new SqlDataAdapter();
daGetPost.SelectCommand = cmdGetPost;
daGetPost.Fill(dsGetPost);
if (dsGetPost.Tables.Count > 0)
{
if (dsGetPost.Tables[0].Rows.Count > 750)
{
ShowMessage("Maximum record found please reduce date range");
wdgPost.DataSource = "";
wdgPost.DataBind();
return;
}
}
wdgPost.ClearDataSource();
wdgPost.DataSource = dsGetPost;
wdgPost.DataBind();
if (dsGetPost.Tables[0].Rows.Count == 0)
{
ShowMessage("No records found");
}
Session["dsGetPost"] = dsGetPost;
}
catch( Exception ex)
{
return;
}
finally
{
if (conGetPost != null)
{
conGetPost.Close();
conGetPost = null;
}
}
如何知道我的 C# 代码中的行号?如何解决?请帮忙