View Full Version : database help
COMPCAD
03-09-2011, 11:11 PM
I have created an application using Visual Web Developer 2010 and I also have a database connected to this application and I also have the application connected to my website it works fine but does not notice the database how do I get the database connected to my application so it will work within the website. I have included my web address which is:
MULTLAWLIB.ORG it is best viewed in Internet Explorer. I have also included some .GIF images that will help navigate you to the application and also help you create the error that I seem to be getting when I run the application from within my website.
wisemx
03-10-2011, 05:00 AM
...Is it a SQL Express DB?
COMPCAD
03-10-2011, 09:18 AM
Yes. I am not sure because when I was migrating to SQL I ended up going from SQL 2005, 2008 Express, SQL 2008 R2. When I open SQL Server Management Studio I see it there.
wisemx
03-10-2011, 10:52 AM
If it is a SQL Express DB the way you can use it is the Attach DB feature in the Control Panel for your site. To do that however you need to add a SQL Server to your account.
I've already created a step-by-step Webcast for doing that if you're interested.
COMPCAD
03-10-2011, 11:33 AM
Yes I am very interested. Thank You
Tasslehoff
03-10-2011, 11:36 AM
COMPCAD,
I can't reproduce the error. When I click on Catalog, then Text, the next page loads into the left frame. The GIF files are also too small so I can't see the error you're getting.
COMPCAD
03-10-2011, 12:17 PM
here are the images enlarged. I am unable to send an enlarged copy of the first two pages you should be able to use the smaller pages. You will need to use Internet Explorer to get website to work correctly
Tasslehoff
03-10-2011, 12:50 PM
Thanks COMPCAD. Could you provide the connection string you're using? Please don't share your username/password. You can block it out with asterisks '*'. Please also make sure you add this line to your web.config file:
<remove name="LocalSqlServer" />
before the add name section.
COMPCAD
03-10-2011, 07:53 PM
Here is the web config file that came from my application.
Tasslehoff
03-11-2011, 10:00 AM
COMPCAD,
Your web.config should look more like this:
<connectionStrings>
<remove name="LocalSqlServer" />
<add name="cat181ConnectionString1" connectionString="*****"
providerName="System.Data.SqlClient" />
</connectionStrings>
Replace the "*****" with the connection string found in your Control Panel:
https://my.discountasp.net/mssql.aspx
COMPCAD
03-20-2011, 10:38 PM
Hi
Its been awhile since I could try the ideas you gave to me last week I am still having problems. I have included my revised WEBCONFIG.
<?xml version="1.0"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=169433
-->
<configuration>
<connectionStrings>
<remove name="LocalSqlServer" />
<add name="cat181ConnectionString1" connectionString="Data Source=tcp:sql2k804.discountasp.net;Initial Catalog=SQL2008R2_219471_libdatabase;User ID=SQL2008R2_219471_libdatabase_user; "
providerName="System.Data.SqlClient" />
</connectionStrings>
<system.web>
<compilation debug="true" strict="false" explicit="true" targetFramework="4.0" />
</system.web>
</configuration>
I have included my web addresshttp://multlawlib.org
the steps to get to the error:
1 click on catalog
2 click on text
3 click the radio button called title
4 type TAX in the textbox and click on Search
5 you will then get the error I am getting
wisemx
03-21-2011, 06:00 AM
Try it like this, make sure you replace the Password but leave the rest:
<connectionStrings>
<clear/>
<remove name="LocalSqlServer" />
<add name="LocalSqlServer" connectionString="Data Source=tcp:sql2k512.discountasp.net;Initial Catalog=SQL2008R2_219471_libdatabase;User ID=SQL2008R2_219471_libdatabase_user;Password=Your PW" providerName="System.Data.SqlClient"/>
<add name="cat181ConnectionString1" connectionString="Data Source=tcp:sql2k804.discountasp.net;Initial Catalog=SQL2008R2_219471_libdatabase;Persist Security Info=True;User ID=SQL2008R2_219471_libdatabase_user;Password=Tsal agi01" providerName="System.Data.SqlClient"/>
</connectionStrings>
COMPCAD
03-21-2011, 09:38 PM
Hi
I tried your code and I am still getting error messages below is the code I put into my WEBCONFIG.
<?xml version="1.0"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=169433
-->
<configuration>
<connectionStrings>
<clear/>
<remove name="LocalSqlServer" />
<add name="LocalSqlServer" connectionString="Data Source=tcp:sql2k512.discountasp.net;Initial Catalog=SQL2008R2_219471_libdatabase;User ID=SQL2008R2_219471_libdatabase_user;" providerName="System.Data.SqlClient"/>
<add name="cat181ConnectionString1" connectionString="Data Source=tcp:sql2k804.discountasp.net;Initial Catalog=SQL2008R2_219471_libdatabase;Persist Security Info=True;User ID=SQL2008R2_219471_libdatabase_user;" providerName="System.Data.SqlClient"/>
</connectionStrings>
<system.web>
<compilation debug="true" strict="false" explicit="true" targetFramework="4.0" />
</system.web>
</configuration>
I have included my web address http://multlawlib.org
the steps to get to the error:
1 click on catalog
2 click on text
3 click the radio button called title
4 type TAX in the textbox and click on Search
5 you will then get the error I am getting
wisemx
03-22-2011, 05:21 AM
...Are you the one that sent me Emails yesterday?
I'm willing to provide hands-on help with this.
My guess is, if what I posted isn't working, that you are using a minimalist web.config
Which IDE are you using btw, VS2010?
COMPCAD
03-22-2011, 09:33 AM
Hi
I did not email you yesterday but I did send a message via the forum.
I am using Visual Web Developer 2010.
Stephen
Tasslehoff
03-22-2011, 12:08 PM
Stephen,
You forgot to include your password in the connection string.
COMPCAD
03-22-2011, 02:25 PM
Hi
How do I find out what the password is because I never set one up on my MSSQL DATABASE that runs my asp application nor the SQL DATABASE I purchased from DISCOUNTASP.NET.
Stephen
It's the same as your Control Panel login password.
COMPCAD
03-22-2011, 07:16 PM
Hi
I tried using the password I use to log into the DISCOUNTASP.NET control panel and it came up with the error I attached to this reply and I also attached the code from my WEBCONFIG.
<?xml version="1.0"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=169433
-->
<configuration>
<connectionStrings>
<clear/>
<remove name="LocalSqlServer" />
<add name="LocalSqlServer" connectionString="Data Source=tcp:sql2k512.discountasp.net;Initial Catalog=SQL2008R2_219471_libdatabase;User ID=SQL2008R2_219471_libdatabase_user;Password=1Z18 90" providerName="System.Data.SqlClient"/>
<add name="cat181ConnectionString1" connectionString="Data Source=tcp:sql2k804.discountasp.net;Initial Catalog=SQL2008R2_219471_libdatabase;Persist Security Info=True;User ID=SQL2008R2_219471_libdatabase_user;Password=1Z18 90" providerName="System.Data.SqlClient"/>
</connectionStrings>
<system.web>
<compilation debug="true" strict="false" explicit="true" targetFramework="4.0" />
</system.web>
</configuration>
wisemx
03-23-2011, 05:02 AM
...If you want me to fix it for you I'll need your DASP Control Panel login info.
Don't be concerned, I've done this for many customers for years now.
If that will work for you send me a PM with the long and I'll take a look.
COMPCAD
03-23-2011, 09:10 AM
Hi
I would love for you to look at it the only thing is I do not understand what you are talking about hear. Could you please rephrase what you are requesting here: If that will work for you send me a PM with the long and I'll take a look.
You are requesting the User Name and Password for DISCOUNTASP.NET control panel should I email it to you.
wisemx
03-23-2011, 10:10 AM
...Correct. I just need that to log in and be able to access your site and fix the web.config then no need to worry once it's working I do not keep any info at all, no need to change the password or anything. The DASP Staff trusts me and this is what I do for free.
I did get your PM and I'll try to look into that a little later today, have to run to the hardware store right now for some plumbing parts, again. This old house haunts me.
UPDATE: Currently under Tornado watch, Sever storms (Tennessee)...Have to shutdown everything for the evening.
I'll do my best to get with this very soon.
wisemx
03-24-2011, 04:27 PM
UPDATE: Thursday 24 March
I went in and added the correct changes for both of the web.config's on your site.
The one in the root of the site and the one in Catalogs both connect to your SQL Server now.
You have a new error, object CARD_CATALOG can't be found.
I can see by the code on the site that you are learning/experimenting.
If you need help with that next part post here in the forums, we do our best to help.
All the best,
Mark
COMPCAD
03-24-2011, 09:29 PM
Hi
I would love to have your help on the next step.
Stephen
wisemx
03-25-2011, 05:16 AM
...Roger that. It will take me more time but I'll look into it.
There may not be anything I'm able to do however as the object may actually be missing on the DASP SQL Server. If it is I won't be able to know for sure but I'll try and make a good guess anyway. ;-)
wisemx
03-26-2011, 07:18 AM
OK...I just went back into your site and looked around to see what might be causing the error.
You don't even have App_Code or App_Data folders on the site.
Mind if I suggest you watch a few of the videos on the ASP.NET site?
There really isn't much use to helping with this until you get a better handle on it.
(I don't want that to sound insensitive.)
Start here > http://www.asp.net/web-forms
COMPCAD
03-28-2011, 10:08 AM
Hi
Thank you for those videos I put them in my favorites and have started watching them. I had created an earlier version of the application it was created with MS ACCESS 2003 and I also installed the APP_DATA folder and had my database put into it and I had published it onto my website several years ago without a problem. I then upgraded to MS ACCESS 2007 and found that ACCESS 2007 can not be used so I migrated to IIS 7 and then I migrated my database to SQL. I then recreated the application and I could not figure out how to bring my SQL database over to the upgraded application so I left the APP_DATA folder off the application and I went to WEBAPPLICATION2 and thought I found someway to publish the application and have the database follow. Your help has been very helpful.
Stephen
wisemx
03-28-2011, 12:10 PM
...Awesome. ;-)
COMPCAD
03-28-2011, 06:37 PM
Hi
I was wondering if you were able to take a look at the info I just sent such as the the .PDF file. I need to get the SQL Database from SQL Server Management Studio into my APP-DATA folder within my application within Visual Web Devloper 2010. I do not know how to go about doing that. If you need more info I can send. Thanks for all the help you have give to me so far.
Stephen
wisemx
03-29-2011, 04:21 AM
...Just took a look.
When you create locally with any Visual Studio IDE and it creates/uses a SQL Express DB you need to use the Attach feature in your DASP control panel.
It's a two step procedure when you create ASP.NET DBO's in your site that make reference to the actual Database records.
Something to keep in mind is the Attach feature will wipe out your existing DASP SDL Server records.
This is rather confusing at first but once you get used to it you will most likely stop using SQL Express on your local system.
You can work with your local files and have your Data server be your actual remote DASP SQL Server, which eliminates all these middle steps.
You can also use Data pump features withing a local copy of SQL Server but that is problematic and requires you to run once locally then pump your changes to the remote.
There's a lot to learn, don't get frustrated. ;-)
COMPCAD
03-29-2011, 10:17 PM
Hi
Could you look at this .PDF file I have looked at several things and unsure of how to get database into my Application.
Stephen
wisemx
03-30-2011, 05:22 AM
...Your database objects need to be in your DASP SQL Server.
You can place Access databases in your App_Data folder.
Your App_Code folder is used for Data Sets that are used by your ASP.NET forms for SQL Server.
Any SQL Server records need to be pumped or attached via the feature in your Control Panel.
COMPCAD
03-31-2011, 11:27 AM
Hi
I have finally found the .MDF file on my computer it was barried within so many folders. I have tried using the windows search to find this folder and came up with no results. I found the file by going SQL Management Studio and found a way to dig deep into the folders and here is the address for the file:
C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\CAT181.MDF
As I went to this file I came up with an error. Please look at the .PDF within the .zip folder for this error.
Could you look at the second .PDF within the same .zip folder for me it is showing an ERROR message in red.
Stephen
wisemx
03-31-2011, 12:12 PM
...Please watch this Webcast I created which shows how to work with MDF files on DASP Servers.
http://www.dasptv.com/avc-view.aspx?videoid=30&categoryid=1
COMPCAD
04-02-2011, 11:49 PM
Hi Mark
I think I finally was able to convert my MS ACCESS 2007 database to MS SQL and I was able to finally locate the .MDF file and I then was able to create a APP_DATA folder and installed my .MDF file into it and I named it STEVE.MDF.
I then was able to to run the Application without errors and then I was able to publish the Application without errors. The next step I did was to attach the database to control panel in the DISCOUNTASP.NET it was attached ok and then I tried to run the Application on my WEBSITE and I am still getting an error could you take a look at it, you will be able to view it within the zip folder that I have attached.
Stephen
wisemx
04-03-2011, 05:36 AM
...Hard to say for sure but while the error looks like the SQL Server conn is not correct I'm guessing you got a handle on that and the problem is that an actual Data Set is missing.
COMPCAD
04-03-2011, 11:58 PM
Hi Mark
I had contacted Discountasp.net trying to see what help they could give me and they told me to read this article KB:
Do you support MS SQL 2005 Express database on DiscountASP.NET servers?SQL Express is designed for desktop database development purposes and is not suitable for a shared hosting environment due to security and performance issues. Microsoft actually recommends disabling this service on shared hosting platforms. However, you can use the SQL 2005 Attach tool in control panel to attach a SQL Express database to our SQL 2005 database.
Folder: Databases > MS SQL 2005
Modified 3/15/2011 / 91% Relevant
Is that what I am using. Is that what SQL Server Management Studio is and if so how do I fix it.
Stephen
wisemx
04-04-2011, 04:34 AM
...You watched my Webcast right?
And you are still using the Conn string I created for you right?
Thing is, you have to use the Attach tool to bring any SQL Express DB into your site.
Be aware however that each time you do that it resets your DASP SQL Server DB.
You want to use the Express DB Attach feature once, from then on you need to work with your remote DASP SQL Server.
COMPCAD
04-04-2011, 10:06 AM
Hi Mark
As far as I know I am because I had to rewrite part of the code because I was getting errors when I tried to publish my application. I found that I had alot of corrupt config strings within the web config and the data gridview. After I got it working agian I remembered about the connectionstring you told me about I hope I put it in correctly it seems to run ok with it except for the output. I have watched that video several times there is just so much to remember.
COMPCAD
04-04-2011, 11:50 AM
I was wondering if you could recheck my code and make sure things are ok.
THANK YOU
Stephen
wisemx
04-04-2011, 04:39 PM
...Went in just now and took a look at your changes.
In the web.config for your Catalog app you are using "steveConnectionString2", which references a SQL Express DB.
Your DASP SQL Server conn string is "steveConnectionString", which is still the way I left it but your app doesn't use it.
The SQL Sever Express files are not supported on DASP servers.
Remember what you can do to prevent this is use your remote DASP SQL Server from your local project as the data source.
All the best,
Mark
COMPCAD
04-04-2011, 09:32 PM
Hi Mark
The type I am using below is not of anger or maddness it is to show that I am very happy.
:)THANK YOU SO MUCH YOU DO NOT KNOW HOW MUCH THIS MEANS TO ME I HAVE BEEN TRING TO GET THIS APPLICATION UP AND RUNNING ON OUR WEBSITE FOR ABOUT A YEAR AND A HALF. I ALSO HAD MY BOSS ON ME DAY AFTER DAY TRING TO GET IT UP AND WORKING. With your help it is know working, you have done alot for me.:)
Thank You
Stephen
wisemx
04-05-2011, 04:36 AM
...Not a problem, always willing to help.
Well I learned a lot.
Mark when I upgrade my db and forum I need you on speed dial or I will just make the drive to JC. :D
wisemx
04-06-2011, 12:16 PM
...The Batcave (My undergound Bike garage) is always available for the best Tea, Espresso, Kefir and Kombucha. ;-)
vBulletin® ©Jelsoft Enterprises Ltd.