平时Error记录

The Windows Firewall on this machine is currently



1.This row already belongs to another table.

DataTable tdLangauge = ShowLangauege.Clone();
                foreach (DataRow row in drlanauage)
                {
                    tdLangauge.Rows.Add(row.ItemArray);  
                }
                oLanguage.Tables.Add(tdLangauge);



2. asp.net如何实现关闭子页面的时候刷新父页面的gridview控件

在子页面中写onunload事件;例如<body onunload="close()"></body>

 

<script type="text-javascript">

      function close(){

          window.parent.location.reload();

      }

</script>
3 .gridview没数据的时候仍是显示标题
直接绑定后台传过来的数据,不要判断为否为空在绑定,这样数据为空的就不能绑定显示标题了

4.隐藏gridview中的Button
  if (EnLabel.Text == "")
 {
     e.Row.FindControl("btnImage").Visible = false;
  }


5.gridview合并某些列不一样行的相同值
      在gridview_RowDataBound
                    bool isLastRow = false;
                         int iMergeBegin, iMergeEnd;
                         iMergeBegin = 1;
                         iMergeEnd = 3;


                         if (gvLanguageMain.AllowPaging && (oRow.RowIndex == oSource.Count

% gvLanguageMain.PageSize - 1 || oRow.RowIndex == gvLanguageMain.PageSize - 1))
                             isLastRow = true;
                         else if (oRow.RowIndex == oSource.Count - 1)
                             isLastRow = true;
                         if (oRow.RowIndex > 0)
                         {
                             if (!sCurrentInvNo.Equals(sPreviousInvNo))
                             {
                                 if (oRow.RowIndex - iPreviousInvRowNum > 1)
                                 {
                                     AddRowSpanForColumns(gvLanguageMain.Rows

[iPreviousInvRowNum], iMergeBegin, iMergeEnd, oRow.RowIndex - iPreviousInvRowNum);
                                 }
                                 sPreviousInvNo = sCurrentInvNo;
                                 iPreviousInvRowNum = oRow.RowIndex;
                             }
                             else
                             {
                                 RemoveColumnsFromRow(oRow, iMergeBegin, iMergeEnd);
                                 if (isLastRow)
                                 {
                                     AddRowSpanForColumns(gvLanguageMain.Rows

[iPreviousInvRowNum], iMergeBegin, iMergeEnd, oRow.RowIndex - iPreviousInvRowNum + 1);
                                 }
                             }
                         }
                         else
                         {
                             sPreviousInvNo = sCurrentInvNo;
                             iPreviousInvRowNum = oRow.RowIndex;
                         }
  在外部定义一个方法
   /// <summary>
        /// Adds the row span for columns.
        /// </summary>
        /// <param name="oRow">The row.</param>
        /// <param name="iIndexOfColumnBegin">The index of column begin.</param>
        /// <param name="iIndexOfColumnEnd">The index of column end.</param>
        /// <param name="iRowspan">The rowspan.</param>
        private void AddRowSpanForColumns(GridViewRow oRow, int iIndexOfColumnBegin, int

iIndexOfColumnEnd, int iRowspan)
        {
            for (int i = 0; i < oRow.Cells.Count; i++)
            {
                if (i < iIndexOfColumnBegin || i > iIndexOfColumnEnd)
                {
                    oRow.Cells[i].RowSpan = iRowspan;
                }
            }
        }

      private void RemoveColumnsFromRow(TableRow oRow, int iIndexOfColumnBegin, int

iIndexOfColumnEnd)
        {
            for (int i = 0; i < oRow.Cells.Count; i++)
            {
                if (i < iIndexOfColumnBegin || i > iIndexOfColumnEnd)
                {
                    oRow.Cells.RemoveAt(i);
                    i--;
                    iIndexOfColumnBegin--;
                    iIndexOfColumnEnd--;
                }
            }
        }

不要用多个and拼接,会影响执行速度


5. Cannot find column error?

若是在dataset绑定的时候出错那就是以前没有建立那列,而若是在UI转换 则你绑定(或者排序,个人就

是排序的时候重复排序)的时候错误了。


6.获取父页面的方法并传值
function ResourceSelect_Button_Select_onclick() {
    var ResourceType, oGridView, index;
    index = F(_pre + 'hdTabIndex').value
    var arrText = [], arrDesc = [], arrKey = [];
    if (index == '1') {
        oGridView = F(_pre + 'Gdv1');
    }
    if (index == '2') {
        oGridView = F(_pre + 'Gdv2');
    }
    if (index == '3') {
        oGridView = F(_pre + 'Gdv3');
    }
    ResourceType = index;
    for (var i = 1; i < oGridView.rows.length-1; i++) {
        var a = oGridView.rows[i].cells[0].getElementsByTagName("INPUT")[0];
        if (a != undefined && a.checked) {
            arrText.push(oGridView.rows[i].cells[1].innerHTML);
            arrDesc.push(oGridView.rows[i].cells[2].innerHTML);
            arrKey.push(oGridView.rows[i].cells[3].innerHTML);
        }
    }
    if (arrKey.length < 1) {
        alert(SelectAtLeastOneItem);
        return false;
    }
    parent.document.getElementById('SISIframe').contentWindow.LoadResourcetInformation

(arrText, arrDesc, arrKey,ResourceType);
    ResourceSelect_Button_Cancel_onclick();
    return true;
}

接收
function LoadResourcetInformation(arrText, arrDesc, arrKey, ResourceType) {
            var arrText = arrText.slice(0);
            var arrDesc = arrDesc.slice(0);
            var arrKey = arrKey.slice(0);
            sResourceType = ResourceType;
            var oGridView = document.getElementById('<%=GridViewResourceText.ClientID %>');
            //delete empty row.
            if (oGridView.rows[1].cells[1].innerHTML == '&nbsp;') {
                oGridView.deleteRow(1);
            }
            for (var i = 0; i < arrKey.length; i++) {
                var sInsertContent = '<tr onmouseout="OnmouseoutClient(this)"

onmouseover="OnmouseoverClient(this)"  class="RowStyle">';
                sInsertContent += '<td align="center" style="width:2%;">';
                sInsertContent += '<input type="checkbox" name="checkItem"

id="cboCheckItem" Key="' + arrKey[i] + '">';
                sInsertContent += '</td>';
                sInsertContent += '<td align="left" style="width:55%;">' + arrText[i] +

'</td>';
                sInsertContent += '<td align="left" style="width:43%;">' + arrDesc[i] +

'</td>';
                sInsertContent += '<td class="hidden" > ' + arrKey[i] + ' </td>';
                sInsertContent += '</tr>';
                //delete duplicate data.
                if (oGridView.rows.length > 1) {
                    for (var y = 1; y < oGridView.rows.length; y++) {
                        if (arrText[i] == oGridView.rows[y].cells[1].innerHTML && arrDesc

[i] == oGridView.rows[y].cells[2].innerHTML) {
                            oGridView.deleteRow(y);
                        }
                    }
                }
                $('#<%=GridViewResourceText.ClientID %>').append(sInsertContent);
                if (oGridView.rows.length > 2) {
                    $("#ResourceDIV").css("height","100px");
                }
            }

        }


