Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

changing data source for data tables- need advice

Status
Not open for further replies.

treviboy

Programmer
Dec 18, 2006
70
US
hi,

I am moving my application from my PC where I have been developing my asp.net project. Before moving it all over to the server( code,etc), I decided to change the connection strings to the database on the server.

When I run my app, I get errors because my data source objects are still based on the local database.
I was going to go ahead and "configure data source" on my data objects and it says
"Reset templates Would you like to regenerate the DataList Itemtemplate and Datakeyfield using the selected data source schema? Warning:this will delete your existing item templates and key contents"....
I think I can do this and it should work, but not knowing for sure, I'm afraid to make it worse. SHould I do this or should I just add new datalist items based on the database on the server?
Thanks.
 
You should always write database code that references a connection string from the web.config file. That way, only that needs to be changed when you deploy your application.


____________________________________________________________
Mark,
[URL unfurl="true"]http://aspnetlibrary.com[/url]

Need help finding an answer? Try the Search Facility or read FAQ222-2244.
 
Thanks Mark. I was just starting to realize that I should modify my webconfig file to point to the correct database.
I'll read the link you sent. Thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top