Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 228247
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T19:39:58+00:00 2026-05-11T19:39:58+00:00

I have a sql query method using SQL data table adapters in .xsd file

  • 0

I have a sql query method using SQL data table adapters in .xsd file and need to be able to dynamically change the connection string to that method in the code behind. I can’t figure out how to access the methods properties from code behind.

method is IsValidDock(), simply checks database for a particular dock number and returns bool.

basically I am instantiating the query in my code behind by

Dim SQLCommands As New SQLDataTableAdapters.SQLCommands()

I thought I could get to the properties of the method by

SQLCommands.IsValidDock(). some properties. This is not working, any ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T19:39:58+00:00Added an answer on May 11, 2026 at 7:39 pm

    The better question, may be, though, why do you need to change this connection on the fly? Could you just change the definition and call it a day? Do you have multiple database servers that you are working against? The connection strings get stored in the configuration for the project, so if this is a situation where you need a different connection in your test and production environments, then you can just have two config files.

    Assuming that is not a solution, read on …

    If I remember correctly, the SqlDataTableAdapter objects spat out by the XSD parser in Visual Studio are sub-classes of SqlDataAdapter, are they not (you can find out in Visual Studio by right clicking on a reference to one and choosing “Go to definition”)? If so, you can just new up an instance of the generated class (there should be a generated .cs or .vb file for it in your project) and pass it a customized SqlConnection object.

    There is no interface for changing the connection of a data adapter after it has been created. The adapter opens the connection when you do anything that needs it (call Fill(), Insert(), etc.) and only closed when the SqlDataAdapter is disposed.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 163k
  • Answers 163k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Try using xargs, like this: svn st | grep ^!… May 12, 2026 at 12:15 pm
  • Editorial Team
    Editorial Team added an answer Caching, when it works right (==high hit rate), is one… May 12, 2026 at 12:15 pm
  • Editorial Team
    Editorial Team added an answer Stop the web server from the task bar, assuming you… May 12, 2026 at 12:15 pm

Related Questions

I have a database table structured like this (irrelevant fields omitted for brevity): rankings
I have a table called OffDays, where weekends and holiday dates are kept. I
I have a MySQL database containing these tables: sessions -------- sessionid (INT) [courseid (INT)]
I have a very simple table and I can happily query it using LINQ

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.