Click here to Skip to main content
15,896,606 members
Home / Discussions / Database
   

Database

 
AnswerRe: I want to diplay particular records between two dates using nvarchar [modified] Pin
Syed Mehroz Alam13-Nov-08 2:15
Syed Mehroz Alam13-Nov-08 2:15 
GeneralRe: I want to diplay particular records between two dates using nvarchar Pin
Samiullah13-Nov-08 23:44
Samiullah13-Nov-08 23:44 
AnswerRe: I want to diplay particular records between two dates using nvarchar Pin
Mycroft Holmes13-Nov-08 15:57
professionalMycroft Holmes13-Nov-08 15:57 
AnswerRe: I want to diplay particular records between two dates using nvarchar Pin
PIEBALDconsult13-Nov-08 16:04
mvePIEBALDconsult13-Nov-08 16:04 
QuestionDebugging null data adapter Pin
theFrenchHornet12-Nov-08 9:38
theFrenchHornet12-Nov-08 9:38 
AnswerRe: Debugging null data adapter Pin
Wendelius13-Nov-08 5:15
mentorWendelius13-Nov-08 5:15 
GeneralRe: Debugging null data adapter Pin
theFrenchHornet13-Nov-08 5:47
theFrenchHornet13-Nov-08 5:47 
GeneralRe: Debugging null data adapter Pin
Wendelius13-Nov-08 7:14
mentorWendelius13-Nov-08 7:14 
Okay,

Just for explanation: If the command would fail while in the database or connection gets lost for some reason, you end up in an error at the database. As a result of an error you would get an exception at calling side (in C# in this case). So, if you're not receiving any exceptions in your code, but the data adapter just suddenly goes to null, it's quite certain that the problem is in the code.

If you're using singleton or static class, perhaps one way to find out the problem is to define a property that returns your data adapter and keep the data adapter private in your class (if not already done so). Now in the property setter, first test if new value for the property is null and act based on that (throw an exception, write log etc). This could help you to isolate the cause.

Also you could double-check that you are not ignoring any exceptions anywhere. One reason could be that the statement actually fails in the database, but you don't get information about the exception (for example an empty catch block).

If you would end up in a deadlock you would get an exception in C# and have a message similar to:
"Transaction (Process ID 52) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction."

However, if you suspect that deadlock might occur, you can set trace flag 1204 in startup parameters. After restarting the SQL Server, deadlock info if is written into errorlog at server side if a deadlock occurs.

Hope this helps you forward,

Mika

The need to optimize rises from a bad design.

My articles[^]

GeneralRe: Debugging null data adapter Pin
theFrenchHornet15-Nov-08 9:21
theFrenchHornet15-Nov-08 9:21 
GeneralRe: Debugging null data adapter Pin
Wendelius15-Nov-08 9:59
mentorWendelius15-Nov-08 9:59 
AnswerRe: Debugging null data adapter Pin
PIEBALDconsult13-Nov-08 16:11
mvePIEBALDconsult13-Nov-08 16:11 
GeneralRe: Debugging null data adapter Pin
theFrenchHornet15-Nov-08 9:22
theFrenchHornet15-Nov-08 9:22 
QuestionSQL CE Exception Pin
hammerstein0512-Nov-08 4:01
hammerstein0512-Nov-08 4:01 
AnswerRe: SQL CE Exception Pin
Ennis Ray Lynch, Jr.13-Nov-08 4:39
Ennis Ray Lynch, Jr.13-Nov-08 4:39 
QuestionHow to get this nested level output Pin
VenkataRamana.Gali11-Nov-08 18:10
VenkataRamana.Gali11-Nov-08 18:10 
AnswerRe: How to get this nested level output Pin
ScottM111-Nov-08 19:42
ScottM111-Nov-08 19:42 
AnswerRe: How to get this nested level output Pin
Wendelius12-Nov-08 7:39
mentorWendelius12-Nov-08 7:39 
Questionenabling xp_cmdshell Pin
sunny7411-Nov-08 17:58
sunny7411-Nov-08 17:58 
AnswerRe: enabling xp_cmdshell Pin
ScottM111-Nov-08 19:39
ScottM111-Nov-08 19:39 
GeneralRe: enabling xp_cmdshell Pin
sunny7411-Nov-08 22:15
sunny7411-Nov-08 22:15 
GeneralRe: enabling xp_cmdshell Pin
ScottM111-Nov-08 22:31
ScottM111-Nov-08 22:31 
AnswerRe: enabling xp_cmdshell Pin
Tomb42113-Nov-08 4:01
Tomb42113-Nov-08 4:01 
QuestionHOW TO PRINT THIS PATTERN Pin
saikirankatighar11-Nov-08 1:09
saikirankatighar11-Nov-08 1:09 
AnswerRe: HOW TO PRINT THIS PATTERN Pin
Mycroft Holmes11-Nov-08 1:24
professionalMycroft Holmes11-Nov-08 1:24 
GeneralRe: HOW TO PRINT THIS PATTERN Pin
saikirankatighar11-Nov-08 1:33
saikirankatighar11-Nov-08 1:33 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.