السلام عليكم ...
هذه هو كود جملة استعلامية من قاعدة البيانات يظهر فيه مشكلة السطر الاخير
فمن يجد السبب !!
Dim con As New OleDb.OleDbConnection()
Dim path = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + VB6.GetPath + "\database.mdb;Mode=Share Deny None;Persist Security Info=False"
con.ConnectionString = path
con.Open()
Dim sql As String
sql = "select * from student where name='" + Combo2.Text + "'"
Dim cmd As New OleDb.OleDbCommand(sql, con)
rd = cmd.ExecuteReader
Do While rd.Read
If rd.GetString(4).ToString = "x" Then MsgBox("hii")
Loopوهذا هو نص المشكلة
An unhandled exception of type 'System.InvalidCastException' occurred in system.data.dll
Additional information: Specified cast is not valid.
شكرا