错误:预期的标识符 [英] ERROR : identifier expected

查看:100
本文介绍了错误:预期的标识符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用此代码进行数据视图但是它的错误请帮助我解决此错误发生在

I AM USING THIS CODE TO DATAGRID VIEW BUT ITS CUASES AN ERROR PLEASE HELP ME TO SOLVE THIS ERROR OCCURRED ON THIS

ivate Sub Btn_Show_Click(sender As Object, e As RoutedEventArgs)
        Dim conString As String = "Data Source=SHAHRUKH-PC\SQLEXPRESS;Initial Catalog=SOUL20DB;User ID=sa;Password=sa@1234"
        Dim conn As SqlConnection = New SqlConnection(conString)
        Dim adap As New SqlDataAdapter
        Dim sqlCmd As SqlCommand
        Dim sqlResult As Object
        Dim BibliDS As New DataSet
        Dim TitleDS As New DataSet

        Dim Table As New DataTable
        Dim directory As Directory = FSDirectory.GetDirectory("C:\Users\Shahrukh\Documents\Visual Studio 2012\Projects\Simple search1\Simple search1\New folder")
        Dim analyzer As Lucene.Net.Analysis.Analyzer = New SimpleAnalyzer()
        Dim parser = New QueryParser("Title", analyzer)

        parser.SetDefaultOperator(QueryParser.Operator.AND)
        Dim query As Lucene.Net.Search.Query = parser.Parse("Title:" & txtSearch.Text)
        Dim searcher = New IndexSearcher(directory)

        Dim hits As Hits = searcher.Search(query)
        Dim results As Integer = hits.Length
        Console.WriteLine("Found {0} results", results)

        For i As Integer = 0 To results - 1

            Dim doc As Document = hits.Doc(i)
            Dim score = hits.Score(i)
            adap.Fill(TitleDS)
            dGridResults.ItemsSource = TitleDS.tables[0];HERE ERROR COMES

推荐答案

语句中的语法看起来像C#但是您的代码是VB,请尝试以下

The syntax in the statement looks like C# but your code is VB, try the following
dGridResults.ItemsSource = TitleDS.Tables(0)


确保表格中有一个名为 dGridResults 的组件。
Make sure you have a component by the name dGridResults in the form.


这篇关于错误:预期的标识符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