important
that you take a rigorous approach to handling cross-thread interactions from
within your applications. For example, you must not interact with a form's
contents from within your callback procedure; should you have to update the
form, you must switch back to the form's thread in order to do your work. The
example in this topic demonstrates this behavior.

All errors that occur during the execution of the operation are thrown as
exceptions in the callback procedure. You must handle the exception in the
callback procedure, not in the main application. See the example in this topic
for additional information on handling exceptions in the callback procedure.

This method ignores the [ CommandTimeout
](system.data.sqlclient.sqlcommand.commandtimeout?view=dotnet-plat-ext-8.0)
property.

###  See also

  * [ Connecting and Retrieving Data in ADO.NET ](/en-us/dotnet/framework/data/adonet/retrieving-and-modifying-data)
  * [ Using the .NET Framework Data Provider for SQL Server ](/en-us/dotnet/framework/data/adonet/sql/)
  * [ ADO.NET Overview ](/en-us/dotnet/framework/data/adonet/ado-net-overview)

###  Applies to

Collaborate with us on GitHub

The source for this content can be found on GitHub, where you can also create
and review issues and pull requests. For more information, see [ our
contributor guide ](https://learn.microsoft.com/contribute/content/dotnet/api-
documentation) .

![](https://learn.microsoft.com/media/logos/logo_net.svg)
![](https://learn.microsoft.com/media/logos/logo_net.svg)

.NET

[ Open a documentation issue  ]() [ Provide product feedback
](https://aka.ms/feedback/report?space=61)

##  Feedback

Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the
feedback mechanism for content and replacing it with a new feedback system.
For more information see: [ https://aka.ms/ContentUserFeedback
](https://aka.ms/ContentUserFeedback) .

Submit and view feedback for

[ This product  ](https://aka.ms/feedback/report?space=61) This page

[ View all page feedback  ](https://github.com/dotnet/dotnet-api-docs/issues)

[ California Consumer Privacy Act (CCPA) Opt-Out Icon  Your Privacy Choices
](https://aka.ms/yourcaliforniaprivacychoices)

Theme

  * Light 
  * Dark 
  * High contrast 

  *   * [ Previous Versions ](/en-us/previous-versions/)
  * [ Blog ](https://techcommunity.microsoft.com/t5/microsoft-learn-blog/bg-p/MicrosoftLearnBlog)
  * [ Contribute ](/en-us/contribute/)
  * [ Privacy ](https://go.microsoft.com/fwlink/?LinkId=521839)
  * [ Terms of Use ](/en-us/legal/termsofuse)
  * [ Trademarks ](https://www.microsoft.com/legal/intellectualproperty/Trademarks/)
  * © Microsoft 2024 

##  Additional resources

###  In this article

[ California Consumer Privacy Act (CCPA) Opt-Out Icon  Your Privacy Choices
](https://aka.ms/yourcaliforniaprivacychoices)

Theme

  * Light 
  * Dark 
  * High contrast 

  *   * [ Previous Versions ](/en-us/previous-versions/)
  * [ Blog ](https://techcommunity.microsoft.com/t5/microsoft-learn-blog/bg-p/MicrosoftLearnBlog)
  * [ Contribute ](/en-us/contribute/)
  * [ Privacy ](https://go.microsoft.com/fwlink/?LinkId=521839)
  * [ Terms of Use ](/en-us/legal/termsofuse)
  * [ Trademarks ](https://www.microsoft.com/legal/intellectualproperty/Trademarks/)
  * © Microsoft 2024