Click here to Skip to main content
15,918,109 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
hai all..

am having problem while accessing throgh LAN:
it is taking much time for executing command and returning error message like
Fatal error encountered during command execution
but some times it is executing perfectly.. here i need to fetch details of students whose attendance is not submitted am using MySqlDataAdapter to bind data to grid view
SQL
select
  sid
 ,stdname
 ,rollno
 ,concat(rollno,' ',stdname) as stdrollno
 ,division
 ,'1' as attendance
from studentdetails
where branch='ELECTRICAL &  ELECTRONICS ENGINEERING'
 and semester='3'
 and division='A'
 AND course='B.E.'
 AND sid NOT IN (
  SELECT s.sid FROM `attendance` a, studentdetails s
  WHERE a.sid=s.sid
   AND s.semester=a.semester
   AND s.branch='ELECTRICAL &  ELECTRONICS ENGINEERING'
   AND s.course='B.E.'
   and s.semester='3'
   and s.division='A'
   and date='2013-08-01'
   and a.period='1')
 order by rollno


please help me out
thanks in advance..
Posted
Updated 14-Sep-13 0:37am
v4

1 solution

i find myself..
what we need to do here is :
cause:
query is complex and it is taking much time to execute so some times it crosses the default time out and returning fatal error

solution:
we need to increase execution time of the query
so work around is set higher value for cmd.CommandTimeout that solves my problem
 
Share this answer
 
v2
Comments
duhoky 26-Feb-18 8:36am    
cmd.CommandTimeout =10
cmd.executenonquery()

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900