English 中文(简体)
how to use windbg find out SqlConnection.ConnectionString?
原标题:
  • 时间:2009-11-28 02:34:59
  •  标签:
  • windbg
  • sos

I can use "!do" to dump the SqlConnection instance but not sure how to find out its ConnectionString:

0:018> !do 2fa7730
Name: System.Data.SqlClient.SqlConnection
MethodTable: 000007fef4455968
EEClass: 000007fef42b6530
Size: 104(0x68) bytes
 (C:WindowsassemblyGAC_64System.Data2.0.0.0__b77a5c561934e089System.Data.dll)
Fields:
              MT    Field   Offset                 Type VT     Attr            Value Name
000007fef80ee580  400018a        8        System.Object  0 instance 0000000000000000 __identity
000007fef7558ff0  40008cc       10 ...ponentModel.ISite  0 instance 0000000000000000 site
000007fef75888d8  40008cd       18 ....EventHandlerList  0 instance 0000000000000000 events
000007fef80ee580  40008cb      210        System.Object  0   static 0000000002769b58 EventDisposed
000007fef4966d98  4000be5       20 ...hangeEventHandler  0 instance 0000000000000000 _stateChangeEventHandler
000007fef49789e0  400172c       28 ...t.SqlDebugContext  0 instance 0000000000000000 _sdc
000007fef80ede60  400172d       58       System.Boolean  1 instance                0 _AsycCommandInProgress
000007fef445c100  400172e       30 ...ent.SqlStatistics  0 instance 0000000000000000 _statistics
000007fef80ede60  400172f       59       System.Boolean  1 instance                0 _collectstats
000007fef80ede60  4001730       5a       System.Boolean  1 instance                0 _fireInfoMessageEventOnUserErrors
000007fef4459458  4001733       38 ...ConnectionOptions  0 instance 0000000002fa7798 _userConnectionOptions
000007fef4458b68  4001734       40 ...nnectionPoolGroup  0 instance 0000000002fa7b28 _poolGroup
000007fef44596a0  4001735       48 ...onnectionInternal  0 instance 0000000002fa9130 _innerConnection
000007fef80f5f00  4001736       50         System.Int32  1 instance                0 _closeCount
000007fef80f5f00  4001738       54         System.Int32  1 instance             8863 ObjectID
000007fef80ee580  400172b      f30        System.Object  0   static 00000000027885a8 EventInfoMessage
000007fef4458860  4001731      f38 ...ConnectionFactory  0   static 00000000027885c0 _connectionFactory
000007fef80f5658  4001732      f40 ...eAccessPermission  0   static 000000000278f910 ExecutePermission
000007fef80f5f00  4001737      9c0         System.Int32  1   static            16803 _objectTypeCount
最佳回答

try visual studio 2008 debuger, debug a program which uses SqlConnection;

find the SqlConnection instance in your favorate way (it could be local var, or instance fields, or static fields..).

view it in the Watch window. expand it s every expandable child nodes, untill you find what you want(as I can remember it stores parts like server, database, userid, password and so on seperately ).

record the path to how you navigate to these fields, then use windbg to go to the same field.

问题回答

暂无回答




相关问题
Process memory increases much faster with gflags +ust

I ve got stuck in a problem with gflags when trying to find some memory leaks in a windows app. When I turn on the ust flag (in order to collect memory allocations stack traces) the memory of my ...

how to use windbg find out SqlConnection.ConnectionString?

I can use "!do" to dump the SqlConnection instance but not sure how to find out its ConnectionString: 0:018> !do 2fa7730 Name: System.Data.SqlClient.SqlConnection MethodTable: 000007fef4455968 ...

WinDbg .for loop

I am having trouble getting the WinDbg .for command to work. I would like to dump an array of c++ structs. ?? gpTranData->mpApplCodes[0] works for a single entry but I would like to loop through ...

What does "Eclipsed" mean in WinDbg?

In the "Locals" window of WinDbg there are several names with the value <Eclipsed>. In some cases the same name exists multiple times which one real value and the others are shown as <...

Tips for debugging a made-for-linux application on windows?

I m trying to find the source of a bug I have found in an open-source application. I have managed to get a build up and running on my Windows machine, but I m having trouble finding the spot in the ...

热门标签