简体   繁体   English

没有可访问的“ New”接受此数目的参数

[英]No accessible 'New' accepts this number of arguments

Sub CreatePersonsIndex(ByVal dt As System.Data.DataTable)
        Try
            'Specify the index file location where the indexes are to be stored
            Dim indexFileLocation As String = "C:\Users\Shahrukh\Documents\visual studio 2012\Projects\WpfApplication33\WpfApplication33\App_Data"
            Dim dir As Lucene.Net.Store.Directory = Lucene.Net.Store.FSDirectory.GetDirectory(indexFileLocation, True)
            Dim indexWriter As New IndexWriter(dir, New StandardAnalyzer(), True)
            indexWriter.SetRAMBufferSizeMB(10.0)
            indexWriter.SetUseCompoundFile(False)
            indexWriter.SetMaxMergeDocs(10000)
            indexWriter.SetMergeFactor(100)

            If dt IsNot Nothing Then
                If dt.Rows.Count > 0 Then
                    For Each dr As System.Data.DataRow In dt.Rows
                        'Create the Document object
                        Dim doc As New Document()
                        For Each dc As System.Data.DataColumn In dt.Columns
                            'Populate the document with the column name and value from our query
                            doc.Add(New Field(dc.ColumnName, dr(dc.ColumnName).ToString(), Field.Store.YES, Field.Index.TOKENIZED))
                        Next
                        ' Write the Document to the catalog
                        indexWriter.AddDocument(doc)
                    Next
                End If
            End If
            ' Close the writer
            indexWriter.Close()
        Catch ex As Exception
            MsgBox("Error")
        End Try

    End Sub

using this code got an error 使用此代码出现错误

" No accessible 'New' accepts this number of arguments." “没有可访问的'New'接受此数目的参数。”

help me to solve this 帮我解决这个问题

这可能对您有用:

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 没有可访问的'New'接受这个数量的参数 - 错误 - No accessible 'New' accepts this number of arguments - Error 重载解析失败,因为没有可访问的“新”接受此数目的参数 - overload resolution failed because no accessible 'new' accepts this number of arguments 尝试将stringbuilder文本写入批处理文件时,“由于没有可访问的'New'接受此数目的参数,所以过载解析失败” - “Overload resolution failed because no accessible 'New' accepts this number of arguments” when trying to write stringbuilder text into a batch file VBNET重载,因为没有可访问的“ int”接受数字参数 - VBNET Overload because no accessible 'int' accepts number arguments 重载解析失败,因为没有可访问的“ ExecuteScalar”接受此数量的参数 - Overload resolution failed because no accessible 'ExecuteScalar' accepts this number of arguments 重载解析失败,因为没有可访问的'writealltext'接受此数量的参数 - overload resolution failed because no accessible 'writealltext' accepts this number of arguments 重载解析失败,因为没有可访问的“参数”接受此数量的 arguments - Overload resolution failed because no accessible 'Parameters' accepts this number of arguments VB.NET MVC重载解析失败,因为没有可访问的“创建”接受此数量的参数 - VB.NET MVC Overload resolution failed because no accessible 'Create' accepts this number of arguments 重载解析失败,因为对于这些参数,没有可访问的“新”是最具体的 - Overload resolution failed because no accessible 'new' is most specific for these arguments 重载解析失败,因为没有可访问的“新”是这些参数最具体的: - Overload resolution failed because no accessible 'New' is most specific for these arguments:
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM