hello all,
kindly help me for this
i have one form with datagridview in vb.net and 5 textbox
for filing GDV i am using code:

Dim a As String = txttable.Text
        DataAdapter1 = New OleDbDataAdapter("Select * From " & txttable.Text & " where [pay_year] = '" & cmbSyear.Text & "' AND" _
                                            & "[pay_month] = '" & cmbSmonth.Text & "' ORDER BY payID", Con)
        DataAdapter1.Fill(DataSet2, "" & txttable.Text & "")
        DGVspandey.DataSource = DataSet2
        DGVspandey.DataMember = "" & txttable.Text & ""

after that databinding with this:

lblgrossS.DataBindings.Add("Text", DataSet2, ("'" & txttable.Text & "'")(CInt(".grand_total "))).ToString()

but getting error
Conversion from string ".grand_total " to type 'Integer' is not valid.

kindly help me for this
thanks in advence

You are trying to cast the string ".grand_total " to an integer. It can't be done.

Well, CInt with a string is not possible. Try CChar(), or replace ".grand_total " with some Int value.

no its not working
i change it to:
lblgrossS.DataBindings.Add("Text", DataSet2, ("'" & txttable.Text & "'")(AscW(CChar(".grand_total "))).ToString())
but geetting error:- Index was outside the bounds of the array.
please help me for this
thanks for respond

Same problem except this time you are trying to convert a string to a char. Perhaps you could explain what you are trying to accomplish with

lblgrossS.DataBindings.Add("Text", DataSet2, ("'" & txttable.Text & "'")(CInt(".grand_total "))).ToString()

thanks for response
i solved it and showing code here if some one want to use it:

Dim Connection As New OleDb.OleDbConnection(CnString)
        Dim ds As New DataSet
        Dim sql As String = "Select * From " & txttable.Text & " where [pay_year] = '" & cmbSyear.Text & "' AND" _
                                            & "[pay_month] = '" & cmbSmonth.Text & "' ORDER BY payID"
        Dim da As OleDbDataAdapter = New OleDbDataAdapter(sql, Connection)
            da.Fill(ds, "'" & txttable.Text & "'")
        End Try
        '''''''''''data binding clear'''''''''''''''''''
        '''''''''''''connect data binding'''''''''''''''''''''
        Me.lblgrossS.DataBindings.Add("Text", ds.Tables(0), "grand_total")
        Me.lbldeduction.DataBindings.Add("Text", ds.Tables(0), "total_deduction")
        Me.lblnetpay.DataBindings.Add("Text", ds.Tables(0), "amount_pay")
        Me.lblbasicpay.DataBindings.Add("Text", ds.Tables(0), "basic_pay")
        Me.lblDA.DataBindings.Add("Text", ds.Tables(0), "calculated_DA")