PDA

View Full Version : مشکل در خواندن از بانک



fateme_shourabi
سه شنبه 19 اردیبهشت 1385, 21:28 عصر
با سلام وخسته نباشید خدمت شما دوستان گرامی
من یه مشکل هنگام خوندن از بانک رو دارم که error رو هم نوشتم
ممنون می شم بهم کمک کنید
منتظر جواب های شما هستم
یاحق

Invalid attempt to read when no data is present.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: Invalid attempt to read when no data is present.

Source Error:


Line 95: Dim cmd4 As New SqlCommand("select * from room where code_room = '" & t1 & "'", cnn3)
Line 96: Dim reader1 As SqlDataReader = cmd4.ExecuteReader()
Line 97: Dim countc As Integer = reader1("count_room")
Line 98: Dim rez As Integer
Line 99: rez = reader1("rezerv")

hpx
سه شنبه 19 اردیبهشت 1385, 21:58 عصر
reader1.Read()
با این کار reader با command مربوطه initialize میشه