| |

VerySource

 Forgot password?
 Register
Search
View: 549|Reply: 4

Help to see what is wrong ??

[Copy link]

2

Threads

8

Posts

7.00

Credits

Newbie

Rank: 1

Credits
7.00

 China

Post time: 2020-3-10 23:30:02
| Show all posts |Read mode
The error is "Unable to cast object of type 'System.Windows.Forms.BindingSource' to type 'System.Data.DataTable'."

How can I change it ...............
Reply

Use magic Report

0

Threads

24

Posts

20.00

Credits

Newbie

Rank: 1

Credits
20.00

 China

Post time: 2020-6-3 17:15:01
| Show all posts
'System.Windows.Forms.BindingSource' to type'System.Data.DataTable

Unable to convert System.Windows.Forms.BindingSource type to System.Data.DataTable type
Reply

Use magic Report

0

Threads

119

Posts

67.00

Credits

Newbie

Rank: 1

Credits
67.00

 China

Post time: 2020-6-3 22:00:01
| Show all posts
It should be something like BindingSource.DataTable!
Reply

Use magic Report

2

Threads

8

Posts

7.00

Credits

Newbie

Rank: 1

Credits
7.00

 China

 Author| Post time: 2020-6-4 12:45:01
| Show all posts
Then how do I write it?
Reply

Use magic Report

2

Threads

8

Posts

7.00

Credits

Newbie

Rank: 1

Credits
7.00

 China

 Author| Post time: 2020-6-4 23:15:01
| Show all posts
I used it first: Dim binds As BindingSource = New BindingSource
        Dim dt As DataTable = New DataTable
        Dim da As Odbc.OdbcDataAdapter
        Dim Conn As New Odbc.OdbcConnection
        Conn = Me.comm.DBopen()
        da = New Odbc.OdbcDataAdapter(sSelectCmd, Conn)
        da.Fill(dt)
        binds.DataSource = dt
        Me.DgViewReportCode.DataSource = binds
        Me.BindingNavReportCode.BindingSource = bind

Then used in another process
           Dim dt1 As DataTable = New DataTable()
             dt1 = Me.DgViewReportCode.DataSource'''Error reported here
                    IsPaste = False
                    dt1.AcceptChanges()
 The error is: "Cannot convert System.Windows.Forms.BindingSource type to System.Data.DataTable type"

Why did you report such a mistake... How should I change it?
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list