7.  父页刷新   window.parent.refresh()

8.把gridview的pageindex设置为第一页   Gdv1.PageIndex = 0;

9. <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>  </ContentTemplate> </asp:UpdatePanel>



10 数据库是javascript代码,仍是想照常输出到label里面要把他转换为Server.HtmlEncode()里面进行

转,html会本身解析换为html代码,而后页面会本身转换一次


11.Object reference not set to an instance of an object.(未将对象引用设置到对象的实例。)

一、ViewState 对象为Null。
二、DateSet 空。
三、sql语句或Datebase的缘由致使DataReader空。
四、声明字符串变量时未赋空值就应用变量。
五、未用new初始化对象。
六、Session对象为空。
七、对控件赋文本值时,值不存在。
八、使用Request.QueryString()时,所获取的对象不存在,或在值为空时未赋初始值。
九、使用FindControl时,控件不存在却没有作预处理。
十、重复定义找过象引用设置到对象的实例错误.

我作的是从一个页面直接访问另一个页面的方法,而在那个方法里面恰好有另一个页面的控件,因

为没有通过另一个页面的初始化,因此找不到控件。

十一、 sql存储过程里面的字符串拼接参数都要为字符串类型,否则会报错

12. 获取frame或者iframe的Id为SISIframe所在的window对象的事件为SetPackageInfo
 parent.document.getElementById('SISIframe').contentWindow.SetPackageInfo(oPackageInfo);

13. ASP.NET Web Forms中用System.Web.Optimization的做用
BundleConfig.cs
http://code.msdn.microsoft.com/Loop-Reference-handling-in-caaffaf7/sourcecode?

fileId=65769&pathId=502359014

14.DataSet.Relations
获取用于将表连接起来并容许从父表浏览到子表的关系的集合。

http://www.cnblogs.com/Holdon/archive/2010/01/13/1646609.html


15 .DataTable转换为List

