Dataset problem after database change (C# 2013 Winforms)

Hi Experts,
I am trying to move my C# Winforms project from Dev to Production.
The only difference is that the production database resides on a different server.
Database name, table names, etc. are identical.
I can connect to the database (normal connection string) and the login (normal connectionstring db query, works fine.
However, the forms that uses generated Dataset, Tableadapter, Bindingsource, etc. crashes a quite a long time and it is a timeout problem. See attachment for error.
I have changed the connectionstring to the new server(database) in App.config and Project properties.
What else should/could I do?
rgs
Capture.JPG
Zack SnydersAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Fernando SotoRetiredCommented:
Hi Zack;

Have you tried changing the connection timeout from the default to something a little higher? It may be that the server is being heavily used and has not yet responded to the request. This can be done by adding the following to the connection string, Connection Timeout=XX, where XX is the number of seconds. Please see Microsoft documentation for an example.
0
Zack SnydersAuthor Commented:
Hi Fernando,
Thank you, but as I have indicated, connecting directly to the database in code works fine. The problem is with the generated datasets.
example, when drag a datasource onto a winform, dataset, tableadapter and bindingsource is generated by Visual Studio.
All the forms that I have created in this manner now crashes on a timeout after I have changed the connection string in app.config to the new database.
What we can try is to increase the timeout but don't know where/how in this instance.
0
Fernando SotoRetiredCommented:
Sorry Zack;

Seeming that the exception is a SQL exception being thrown and that you are connecting to the server the time out in the exception message is that the operation is taking much longer then the default. I have used TableAdapters a long time ago once or twice and since then have always created my own to get better control. In order to extend the CommandTimeout property you will need to modify/add code to the generated code the tooling generated. This needs to be done in a new file you create extending the generated class, adding a partial class. Do not do it in the generated class because each time you make any changes to the generated code it will regenerate the complete class over writing your code. Here is an article on how to do this, it is in VB but the author does give info on doing it in C#. The article can be found [Here: Managing TableAdapter Timeouts].
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C#

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.