小编Imi*_*xha的帖子

无法加载文件或程序集''或其依赖项之一

有什么帮助吗?

我只有一个图书馆,这让我发疯.这是我收到的错误.我没有使用任何其他依赖.

Could not load file or assembly 'FOD.Intranet.Lib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=039c1f3a4c719e82' or one of its dependencies. The system cannot find the file specified. 

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.IO.FileNotFoundException: Could not load file or assembly 'FOD.Intranet.Lib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=039c1f3a4c719e82' or one of its dependencies. The system cannot find the file specified. …
Run Code Online (Sandbox Code Playgroud)

c# asp.net sharepoint sharepoint-2010

17
推荐指数
2
解决办法
10万
查看次数

无法启用此约束,因为并非所有值都具有相应的父值

我在数据集中有三个嵌套表.我根据语言ID显示数据,即:EN为1 FR为2,NL为3.数据库中存在法语和英语,但荷兰语尚不存在,当用户选择NL时,我收到以下错误:

无法启用此约束,因为并非所有值都具有相应的父值.

下面是我用来获取数据的代码.当我尝试在数据集中创建关系时发生错误.

 (ds.Relations.Add(new DataRelation("Cat_SubCat", dk1, dk2));
Run Code Online (Sandbox Code Playgroud)

现在我的问题是,如何使用下面给定的代码检查数据集或数据库中是否存在该值?

 public static DataTable GetData(Int32 languageID)
    {
        DataSet ds = new DataSet();

        string commandText = @"SELECT * FROM AlacarteCat where languageID = @ID;
                               SELECT * FROM AlacarteSubCat where languageID = @ID;
                               SELECT * from AlacarteItems where languageID = @ID";

        using (SqlConnection myConnection = new SqlConnection(Common.GetConnectionString("SQLConnectionString")))
        {
           SqlCommand command = new SqlCommand(commandText, myConnection);
            command.Parameters.Add("@ID", SqlDbType.Int);
            command.Parameters["@ID"].Value = languageID;

            SqlDataAdapter da = new SqlDataAdapter();
            da.SelectCommand = command;
            da.TableMappings.Add("AlacarteCat", "AlacarteCat"); // table 0
            da.TableMappings.Add("AlacarteSubCat", "AlacarteSubCat"); …
Run Code Online (Sandbox Code Playgroud)

c# sql asp.net ado.net dataset

6
推荐指数
1
解决办法
2万
查看次数

为sharepoint项目创建一个类库

我试图将我的sharepoint代码放在外部库中.一旦我在我的项目中引用了dll,当我进行部署时,我收到一条错误消息,指出无法加载文件或程序集.任何人都可以告诉我在创建类库时应该怎么做?我必须包含哪些参考资料?

谢谢您的帮助.

c# sharepoint

5
推荐指数
2
解决办法
2934
查看次数

visual studio不会将程序集复制到gac中

我有一个类库和一个sharepoint项目.我在sharepoint项目中添加了对类库的引用,当我单击部署时,我没有在gac中看到类库程序集.我认为这不正常.请问我能告诉我如何在不诉诸手动部署的情况下解决这个问题?谢谢.

c# sharepoint gac visual-studio-2010 sharepoint-2010

2
推荐指数
1
解决办法
1557
查看次数

更改共享点中是/否字段的值

我的共享点列表中有一个是/否(复选框)类型的字段。我试图以编程方式(服务器代码)更改/设置字段的值,但是它给我一个错误,提示它应为1或0。我无法使其正常工作。谁能帮我吗?

这部分代码:

 SPListItem item = reportList.Items.Add();
                item["RequesterID"] = id;

                 **item["ZIP_x0020_Code_x0020_Linked"] = 0;**

                item["ZC_x0020_code"] = txtZcCode.Text;
                item.Update();
Run Code Online (Sandbox Code Playgroud)

sharepoint-2010

2
推荐指数
1
解决办法
2万
查看次数

将字符串转换为datetime问题

我一直在网上寻找一个例子来解决我的问题,将字符串转换为datetime.

我想将en-us(mm/dd/yyyy)转换为荷兰比利时(dd/mm/yyyy)日期时间.能告诉我一个有效的例子吗?

为了您的信息,我尝试了Convert.ToDateTime,Parse,TryParse,ParseExact等,但没有一个工作.我真的很喜欢这个转换的例子,没有任何徒劳的链接.


Upate

我得到的错误是:字符串未被识别为有效的DateTime.我尝试过的:

----------------
string str = "02/20/2012";
DateTime dt = Convert.ToDateTime(str);
---------------------
IFormatProvider theCultureInfo = new System.Globalization.CultureInfo("nl-BE", true);
DateTime theDateTime = DateTime.ParseExact(deliveryDate, "dd/mm/yyyy", theCultureInfo);
Console.WriteLine(dt);
----------------------
var parsed = DateTime.ParseExact("02/20/2012","dd/mm/yyyy", null);
---------------

dateValue = DateTime.Parse(dateString, new CultureInfo("nl-BE", false));
Run Code Online (Sandbox Code Playgroud)

和其他一些我现在不记得的例子.但所有领导都没有.

c#

-1
推荐指数
1
解决办法
2万
查看次数