#region DataTable To List
        /// <summary>
        /// DataTable装换为泛型集合
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="DataTable">DataTable</param>
        /// <returns></returns>
        public static List<T> ToList<T>(this DataTable datatable)
        {
            int n = 0;
            try
            {
                // 返回值初始化
                List<T> result = new List<T>();
                for (int j = 0; j < datatable.Rows.Count; j++)
                {
                    n = j;
                    T _t = (T)Activator.CreateInstance(typeof(T));
                    PropertyInfo[] propertys = _t.GetType().GetProperties();
                    foreach (PropertyInfo pi in propertys)
                    {
                        for (int i = 0; i < datatable.Columns.Count; i++)
                        {
                            // 属性与字段名称一致的进行赋值
                            if (pi.Name.Equals(datatable.Columns[i].ColumnName))
                            {
                                // 数据库NULL值单独处理
                                if (datatable.Rows[j][i] != DBNull.Value)
                                    pi.SetValue(_t, datatable.Rows[j][i], null);
                                else
                                    pi.SetValue(_t, null, null);
                                break;
                            }
                        }
                    }
                    result.Add(_t);
                }
                return result;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        #endregion

        #region DataView To List
        /// <summary>
        /// DataView装换为泛型集合
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="DataView">DataView</param>
        /// <returns></returns>
        public static List<T> ToList<T>(this DataView dataview)
        {
            int n = 0;
            try
            {
                // 返回值初始化
                List<T> result = new List<T>();
                for (int j = 0; j < dataview.Count; j++)
                {
                    n = j;
                    T _t = (T)Activator.CreateInstance(typeof(T));
                    PropertyInfo[] propertys = _t.GetType().GetProperties();
                    foreach (PropertyInfo pi in propertys)
                    {
                        for (int i = 0; i < dataview.Table.Columns.Count; i++)
                        {
                            // 属性与字段名称一致的进行赋值
                            if (pi.Name.Equals(dataview.Table.Columns[i].ColumnName))
                            {
                                // 数据库NULL值单独处理
                                if (dataview[j][i] != DBNull.Value)
                                    pi.SetValue(_t, dataview[j][i], null);
                                else
                                    pi.SetValue(_t, null, null);
                                break;
                            }
                        }
                    }
                    result.Add(_t);
                }
                return result;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        #endregion


15.  Html转化为图片的实现
http://www.cnblogs.com/lyl6796910/archive/2013/01/24/2875809.html

16 C#技术PDF转换成图片——13种方案
http://www.cnblogs.com/lyl6796910/p/3318056.html


17 获取视频属性
http://www.cnblogs.com/TianFang/archive/2013/06/16/3138779.html

18.未能加载文件或程序集“XXX”或它的某一个依赖项。系统找不到指定的文件。
 1. DLL没有引用。

  2. DLL文件名与加载时的DLL文件名不一致。

  3. DLL文件根本不存在,即出现丢失状况。

  4. 加载DLL路径错误,即DLL文件存在,但加载路径不正确。

  5. 引用了DLL,路径也对,可是在Bin目录(也就是项目生成目录,更加实际状况不必定是Bin目录

)下没有引用的DLL(通常引用DLL后,自动加载到引用项目的Bin目录下)。
我上次加载引用一个System.Web.Operation.dll 这个dll文件,由于vs的里面带一个这个名字的dll,而

我从别的项目拷一个过来,而不是本项目内部的,因此报错。
解决:我从管理NuGet上面下载了一个dotless adapter for System.Web.Optimization的安装包安装完

就能够了。javascript

 

“/Web”应用程序中的服务器错误。css


给定关键字不在字典中。html

说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中致使错误的出处的详细信息。前端

 

结论 没有成功绑定或者绑定的字段不存在或者绑定的字段没有把数据传递过来java

 

 

 

Js缺乏函数,node

 

多是没有成功nginx

 

因为启动用户实例的进程时出错,致使没法生成SQL Server的用户实例web

http:/wenwen.soso.com/z/q15616823.htmajax

版本过低,只支持2005及如下数据库spring

 解决:安装VisualStudio 2008 SP1

启动超时

  解决:多试几回

从索引 97 处开始,初始化字符串的格式不符合规范。

  解决:链接的输入字符串中有错(ASO.NET链接数据中的时候)

ConnectionString 属性还没有初始化

解决:链接异常(如dispose以后还open)

ExecuteNonQuery 要求已打开且可用的链接。链接的当前状态为已关闭。

  解决:没有open()

 变量名 '@UserName' 已声明。变量名在查询批次或存储过程内部必须惟一

  解决:要把以前的数据清空。

阅读器关闭时场所通用Read无效

 解决:使用datatable方法不使用datareader

参数化查询 '(@Id bigint)select * from Users where Id=@Id' 须要参数 '@Id',但未提供该参数。(如题:SQLHelper.ExecuteDataTable("select * from Users where Id=@Id",new SqlParameter("Id",0));

public static DataTable ExecuteDataTable(string sql, params SqlParameter[] parameters)

        {

            string ConStr = ConfigurationManager.ConnectionStrings["ConStr"].ConnectionString;

            using (SqlConnection conn = new SqlConnection(ConStr))

            {

                conn.Open();

                using (SqlCommand cmd = conn.CreateCommand())

                {

                    cmd.CommandText = sql;

                    foreach (SqlParameter parameter in parameters)

                    {

                        cmd.Parameters.Add(parameter);

                    }

                    DataSet dataset = new DataSet();

                    SqlDataAdapter adapter=new SqlDataAdapter(cmd);

                    adapter.Fill(dataset);

 

                    return dataset.Tables[0];

                }

            }

 

        })

解决:查看SqlParameter的定义,里面有一个SqlDbType dbType,再查看他能够看出来里面是枚举类型

修改成SQLHelper.ExecuteDataTable("select * from Users where Id=@Id",new SqlParameter("Id",(object)0));实际上就是进行类型的转换

数据库sqlconection在程序中一直保持他open能够吗

答:不行,链接是很是宝贵的资源,链接的数量是有限的,必定要用完就close或者dispose

当传递具备已修改的DataRow集合时,更新要求有效的Updatecommand。

解决:要为表设置主键 ,谁都在表,惟有主键不会变,程序要经过主键来定位要更新的行。   忘记设置主键怎么办?先到数据库中设置主键,而后在DataSet的对应的DataTable上点右键,选择“配置”,在点击“完成”(若是是新增或者删除字段的话,点击“配置”,“查询生成器”,再把新增的字段给打钩,在“完成”)

类 结构或接口成员声明中的标志"using"无效

 解决:在这个前面缺乏定义一个方法

线程间操做无效: 从不是建立控件“txtNum”的线程访问它。

 

将截断字符串或二进制数据。

语句已终止。

解决:原先定义的字符串长度不够

WinForm中奖DataReader绑定到DataGridView的两种方法

在WinForm中,DataReader是不能直接绑定到DataGridView的,我想到了用两种方法来实现将DataReader绑定到DataGridView。

SqlCommand command = new SqlCommand(QueryString, connection);
connection.Open();
SqlDataReader reader = command.ExecuteReader();

//方法一,借助于DataTable
//DataTable table = new DataTable();
//table.Load(reader);
//dataGridView1.DataSource = table;

//方法二,借助于BindingSource
BindingSource bs = new BindingSource();
bs.DataSource = reader;
dataGridView1.DataSource = bs;

reader.Close();

 

 

 

“SqlLibrary.SqlHelper”的类型初始值设定项引起异常。

 该类在使用时(初始化时)发生的异常,包括这个类的构造函数、字段的默认值等,尤为是静态类中常会遇到。由于静态类的字段在类的第一次使用前会初始化一下。(设置断点调试)

 

解决:系统版本不纯净,重装

在作Socket的传输文件的时候没办法弹出保存的窗体缘由是:没有this参数

系统IIS没有没有不少东西,缘由是先安装了.net framework,再安装了IIS,在安装framework的时候发现你系统没有安装iis不帮你注册iis文件表,解决办法:在dos里面 ,而后再到 ,再次输入aspnet_regiis -i

用ExecuteReader查询的时候,若是要获取输出参数的值,方法一:必须关闭sqlDataRead对象才会有值,由于关闭才表明查询结束。方法二:在存储过程的时候当第二张表的值返回,如select @total=count(1) from #temp  

select @total

或者不使用ExecuteReader,而使用Adapter

C#在发送邮箱的时候发生:没法从传输链接中读取数据: net_io_connectionclosed。

解决:可能打开了360等杀毒软件或者打开了防火墙

Datagrid里面的分页功能:$("#grid").datagrid('loadData', { "rows": data.data[0].rows, "total": data.data[0].total });

Assert.AreEqual 失败。应为: <e10adc3949ba59abbe56e057f20f883e>,实际为:

<2251022057731868917119086224872421513662>。

缘由:编写ajax的时候代码书写错误

win7 部署weblogic 不能运行http://localhost:7001/console/

解决办法:去系统盘中寻找startWebLogic.cmd这个文件,而后执行,不能关闭,一关闭就不能运行页面了

oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:133)<br/

看链接字符串 服务器IP 名称 用户名密码等链接有没有错,防火墙有没有关

安装sql server management studio express时出现错误码29506,应该怎么解决,个人系统是WIN7旗舰版

 解决:http://www.microsoft.com/zh-cn/download/confirmation.aspx?id=15366

 

  1. 因为启动用户实例的进程时出错,致使没法生成SQL Server的用户实例

http:/wenwen.soso.com/z/q15616823.htm

  1. 版本过低,只支持2005及如下数据库

 解决:安装VisualStudio 2008 SP1

  1. 启动超时

  解决:多试几回

  1. 从索引 97 处开始,初始化字符串的格式不符合规范。

  解决:链接的输入字符串中有错(ASO.NET链接数据中的时候)

  1. ConnectionString 属性还没有初始化

解决:链接异常(如dispose以后还open)

  1. ExecuteNonQuery 要求已打开且可用的链接。链接的当前状态为已关闭。

  解决:没有open()

  1.  变量名 '@UserName' 已声明。变量名在查询批次或存储过程内部必须惟一

  解决:要把以前的数据清空。

  1. 阅读器关闭时场所通用Read无效

 解决:使用datatable方法不使用datareader

  1. 参数化查询 '(@Id bigint)select * from Users where Id=@Id' 须要参数 '@Id',但未提供该参数。(如题:SQLHelper.ExecuteDataTable("select * from Users where Id=@Id",new SqlParameter("Id",0));

public static DataTable ExecuteDataTable(string sql, params SqlParameter[] parameters)

        {

            string ConStr = ConfigurationManager.ConnectionStrings["ConStr"].ConnectionString;

            using (SqlConnection conn = new SqlConnection(ConStr))

            {

                conn.Open();

                using (SqlCommand cmd = conn.CreateCommand())

                {

                    cmd.CommandText = sql;

                    foreach (SqlParameter parameter in parameters)

                    {

                        cmd.Parameters.Add(parameter);

                    }

                    DataSet dataset = new DataSet();

                    SqlDataAdapter adapter=new SqlDataAdapter(cmd);

                    adapter.Fill(dataset);

 

                    return dataset.Tables[0];

                }

            }

 

        })

解决:查看SqlParameter的定义,里面有一个SqlDbType dbType,再查看他能够看出来里面是枚举类型

修改成SQLHelper.ExecuteDataTable("select * from Users where Id=@Id",new SqlParameter("Id",(object)0));实际上就是进行类型的转换

  1. 数据库sqlconection在程序中一直保持他open能够吗

答:不行,链接是很是宝贵的资源,链接的数量是有限的,必定要用完就close或者dispose

  1. 当传递具备已修改的DataRow集合时,更新要求有效的Updatecommand。

解决:要为表设置主键 ,谁都在表,惟有主键不会变,程序要经过主键来定位要更新的行。   忘记设置主键怎么办?先到数据库中设置主键,而后在DataSet的对应的DataTable上点右键,选择“配置”,在点击“完成”(若是是新增或者删除字段的话,点击“配置”,“查询生成器”,再把新增的字段给打钩,在“完成”)

  1. 类 结构或接口成员声明中的标志"using"无效

 解决:在这个前面缺乏定义一个方法

  1. 线程间操做无效: 从不是建立控件“txtNum”的线程访问它。

 

  1. 将截断字符串或二进制数据。

语句已终止。

解决:原先定义的字符串长度不够

  1. WinForm中奖DataReader绑定到DataGridView的两种方法

在WinForm中,DataReader是不能直接绑定到DataGridView的,我想到了用两种方法来实现将DataReader绑定到DataGridView。

SqlCommand command = new SqlCommand(QueryString, connection);
connection.Open();
SqlDataReader reader = command.ExecuteReader();

//方法一,借助于DataTable
//DataTable table = new DataTable();
//table.Load(reader);
//dataGridView1.DataSource = table;

//方法二,借助于BindingSource
BindingSource bs = new BindingSource();
bs.DataSource = reader;
dataGridView1.DataSource = bs;

reader.Close();

 

 

 

  1. “SqlLibrary.SqlHelper”的类型初始值设定项引起异常。

 该类在使用时(初始化时)发生的异常,包括这个类的构造函数、字段的默认值等,尤为是静态类中常会遇到。由于静态类的字段在类的第一次使用前会初始化一下。(设置断点调试)

解决:系统版本不纯净,重装

  1. 在作Socket的传输文件的时候没办法弹出保存的窗体缘由是:没有this参数
  2. 系统IIS没有没有不少东西,缘由是先安装了.net framework,再安装了IIS,在安装framework的时候发现你系统没有安装iis不帮你注册iis文件表,解决办法:在dos里面 ,而后再到 ,再次输入aspnet_regiis -i

用ExecuteReader查询的时候,若是要获取输出参数的值,方法一:必须关闭sqlDataRead对象才会有值,由于关闭才表明查询结束。方法二:在存储过程的时候当第二张表的值返回,如select @total=count(1) from #temp  

select @total

或者不使用ExecuteReader,而使用Adapter

  1. C#在发送邮箱的时候发生:没法从传输链接中读取数据: net_io_connectionclosed。

解决:可能打开了360等杀毒软件或者打开了防火墙

  1. Datagrid里面的分页功能:$("#grid").datagrid('loadData', { "rows": data.data[0].rows, "total": data.data[0].total });
  2. Assert.AreEqual 失败。应为: <e10adc3949ba59abbe56e057f20f883e>,实际为:

22.<2251022057731868917119086224872421513662>。

缘由:编写ajax的时候代码书写错误

  1. win7 部署weblogic 不能运行http://localhost:7001/console/

解决办法:去系统盘中寻找startWebLogic.cmd这个文件,而后执行,不能关闭,一关闭就不能运行页面了

  1. oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:133)<br/

看链接字符串 服务器IP 名称 用户名密码等链接有没有错,防火墙有没有关

  1. 安装sql server management studio express时出现错误码29506,应该怎么解决,个人系统是WIN7旗舰版

 解决:http://www.microsoft.com/zh-cn/download/confirmation.aspx?id=15366

  1. Microsoft.Jet.OLEDB.4.0' 配置为单线程单元下运行,因此该访问接口没法用于分布式

解决:http://bbs.csdn.net/topics/370212059

  1. 原来是SQL 2005 express的数据库而后转到SQL 2008 R2 后,用.\express做为实例名,无论用sa仍是admin添加的时候都会出错,提示{ An Error occured when attaching database(s) },查看详细是Error 948,我的人为是你原来的在express里面,可是在sql 2008 r2里面没有sqlexpress(没有为何还能够登陆,这个我就不想明白了,多是里面的版本低于如今是SQL 2008 r2把),也有人说是你的文件的权限文件(添加一个system(拥有全部权限,Authenticated Users(可读可写可修改),Everyone(可读))),有时候改了可行,有时候不行,我不知道是什么缘由,用Local做为实例名正常(他会本身添加一个权限Owner Rights,还有另一个估计是sql权限) 个人系统是win 7 x64。
  2. IE 8按F12没反映问题  缘由:F12没移动到左上角了,因此你看不到效果。

解决:预览找到你F12的那个页面,右击“移动”,按下”↓” 把他移动下来。

  1. VS 2010没有负载测试的问题。 若是不是ultimated版本就没有负载测试这个,你要本身安装Visual Studio 2010 Load Test Feature Pack Deployment Guide,而这个在visual_studio_agents_2010安装文件里面有这个功能,如图:

 

  1. 安装配置负载测试的是出错:Failed to configure load test database 缘由 确实 sp1的某个dll文件

解决:安装VS 2010 SP1

  1. 问题:检索 COM 类工厂中 CLSID 为 {10020200-E260-11CF-AE68-00AA004A34D5} 的组件时失败。

解决:今天本人要用vs中用ORM 和数据库建立链接时 用一个CreateEntity.exe链接本地数据库(SQL Server 2008)时 出现这个错误:检索 COM 类工厂中 CLSID 为 {10020200-E260-11CF-AE68-00AA004A34D5} 的组件时失败。刚开始觉得是用户权限的问题因而在网上搜了好一阵找到一个感受沾边的解决办法:http://www.6down.net/html/technologydoc/201004/02/213.htm。这个只是再数据库中文件完整的状况下,这个办法能解决通常的问题。可是我试后仍是不行。因而又招到这个具体的CLSID错误号码在谷歌上搜便找到了这个缘由:http://www.cnblogs.com/foundation/archive/2008/10/07/1305297.html原来是SQL server 2008里的文件缺乏一个.dll文件:QLDMO。后来终于找到了个人解决办法:http://www.cnblogs.com/kycms/archive/2009/08/14/1546378.html。这里面的问题就是个人具体问题解决办法。试事后,我就连起个人数据库了。要是你们的数据库是MSSQL SERVER 2008的话,就能够这样作。直接照第三个连接作就能够了。

若是仍是不行在在VS中找到引用控件所在的项目--〉属性--〉生成--〉常规---〉目标平台---〉选择X86便可解决。

 

  1. 检测mssql 的版本 SELECT @@Version AS ver
  2. 33.   错误 1 错误 2019: 指定的成员映射无效。类型“TEModel.FilterConfiguration”中的成员“TempID”的类型“Edm.Int32[Nullable=False,DefaultValue=]”与类型“TEModel.Store.FilterConfigurations”中的成员“TempID”“SqlServerCe.nvarchar[Nullable=False,DefaultValue=,MaxLength=4000,Unicode=True,FixedLength=False]”不兼容。 D:\MyProject\TE\TEHelperTool\Main\TE\TE.DataAccess\TEModel.edmx 374 11 TE.DataAccess

解决:用全局去搜索TempID(Model里面),把他的类型修改成你所要的类型

 把转换为JSON报错:A circular reference was detected while serializing an object of type缘由是我把要传出来的值写错了var data = new { total = param.Total, rows = from u in users select new { u, u.Id, u.Address, u.Age, u.Phone, u.UPwd, u.NickName, u.UserName, u.Email, u.Gender, u.LastLoginIP } };

正确的是var data = new { total = param.Total, rows = from u in users select new { u.Id, u.Address, u.Age, u.Phone, u.UPwd, u.NickName, u.UserName, u.Email, u.Gender, u.LastLoginIP } };不能在多传u不能会报错,说重复了

  1. 在$.ready(function (){});中写上$(".IsMenu").click(function () {});事件不触发,而在$(function(){});事件则触发
  2. 用EF来绑定的数据库,当删除某个用户组的时候(而这个组已经有用户了),删除不了 ,只能先把原来的用户移除、
  3.  

The type or namespace name '****' could not be found (are you missing a using directive or an assembly reference

解决:由于我程序的运行环境是.net4.0,而dll是2.0的,起初我怀疑是版本冲突的问题,为此我还专门把这个dll拿到vs2005上试了下,结果是能够正确运行。

可是,回过头来想一下就会以为版本冲突的想法有些扯淡,哪有高版本的.net不能调用低版本的?这明显不符合向下兼容的原则。

  1. The type initializer for 'Spring.Context.Support.ContextRegistry' threw an exception

说明:引用不包含Common.Logging.dll(通用日志接口),找到文件所在文职引用添加进去或者去服务器上面找。

  1. Error creating context 'spring.root': 'CusName' node cannot be resolved for the specified context [SpringNhiberateStart.Customer].

解决:App.config配置文件里面的解决不包含Customer或者包含可是配置错误(如:<object name="Customer" type="SpringNhiberateStart.Customer,SpringNhiberateStart"> (<!--type:第一个是类型的全名称,第二个是类型所在程序集-->))

  1. 页面中有些能够触发click有些不不触发,但又不是本身写的javascript有问题,好比
  2.   $(function () {

            bindMenuLinkClick();

        });

     //点击菜单按钮就在中间区域添加一个页签

        function bindMenuLinkClick() {

            $('.easyuilinkbutton').click(function () {

             //省略

  });

        }

解决:function bindMenuLinkClick() {

            $(document).on("click",'.easyuilinkbutton',function () {

});

}         //(on是1.7.0之后的支持的,原来的旧版本用live。分析:页面加载以后再用代码好比AJAX生成的代码,必需得用live或on才行
否则的话,你得在AJAX生成代码后再用bind绑定 )

  1. No context registered. Use the 'RegisterContext' method or the 'spring/context' section from your configuration file.(在配置Sptring.net的时候出现的)

分析:app.config没有配置或者配置错误。

  1. Could not load file or assembly 'Iesi.Collections, Version=1.0.1.0, Culture=neutral, PublicKeyToken=aa95f207798dfdb4' or one of its dependencies. 系统找不到指定的文件。

分析:在使用NHibernate的时候缺乏Iesi.Collections.dll,添加引用便可。

  1.  NHibernate.ByteCode.LinFu.ProxyFactory does not implement NHibernate.Bytecode.IProxyFactoryFactory
  2. 在配置Spring.net和NHibernate时候代码没错但仍是不成功或者报错了。

解决:若是是把他们配置到xml文件,右击xml文件属性。Build Action设置为嵌入资源(Embedded Resource),另外要把Copy  to output Directory 设置为始终复制。

  1. Nbernate 出现NHibernate.Bytecode.ProxyFactoryFactoryNotConfiguredException: The ProxyFactoryFactory was not configured

多是配置文件出错,把这段代码放到app.config里面<property name="proxyfactory.factory_class">NHibernate.ByteCode.LinFu.ProxyFactoryFactory, NHibernate.ByteCode.LinFu</property>

 

解决:ibernate的最新版本为:NHibernate-2.1.2.GA-bin,和以往版本不同。在使用配置时,在hibernate.cifg.xml文件中须要添加

<property name="proxyfactory.factory_class">NHibernate.ByteCode.LinFu.ProxyFactoryFactory, NHibernate.ByteCode.LinFu</property>

 添加后,需引用Required_For_LazyLoading\LinFu下面的dll,不然会出现如错误:

  1. 在安装完mygeneration 的时候打开他会出现You must choose Driver,多是mygeneration加载搜索你电脑的数据库类型缓慢的原理,请你重开几回 或者重启试试。
  2. Cannot find a Resource with the Name/Key UserName [Line: 17 Position: 20]

说明:加载页面没有找到UserName的key,可能要先到你加载以前

  1. A relative URI cannot be created because the 'uriString' parameter represents an absolute URI.

说明:uri地址有错。

  1. Error 3 Unsafe code may only appear if compiling with /unsafe

解决方法:在工程属性中勾选“Allow Unsafe code”

 

50. 2012/04/02 13:55:59 [emerg] 7864#2376: bind() to 0.0.0.0:80 failed (10013: An attempt was made to access a socket in a way forbidden by its access permissions)  

打开nginx报错解决办法:

在cmd窗口运行以下命令:

 

[plain]

C:\Users\Administrator>netstat -aon | findstr :80  

  www.2cto.com  

看到80端口果然被占用。发现占用的pid是4,名字是System。怎么禁用呢?

一、打开注册表:regedit

二、找到:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\HTTP

三、找到一个REG_DWORD类型的项Start,将其改成0

四、重启系统,System进程不会占用80端口

重启以后,start nginx.exe 。在浏览器中,输入127.0.01,便可看到亲爱的“Welcome to nginx!” 了。

 

  1. Add value to collection of type 'Microsoft.Phone.Shell.ApplicationBarItemList`1[[Microsoft.Phone.Shell.IApplicationBarIconButton, Microsoft.Phone, Version=7.0.0.0, Culture=neutral, PublicKeyToken=24EEC0D8C86CDA1E]]' threw an exception. [Line: 40 Position: 82]

WInphone页面的.ApplicationBarItem报错,多是图标的数量超过了(正常最可能是4个)

  1.  Invalid URI: The format of the URI could not be determined.

解释:URl地址有错误,好比要加http://

  1.   //Invalid URI: The Authority/Host could not be parsed.

解释:URL地址没法解析,多是URL地址错误

  1.  Error       10    Could not load the assembly file:///D:\新建文件夹\新建文件夹\zhianchen\heima\Windows Phone2\Windows Phone\PhoneApp1\lib\Coding4Fun.Toolkit.Audio.dll.This assembly may have been downloaded from the Web.  If an assembly has been downloaded from the Web, it is flagged by Windows as being a Web file, even if it resides on the local computer. This may prevent it from being used in your project. You can change this designation by changing the file properties. Only unblock assemblies that you trust. See http://go.microsoft.com/fwlink/?LinkId=179545 for more information. PhoneApp1(中文:错误十不能加载大会文件,这个组装可能已经从网上下载。若是一个装配已从网上下载,它是由Windows做为Web标记文件,即便它驻留在本地计算机上。这可能阻止它被用于你的项目。您能够更改这个名称经过更改文件属性。惟一你信任的开启程序集。请参见http://go.microsoft.com/fwlink/?LinkId = 179545的更多信息。PhoneApp1)

你文件的权限不够形成不安全,删除引用,Coding4Fun.Toolkit.Audio.dll右击属性→解除锁定。而后在添加引用。

  1. Error 1       'GestureEventArgs' is an ambiguous reference between 'System.Windows.Input.GestureEventArgs' and 'Microsoft.Phone.Controls.GestureEventArgs'        D:\新建文件夹\新建文件夹\zhianchen\heima\Windows Phone2\Windows Phone\PhoneApp1\变换Page2.xaml.cs  24     44     PhoneApp1

只能把'GestureEventArgs'指定到具体某个命名空间下面的事件,好比改为System.Windows.Input.GestureEventArgs

56. Microsoft.Phone.Controls.Toolkit的listpickerItem大于5个的时候会报错,m为2个的时候高度是192px,之后每增长1个Item,高度增长192px,如此类推,当增长到5个的时候高度为768px,那么第6个就没法在屏幕内显示完整,所以会有报错。

解决:        <tk:ListPicker x:Name="ListPicker">

            <tk:ListPicker.FullModeItemTemplate>

                <DataTemplate>

<CheckBox Content="{Binding}"></CheckBox> 

                </DataTemplate>

            </tk:ListPicker.FullModeItemTemplate>

<tk:ListPicker.ItemTemplate>

                <DataTemplate>

                    <TextBlock Text="{Binding}"></TextBlock>

                </DataTemplate>

            </tk:ListPicker.ItemTemplate>

        </tk:ListPicker>

后台用ItemsSource绑定

ListPicker.ItemsSource = new string[] { "aaa", "bbb", "ccc", "dddd", "eeee", "ffff", "gggg", "hhhh", "ii", "aaa", "bbb", "ccc", "dddd", "eeee", "ffff", "gggg", "hhhh", "ii" };

 

  1. Cannot add instance of type 'System.String' to a collection of type 'System.Windows.Controls.UIElementCollection'. [Line: 44 Position: 28]

字符串没法转换为UI容器

  1.  Attempt to access the method failed: System.IO.File.OpenRead(System.String)

解析:权限不够,winphone 不能用传统的IO读取和写入方法File.OpenWrite()也会报错。 

IsolatedStorageFile isf= IsolatedStorageFile.GetUserStoreForApplication();  //按应用程序获取用户的独立存储

isf.CreateDirectory("hello");  //写至关于独立存储目录的路径就行。

using (Stream stream = isf.CreateFile("hello/1.txt"))

{

  using (StreamWriter sw = new StreamWriter(stream))

      {

          sw.WriteLine("heiheihei!!!");

     }

}

 

  1. new ActiveXObject ( Excel.Application ); <not available>  Web访问本地文件的权限不够。
  2.  Error 1 The type '  ' is defined in an assembly that is not referenced. You must add a reference to assembly 'Heima.Hotel.Model, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.

解析:版本不兼容

  1. Could not load file or assembly 'XMblogs.Web.SQL.DAL' or one of its dependen

找不到程序集,当你的程序没用错,而Assembly.Load(assemblyName);

却找不到名称报错的时候是由于你这个项目没有添加给 ‘XMblogs.Web.SQL.DAL’的引用。

解决:解决方法:

1.检查OracleDAL工程属性看Assembly name是否为OracleDAL。

2.看web中有没有添加OracleDAL.dll的引用(多数多是这个缘由)。

  1.  Unable to cast object of type 'OracleDAL.Config' to type 'IDAL.IConfig'

 解决方法:OracleDAL中的类应该如定义:

public class Config:IConfig{}

  1.  An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately

若是配置文件没错的话,那就是dll生成的位置变了。

. Multiple types were found that match the controller named 'Home'. This can happen if the route that services this request ('{controller}/{action}/{id}') does not specify namespaces to search for a controller that matches the request. If this is the case, register this route by calling an overload of the 'MapRoute' method that takes a 'namespaces' parameter.

The request for 'Home' has found the following matching controllers:
XMblogs.Web.UI.Controllers.HomeController
XMblogs.Web.UI.Areas.Shopping.Controllers.HomeController

说明:路由冲突

 CS0234: The type or namespace name 'Optimization' does not exist in the namespace 'System.Web' (are you missing an assembly reference?) 且using System.Web.Optimization;

为红色的红色,则你要添加System.Web.Optimization;的引用。

  1.  Multiple types were found that match the controller named 'Home'. This can happen if the route that services this request ('{controller}/{action}/{id}') does not specify namespaces to search for a controller that matches the request. If this is the case, register this route by calling an overload of the 'MapRoute' method that takes a 'namespaces' parameter.

解析:多个控制器的路由冲突

方法:在控制器的路由上面加上请求的命名控件

好比:

routes.MapRoute(

                "Default", // Route name

                "{controller}/{action}/{id}", // URL with parameters

                new { controller = "Home", action = "Index", id = UrlParameter.Optional },// Parameter defaults

                new {},

                new string[] { "MvcApplication1.Controllers" }//使用区域功能,而区域里面含有了相同名字的控制器的时候,使用此参数能够控制  搜索到相同名字的 控制器而报错的问题

            );

  1.  Value cannot be null.
    Parameter name: assemblyString

 

 

  1.  

系统找不到指定的文件。 (Exception from HRESULT: 0x80070002)

Assembly.LoadFile(path);

去找程序集的时候,要把路径的\改为/

  1.  Could not load file or assembly 'XMblogs.Web.SQL.DAL' or one of its dependencies. 系统找不到指定的文件。

工厂模式,跨项目引用另一个项目,若是你引用的是dll,而不是直接引用项目的话(直接引用项目的话会在工程模式的那个项目下面的bin\Debug生成一个XMblogs.Web.SQL.DAL的dll文件), 若是反射使用= Assembly.Load(assemblyName) 的话,本身会去本项目的bin\Debug下面查找程序集为assemblyName的,而你若是引用dll则没有这个dll文件,使用Assembly.LoadFile(path)来反射程序集。(且在web那个项目的bin中要有这个dll文件)

 

68. The object 'DF__Myphone__SunNum__07F6335A' is dependent on column 'SunNum'.

ALTER TABLE DROP COLUMN SunNum failed because one or more objects access this column.

说明:在删除字段的报错。 表中有一个叫DF__Myphone__SunNum__07F6335A的约束,用alter table Myphone  drop Constraint  DF__Myphone__SumNum__108B795B,删除在删除字段。

  1. The SqlParameter is already contained by another SqlParameterCollection. 解决:没有释放 SqlParameter
  2.  The SqlParameter is already contained by another SqlParameterCollection.

解决:http://www.cnblogs.com/dudu/archive/2005/07/15/19628.html

  1.  Procedure or function 'XMB_001_InsertSystemMessage' expects parameter '@MessagePeople', which was not supplied.

MessagePeople' 不符合要求,可能为null或者超出字段长度

  1.  Asp.net mvc本地测试没报错,可是发布到外网就报错。

分析:由于你本地安装了asp.net mvc因此不报错。Asp.net MVC自己不要求

服务器必须安装了它。由于咱们将System.Web.Mvc.dll和你或许用到的Microsoft.Web.Mvc.dll直接放在\Bin文件夹中部署就能够了,这种部署方式叫作私有部署,若是你买的空间没有安装Asp.net MVC的话(即GAC中没有上述的两个dll)经过私有部署的方式也很容易,另外若是你的服务器没有安装过.NET Framework SP1的话,你还须要将System.Web.Abstractions.dll和System.Web.Routing.dll也拷贝到你的\Bin文件夹中。下面会详述这些。

Asp.net MVC对咱们买的虚拟服务器有什么样的要求

除了须要服务器支持Asp.net 2.0和安装了.NET Frameworkd 3.5以外没有其余要求。因此咱们看不到有空间提供商打广告说本身的空间支持Asp.net MVC,由于经过把相关的程序集放在\Bin文件夹中你一样能够私有部署你的Asp.net MVC项目。

  1.  Type 'System.RuntimeType' with data contract name 'RuntimeType:http://schemas.datacontract.org/2004/07/System' is not expected. Consider using a DataContractResolver or add any types not known statically to the list of known types - for example, by using the KnownTypeAttribute attribute or by adding them to the list of known types passed to DataContractSerializer.
DataContractJsonSerializer serializer = new DataContractJsonSerializer(request.Type);
        MemoryStream ms = new MemoryStream();
        serializer.WriteObject(ms, request.Data);
        string json = Encoding.Default.GetString(ms.ToArray());
        ms.Dispose();
        return new JSONSerializationResponse() {Data = json};

 

修改为Type type = Type.GetType(request.Type);

        DataContractJsonSerializer serializer = new DataContractJsonSerializer(type, new Type[]{Type.GetType(request.Type)});

        MemoryStream ms = new MemoryStream();

        serializer.WriteObject(ms, request.Data);

        string json = Encoding.Default.GetString(ms.ToArray());

        ms.Dispose();

 

        return new JSONSerializationResponse() {Data = json};

  1.  Error        1       'XMblogs.Web.Model.ShopCategory' is a 'type' but is used like a 'variable'   D:\新建文件夹\新建文件夹\heima\XBblogs\XMblogs\XMblogsWebSolution\XMblogs.Web.UI\Areas\Shopping\Controllers\HomeController.cs   34     110 XMblogs.Web.UI

解析:XMblogs.Web.Model.ShopCategory是Type类型要重写,若是原来是XMblogs.Web.Common.Convertor.ListToJson<ShopCategory>(ListShopCategory, ShopCategory);

要写成XMblogs.Web.Common.Convertor.ListToJson<ShopCategory>(ListShopCategory,new ShopCategory());

 

  1.  DateTime values that are greater than DateTime.MaxValue or smaller than DateTime.MinValue when converted to UTC cannot be serialized to JSON.

用调试去看,值得某个时间类型的字段得出来的值不在DateTime类型内,常见得出来的值是” 0001/1/1 0:00:00”,null,因此要保证时间在DateTime规定的范围内

 Datable转换为List集合的有数据可是数据都为null,缘由在你Datatble转换为List集合里面的方法,ropertyInfo[] propertys = _t.GetType().GetProperties();  / //返回当前实例的全部属性

,你用调试去看,查看出来propertys的length为0,缘由是List集合里面的类的要用属性而不用用字段,因此他查询出来的length为0,把字段修改为属性就行,如public int ShopCategoryId ;改为public int ShopCategoryId { get; set; }

 

  1. Window Phone7向content或者resource文件里面写入东西时报错。 Value does not fall within the expected range.。

解释:目前没办法向content或者resource类型的写入公司。

 

            //读取Build Action=Resource类型的文件

            StreamResourceInfo streamInfo = Application.GetResourceStream(new Uri("/PhoneApp1;component/Resource.txt", UriKind.Relative));

            using (StreamReader reader = new StreamReader(streamInfo.Stream))

            {

                string txt = reader.ReadToEnd();

                MessageBox.Show(txt);

                //reader

            }

 

 

            //读取Build Action=Content类型的文件

            using (Stream stream = Microsoft.Xna.Framework.TitleContainer.OpenStream("Content.txt"))

            {

                using (StreamReader reader = new StreamReader(stream))

                {

                    string txt = reader.ReadToEnd();

                    MessageBox.Show(txt);

                }

            }

 

            //或者

            //StreamResourceInfo streamInfo = Application.GetResourceStream(new Uri("Content.txt", UriKind.RelativeOrAbsolute));

            //{

            //    using (StreamReader reader = new StreamReader(streamInfo.Stream))

            //    {

            //        string txt = reader.ReadToEnd();

            //        MessageBox.Show(txt);

            //    }

            //}

 

 

 

  1. Windows phone在作页面反转动画的时候错误:  hexadecimal value 0x0B, is an invalid character. Line 17, position 55.     

分析:你从PPT或者网上Copy下来的代码的编码格式可能跟你的widows phone的编码格式不同(网上你添加一些特殊字符可能在你的vs里面看不到,可是在记事本(notepad等)里面就显示很清楚了。),你最好手动敲一遍。

 Windows phone运动加速度感应器(Accelerometer acc = new Accelerometer();

            acc.CurrentValueChanged += new EventHandler<SensorReadingEventArgs<AccelerometerReading>>(acc_CurrentValueChanged);

            acc.Start();

void acc_CurrentValueChanged(object sender, SensorReadingEventArgs<AccelerometerReading> e)

        {

            //引用Microsoft.Xna.Framework

                textBlock1.Text= e.SensorReading.Acceleration.X + "," + e.SensorReading.Acceleration.Y+","+e.SensorReading.Acceleration.Z;

          

        }

 

  1. )的时候报错。 Invalid cross-thread access.

解决:要用异步线程委托void acc_CurrentValueChanged(object sender, SensorReadingEventArgs<AccelerometerReading> e)

        {

            //引用Microsoft.Xna.Framework

            Dispatcher.BeginInvoke(()=>

                textBlock1.Text= e.SensorReading.Acceleration.X + "," + e.SensorReading.Acceleration.Y+","+e.SensorReading.Acceleration.Z

                );

          

        }

 

  1.  Window phone 引用log4net报错:没法将引用添加到 XXXX引用他不是使用windows phone运行生成的。Windows phone 项目将只使用windows phone程序集

分析:Windows Phone采用的mscorlib.dll、System.dll等核心库是和桌面版本的.net是不同的,通过了精简、优化、修改,因此不能引用普通桌面版本的dll,甚至不能直接引用浏览器版本Silverlight的程序集。

 

  1. Windows 使用socket报错:Can not access a disposed object. Object name: 'System.Net.Sockets.Socket'.

若是是测试的话有多是你停留的时间多长或者网络不稳定

  1.  Error        1       The type 'PcRemote.Server.SocketCmdEventArgs' cannot be used as type parameter 'TEventArgs' in the generic type or method 'System.EventHandler<TEventArgs>'. There is no implicit reference conversion from ‘XXXX’ \SocketServer.cs  28 55     PcRemote.Server
  2.  因为套接字没有链接而且(当使用一个 sendto 调用发送数据报套接字时)没有提供地址,发送或接收数据的请求没有被接受。 
  3.  一个封锁操做被对 WSACancelBlockingCall 的调用中断。 

解析:由于有对象链接TcpClient或者没有对象链接的时候,关闭监听的时候报错。

解决:在报错的方法中获取当前的监听的tcpListener,用try{}catch (Exception ex)

            {

                tcpListener.Stop();

            }

 

  1.  Socket请求报错:在其上下文中,该请求的地址无效。 

Socket所绑定的IP或者端口错误或者防火墙问题。

  1. 一般每一个套接字地址(协议/网络地址/端口)只容许使用一次。  解析:端口被暂用
  2.  Wpf的listBox绑定List数据集,有绑定数据,可是显示不出来。

缘由:前端绑定要是类的属性名才行,不能用字段名,否则不行。

  1.  Invalid URI: The Authority/Host could not be parsed. 分析:URI地址错误
  2.  /当用windows phone访问Vs调试的网站项目的时候访问不了的缘由是Cassin(卡西尼) 服务器的时候只监听localhost

解决:可用IIS或者端口映射器(PortMap等),若是仍是不行,多是当前的端口被占用了。

 

  1. an unhandled exception has occurred . click here to reload

分析:个人是由于以前显卡缘由致使平白无故系统桌面异常。(这个是微软的说明:http://technet.microsoft.com/en-us/library/bb907398)

解决:重启vs就好,否则就重启电脑。

  1.  Error        1       Could not load the assembly file:///D:\heima\heima\heima\Windows Phone2\Windows Phone\PhoneApp3\Library\Newtonsoft.Json.dll. This assembly may have been downloaded from the Web.  If an assembly has been downloaded from the Web, it is flagged by Windows as being a Web file, even if it resides on the local computer. This may prevent it from being used in your project. You can change this designation by changing the file properties. Only unblock assemblies that you trust. See http://go.microsoft.com/fwlink/?LinkId=179545 for more information.        PhoneApp3

解析:文件安全问题 解决:文件右击属性:解决锁定。

 

  1.  Windows phone 页面平白无故退出。  分析:有地方出错,若是调试没有指定地方报错的话,多是引用dll有问题。
  2. Windows Phone在生成的时候错误:Xap packaging failed. Object reference not set to an instance of an.   分析:有多是项目引用的dll出错,也有多是哪一个文件的名称同名了(个人就是在不一样的文件夹下。可是同名了,这样会冲突)
  3.  An unknown error has occurred. Error: 80020006.

解析:windows phone作浏览器,本身在查询的页面手写一个javascriptfunction方法的时候,找不到javascript的function对象,不明。

  1.  Invalid JSON primitive: XXXXX .解析:

有多是你的json格式出错,也有多是下面的缘由。

If it is a valid json object like {'foo':'foovalue', 'bar':'barvalue'} then jQuery might not send it as json data but instead serialize it to foor=foovalue&bar=barvalue thus you get the error"Invalid JSON primitive: XXX

1默认支持的请求的类型必须是 HTTP POST

2请求的 content-type 必须是 application/json; charset=utf-8

3 ASP.NET AJAX script services and page methods  可以理解并接受的参数只能是JSON 的字符串。 这些字符串参数会在服务器自动json的反序列化成为对象,被用做调用方法的参数。例子以下:

  1. $.ajax({  
  2.     type: "POST",  
  3.     url: "WebService.asmx/WebMethodName",  
  4.     data: { 'fname': 'dave', 'lname': 'ward' },  
  5.     contentType: "application/json; charset=utf-8",  
  6.     dataType: "json"  
  7. });  

英文说http://stackoverflow.com/questions/2445874/messageinvalid-json-primitive-recordid

http://blog.csdn.net/cooleader320/article/details/7745488

怎么想向后台传多个数据:

解决:后台向json传的格式是

下面这些申明的是string 本身声明

var Json = "[{ 'ParentIDString': '0', 'DownloadtypeName': '" + yingyongwen + "', 'FileSize': '', 'DownUrl': '' }";

Json = Json + "," + "{ 'ParentIDString': '" + ReturnParentID + "', 'DownloadtypeName': '" + leixingming + "', 'FileSize': '', 'DownUrl': '' }]";

$.post("/GetDB/InSertDownChildRen", { jsonArray: Json }, function (data) {

                       var s = data;

                   });

 

  1. String or binary data would be truncated.
    The statement has been terminated.

解析:字符串太长,有多是你数据库的列的设置的过短。

  1. Maximum request length exceeded.

解析:以前请求加起来的长度超过最大值。

解决:在web.config的<System.Web>里面放上

<httpRuntime maxRequestLength="21400" enable="true" requestLengthDiskThreshold="512" useFullyQualifiedRedirectUrl="false" executionTimeout="45"/>

  1.  Could not load file or assembly 'XXX.Web.SQL.DAL' or one of its dependencies. 系统找不到指定的文件。
  2.  Login failed for user 'IIS APPPOOL\ASP.NET v4.0'.

 

 

  1.  
  2.  The process cannot access the file 'D:\json.txt' because it is being used by another process.

解决:建立文件若是不关闭会一直暂用着。File.Create("'D:\json.txt ").Close();

  1.  Error       1       Whitespace is not allowed after end of Markup Extension.

解析:TextBlock Tag="showWindowclick" Text="{Binding Title} " Grid.Column="1"></TextBlock>

在这个是事件绑定里面,”与{之间不能用空格。(window phone)

  1.   Event handler is invalid 项目中有地方报错影响到这个事件不能生成,解法看上题。
  2. NullReferenceException 解析:在window phone在链接到网页的时候报错了,缘由是是报错那个对象未实例化)
  3.  An unknown error has occurred. Error: 80020006.

解析:找不到javascript的function的方法

  1.  Winphone 在查找时候报错:Path cannot be absolute.   分析:你没有写是相对路径仍是绝对路径
  2. Windows phone在作删除某个页面的时候:KeyNotFoundException 说没找到,缘由是你在把要某个页面设置显示的页面的时候找不到对象,这说明集合中没有,多是你没有把页面的对象增长到集合里面或者集合的长度为0了。
  3.  Operation not permitted on IsolatedStorageFileStream.

解决:向独立存储中建立好一个文件以后,而后再次打开的时候报错,IsolatedStorageFile.GetUserStoreForApplication().CreateFile(返回的是IsolatedStorageFileStream

,而IsolatedStorageFile.GetUserStoreForApplication().OpenFile()时又会去建立另一个IsolatedStorageFileStream,而前者并无释放,由于就会出现出现这样的问题。索要要在建立以后把他close(),若是这个还报错的话,说明你以前操做那次没有把他关闭。)

 

  1.    no segments* file found in Lucene.Net.Store.SimpleFSDirectory@c:\1017index: files:

解析:在没有建立索引以前(索引库为空),你进行查询调用  IndexReader reader = IndexReader.Open(directory,true);因此会报报这个错。

  1. An unhandled exception of type 'System.StackOverflowException' occurred in Lucene.Net.DLL

解决:堆栈溢出。 说明你写的程序中说错(多是你程序写错,却是无线循环

BooleanQuery query = new BooleanQuery();

            query.Add(query, BooleanClause.Occur.SHOULD);  看到没有我把query添加到query里面。因此这样会循环下去。)

  1.  Trigger's name cannot be null 解析: Trigger传的对象为null或者是你重复使用同一个Trigger形成错误。
  2.  Violation of PRIMARY KEY constraint 'PK_T_SearchLogStastics'. Cannot insert

违反了PK约束,可能你要插入的表中已经有这个主键了。

  1. A transport-level error has occurred when receiving results from the server. (provider: Shared Memory Provider, error: 0 - 句柄无效。)

解析:在数据库并发的时候,其余一个在写,而另一个在读取的时候不能读取。建议操做步骤统一。(个人也不知道怎么解决。尽可能对表的操做步骤一致把?)

相关文章
相关标签/搜索