Click here to Skip to main content
15,671,149 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
If I use "using System.Data.SqlClient" in my project and run code with debug option. The project works fine, even then if I put break point to line "connection.Open();" or to line "int recordsAffected = command.ExecuteNonQuery();" and press F11.

But if I change it to "using Microsoft.Data.SqlClient;", the project works fine if I run it without break points in debug mode. But if I put break point to line "connection.Open();" or to line "int recordsAffected = command.ExecuteNonQuery();" and press F11,
I get following error message:

SqlConnections.cs not found
You need to find SqlConnection.cs to view the source for the current call stack frame
Try to following options:
-Browse and find SqlConnection.cs
-Decompile source code
Source search information:
Locating source for 'H:\tsaagent1\_work\46\s\src\Microsoft.Data.SqlClient\netfx\src\Microsoft\Data\SqlClient\SqlConnection.cs'. Checksum: SHA256 {3b 1 d5 3e 88 c8 6f 4a de 99 c3 eb e9 48 bf 75 99 a7 cf c c5 52 87 d3 8a ad 26 a5 a3 77 52 bd}
The file 'H:\tsaagent1\_work\46\s\src\Microsoft.Data.SqlClient\netfx\src\Microsoft\Data\SqlClient\SqlConnection.cs' does not exist.
Looking in script documents for 'H:\tsaagent1\_work\46\s\src\Microsoft.Data.SqlClient\netfx\src\Microsoft\Data\SqlClient\SqlConnection.cs'...
Looking in the projects for 'H:\tsaagent1\_work\46\s\src\Microsoft.Data.SqlClient\netfx\src\Microsoft\Data\SqlClient\SqlConnection.cs'.
The file was not found in a project.
Searching for documents embedded in the symbol file.
An embedded document was not found.
The debug source files settings for the active solution indicate that the debugger will not ask the user to find the file: H:\tsaagent1\_work\46\s\src\Microsoft.Data.SqlClient\netfx\src\Microsoft\Data\SqlClient\SqlConnection.cs.
The debugger could not locate the source file 'H:\tsaagent1\_work\46\s\src\Microsoft.Data.SqlClient\netfx\src\Microsoft\Data\SqlClient\SqlConnection.cs'.

What I have tried:

I have tried to solve this challenge without result.
Updated 10-May-21 8:33am
SeanChupas 10-May-21 8:51am    
So, leave it as System.Data.SqlClient, right?

1 solution

You're trying to "step into" (F11) "unmanaged" code; i.e. code that you didn't write.

The source is usually "not available"; people usually don't "step into" "unmanaged" code.

You're insisting you want to, and are confusing VS in the process (looking for the source; which you typically don't have ... for the parts you didn't write).
Share this answer

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