Asked by:
I need Help Getting publishing my website.

Question
-
User-1825059547 posted
I am new at using Visual Web Developer Express (C#). I understand how to create a website and to test it on my local computer, but I am having trouble understanding what is needed for to publish to website.
1. I have a test website called www.weddingdayplanner.net that I am using to test my VWD website. It is being hosted by www.1and1.net . I it a business package with one SQL database included. The business package supports ASP.NET 2 but does not offer direct support for VWD Expresses templates (Personal or Club, etc...). My first question is? Can I use www.1and1.net to publish my VWD website or should I look for a provider that offers direct support for VWD templates?
2. I have uploaded my webpages to the www.weddingdayplanner.net for testing, and I have uploaded the aspnetdb.mdf to the db_database folder. I get the following error message.
Line 10: </connectionStrings>--> Line 11: Line 12: <connectionStrings> Line 13: <add name="LocalSqlServer" connectionString="data source='mssql08.1and1.com';User ID='dboxxxxxxxxx';Password=xxxxxxxxx;database='zzzzzzzzz'" /> Line 14: </connectionStrings>
The following is my web.config file.
<?xml version="1.0" encoding="utf-8"?>
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
<system.web>
<customErrors mode="Off"/>
<!--<connectionStrings>
<add name="LocalSqlServer"
connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true"
providerName="System.Data.SqlClient"/>
</connectionStrings>-->
<connectionStrings>
<add name="LocalSqlServer"
connectionString="data source='mssql08.1and1.com';User ID='dboxxxxxxxxx';Password=xxxxxxxxx;database='dbxxxxxxxxx'" />
</connectionStrings>
<roleManager enabled="true" />
<authentication mode="Forms" />
<membership>
<providers>
<remove name="AspNetSqlMembershipProvider"/>
<add name="AspNetSqlMembershipProvider"
type="System.Web.Security.SqlMembershipProvider" connectionStringName="LocalSqlServer" minRequiredPasswordLength="7" minRequiredNonalphanumericCharacters="0" passwordStrengthRegularExpression=""/></
providers></
membership></
system.web></
configuration>____________________________________________
1and1.net offers the following inforamtion for connecting to a SQL database.
2.2 Accessing Your MS SQL Database Using ASP.NET
(This option is not supported for all packages.)
Log in to the 1&1 Control Panel, and on the My Account page choose the package you
would like to work on by clicking on it. This will bring you to the Package Administration
page. There, go to
'Applications' > 'MS SQL Administration' and retrieve the followingaccess data:
database name
user name
host name
password.
Make a note of this information. Use the following script to connect to your SQL database
and query a table.
<%@ Page Language="VB" %>
<script runat="server">
Sub Page_Data
Dim oDR as System.Data.SQLClient.SQLDataReader
Dim oCom As System.Data.SQLClient.SqlCommand
Dim oConn as System.Data.SQLClient.SQLConnection
try
oConn = New System.Data.SQLClient.SQLConnection
("server=mssqlxxx.1and1.com; initial
catalog=dbxxxxxxxxx;uid=dboxxxxxxxxx;pwd=xxxxxxxx")
oConn.Open()
oCom = New System.Data.SQLClient.SqlCommand()
oCom.Connection = oConn
oCom.CommandText = "SELECT * FROM products"
oDR = oCom.ExecuteReader()
While oDR.Read
Response.Write(oDR.Item("id") & ", " &
oDR.Item("price"))
Response.Write("<BR/>")
End While
114
Windows
® Hosting Manual, 1&1 Internet Inc.MICROSOFT® DATABASES: MICROSOFT® SQL SERVER
catch
Response.Write("Error:" & err.Description)
Finally
oDR = Nothing
oCom = Nothing
oConn.Close()
oConn = Nothing
end try
End Sub
</script>
<html>
<title>Queries from the MS-SQL database with ASP</title>
<body bgcolor="FFFFFF">
<h2>Query from table <b>products</b> with ASP.NET</h2>
<%Page_Data()%>
</body>
</html>
Highlighted code contains crucial information:
server
is the hostname.initial catalog
is the database name.uid
is the user name.pwd
is the password._________________________________
Any help would be appreciated.
Rick
Wednesday, March 21, 2007 12:37 PM
All replies
-
User-1853252149 posted
You just gave us the code causing the error. What was the FULL error message?
Jeff
Wednesday, March 21, 2007 4:07 PM -
User-1033109952 posted
Jeff:
Thanks for replying. When I type in www.weddingdayplanner.net the only error message is see is the one above. However, I did notice that it was showing my user name and password. I have changed the web.config file to prevent it from showing.
I am not sure where or what the full error message is?
Rick
Wednesday, March 21, 2007 11:10 PM -
User-1853252149 posted
I've never seen an error message that just displays the code block. Copy and post the entire error page.
Jeff
Thursday, March 22, 2007 6:05 AM -
User-106057480 posted
Change the section that your error msg shows from
<configuration>
<system.web>
<customErrors mode="Off"/>
</system.web>
</configuration>to
And you should see the full error msg<configuration>
<system.web>
<customErrors mode="On"/>
</system.web>
</configuration>
Thursday, March 22, 2007 10:26 AM -
User-1825059547 posted
Jeff:
I am not sure this is what you are looking for concerning the complete error message?
<html>
<head>
<title>Runtime Error</title>
<style>
body {font-family:"Verdana";font-weight:normal;font-size: .7em;color:black;}
p {font-family:"Verdana";font-weight:normal;color:black;margin-top: -5px}
b {font-family:"Verdana";font-weight:bold;color:black;margin-top: -5px}
H1 { font-family:"Verdana";font-weight:normal;font-size:18pt;color:red }
H2 { font-family:"Verdana";font-weight:normal;font-size:14pt;color:maroon }
pre {font-family:"Lucida Console";font-size: .9em}
.marker {font-weight: bold; color: black;text-decoration: none;}
.version {color: gray;}
.error {margin-bottom: 10px;}
.expandable { text-decoration:underline; font-weight:bold; color:navy; cursor:hand; }
</style>
<script language='javascript' src='http://127.0.0.1:1029/js.cgi?pcaw&r=24221'></script>
</head>
<body bgcolor="white">
<span><H1>Server Error in '/' Application.<hr width=100% size=1 color=silver></H1>
<h2> <i>Runtime Error</i> </h2></span>
<font face="Arial, Helvetica, Geneva, SunSans-Regular, sans-serif ">
<b> Description: </b>An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.
<br><br><b>Details:</b> To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "Off".<br><br>
<table width=100% bgcolor="#ffffcc">
<tr>
<td>
<code><pre><!-- Web.Config Configuration File -->
<configuration>
<system.web>
<customErrors mode="Off"/>
</system.web>
</configuration></pre></code></td>
</tr>
</table><br>
<b>Notes:</b> The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's <customErrors> configuration tag to point to a custom error page URL.<br><br>
<table width=100% bgcolor="#ffffcc">
<tr>
<td>
<code><pre><!-- Web.Config Configuration File -->
<configuration>
<system.web>
<customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/>
</system.web>
</configuration></pre></code></td>
</tr>
</table><br>
</body>
</html><script language='javascript'>postamble();</script>
Rick
Thursday, March 22, 2007 12:05 PM -
User-1825059547 posted
Jeff:
The following is the web.config file.
- <?
- <
configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">- <
system.web>- <
customErrors mode="On"/>- <!--
<connectionStrings>- <add
- name="LocalSqlServer"
- connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true"
- providerName="System.Data.SqlClient"/>
- </connectionStrings>
-->- <
connectionStrings>- <
add name="LocalSqlServer" connectionString="data source='mssql08.1and1.com';User ID='dboxxxxxxxx';Password=xxxxxxxx;database='dbxxxxxxxx'" />- </
connectionStrings>- <
roleManager enabled="true" />- <
authentication mode="Forms" />- <
membership>- <
providers>- <
remove name="AspNetSqlMembershipProvider"/>- <
add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="LocalSqlServer" minRequiredPasswordLength="7" minRequiredNonalphanumericCharacters="0" passwordStrengthRegularExpression=""/>- </
providers>- </
membership>- </
system.web>- </
configuration>I have also turned on the customerror mode to on.
Rick
Thursday, March 22, 2007 12:09 PM -
User-1853252149 posted
CustomErrors should be Off. Is this IIS or the development server? Have you configured a virtual directory? If so, is it an application? Did you set the correct version of the framework if IIS?
Jeff
Sunday, March 25, 2007 11:53 PM -
User-1825059547 posted
Jeff:
Thanks for the reply. I have changed the CustomErrors to Off. For testing I am using my local computer with SQL Express running. For Publishing I am using a server that www.1and1.com has setup for MS web hosting. I am not sure what a virtual directory or version of framework is?
Let me back track for a second. I am wanting to set up a personal website using MS VWD Express. My main interest in having the ability to create user accounts and set roles. I have created a website that works fine on the local computer. I have several accounts with www.1and1.com using simple html pages for publishing. The account that I am using for testing is a business account that supports 2 SQL Databases and asp.net version 2.0.
What I am not sure of is that I can even set up users account with password access and roles on the www.1and1.com account. Their tech support is conflicting and lacking good assistance at best.
What I do know is that I have to change the web.config file to have it point to the SQL database on www.1and1.com server.
I have to upload the database to the SQL Server as a BAK file. Not sure how to do this.
I might have to inter information into the SQL database. Not sure what.
Not sure where to go from here.
Rick
Tuesday, March 27, 2007 4:43 PM -
User-1853252149 posted
I'm not familiar with 1 and 1, but most web hosts have SQL Server 2005 and not Express. You need to run aspnet_regsql.exe to use the membership database on standard SQL, that may not be possible on your host. Uploading existing data depens on the tools provided by your host. You may be able to upload the database file and attach it, do a backup/restore or even control their database directly with Enterprise Manager. Those are options you need to talk to 1 and 1 about.
Jeff
Wednesday, March 28, 2007 7:05 AM -
User-1825059547 posted
Jeff:
Thanks for the reply.
Tech support from www.1and1.net in the form of any scripting is non-existant. At this point I am looking at hiring an expert in ASP.NET to assist me in getting my website up and running. I believe that I need to see how it is done by someone else in order to understand the publishing aspect of ASP.NET.
Can I pay you to help me or do you know of someone who is qualified to assist me in setting up my site?
Rick
Saturday, March 31, 2007 5:18 PM -
User-1213092341 posted
Does any know of instructions on how to publish and configure a starter kit on a production server?Tuesday, April 3, 2007 11:19 AM -
User-1705717250 posted
You could take a look atDeploy starter kit to remote host
<!--
--> http://www.edream.org/BlogArticle.aspx?RecordID=115Hope it helps, if not let me know and I will look into testing it on 1and1 account.
Regards
Jeremy
Thursday, April 19, 2007 9:31 AM -
User145501902 posted
Please, please, please. Help with 1and1. I have been trying for about a month. 1and1 tech support suggests looking at following website:
http://www.sectormicro.com/sector-micro/home/default.aspx
I have emailed them (sectormicro), asking help, no response.
Here are the issues. We can't use the root directory, so there has to be a "redirector" in the root dir. (email and I will send you mine, or any of the code I have tried). Then, the webpage code has to be published to a sub-folder.
Next, we cant do "remote access", so we cant run reg-sql (1and1 support promises that we cant, and they are correct).
To demonstrate that the Database works, they suggest that we go into their admin tools and create a DB Table called "Products" with and "id" and a "price". Then they give the following .ASP to test: (and it works fine) where AAA, BBB, CCC, DDD values are given by the 1and1 mssql admin tool
<html>
<head>
<title>Queries from the MS-SQL database with ASP</title>
</head>
<body bgcolor="FFFFFF">
<h2>Query from table <b>products</b> with ASP</h2><%
Set conn = Server.CreateObject("ADODB.Connection")
conn.open "PROVIDER=SQLOLEDB;DATA SOURCE=mssqlAA.1and1.com;UID=dboBBBB;PWD=CCCC;DATABASE=dbDDDD"'This code block will create a recordset
Set rs = Server.CreateObject("ADODB.Recordset")
SQL = "select * from products"
rs.open SQL, conn'will iterate to display the records got from the database
While Not rs.EOF
response.write(rs("id") & " " & rs("price") & " ")
rs.MoveNext
Wend'closes the connection
rs.close
conn.close
Set rs = Nothing
Set conn = Nothing%>
</body>
</html>My email is tcscushing@aol.com I set up product 1 price 10 and product 2 price 5, see http://test.cushingshops.com
The last thing I tried was "enable frontpage extensions" then publish using VWD, directly to <root>\main and now it acts different than it did, but still doesnt seem to work when I go to www.cushingshops.com
Thanks for any help. All my code would be available to anyone, if we get this working. Email me for further info, or keys to access my stuff.
Thursday, April 19, 2007 11:46 AM -
User593215468 posted
Are you having any specific error messages or you just can't get the site running? Do you have control over how your domain redirects or you simply have to get it pointed to a sub folder?
~Eric
Thursday, April 19, 2007 12:19 PM -
User145501902 posted
I got this from Jeremy:
It is true that 1and1 will not allow remote access to MSSQL which is a pain but it easy to work around just make a SQL Create script and run it from the mylittleadmin tool - tools - Query Analyser in the 1and1 admin section. Use aspnet_regsql to make the script to run Query Analyser.
*****************************************************
I will try this. My question as I begin is:I need to run aspnet_regsql, and do I run it from my local machine, or do I run it from the server? I am guessing that I can run it, dos-mode, from my machine, specifying server, login-id, password, and the -sqlexportonly <filename> to generate a script.Do I use the switch to turn all application services as I generate the original script? Do I care about SQL CACHE DEPENDENCY OPTIONS?I then move the script to my 1and1 site, <root>\main (where my website apps are), and use the 1and1 mylittleadmin tool - tools - Query Analyser to run this script.Is this on the right track?Btw - my redirector script has worked fine, over the last month. I use the same script as Jeremy pointed out:-Tom
Saturday, April 21, 2007 1:53 PM -
User761576126 posted
As for any that are having problems adding data to a database,
You must download microsoft's optional sql express tool, backup your database, put it in the _db_imports folder of your ROOT webspace, then attempt to import it using 1&1's tools.
As for connection to the database, use this code (in vb)
<remove name="LocalSqlServer" />
<add name="LocalSqlServer" connectionString="server=mssqlxxx.1and1.com; initial catalog=dboxxxxxxx;uid=dbxxxxxx;pwd=xxxxxxxxxx" />and be sure to replace the x's with your login info.
Hope this helps!
Wednesday, May 9, 2007 7:02 PM -
User145501902 posted
Thanks all, and especially to jeremyh who worked on this over 3 weeks, to get me up and going. As I was putting up the classified-ads starter kit, I will go back to their forum and try to leave a detailed explanation of what it took to get 1and1 to work.
Looking back, the biggest problem was probably the web.config connection string, which ended up being:
<connectionStrings>
<add name="classifiedsConnection" connectionString="server=mssqlxx.1and1.com; initial catalog=dbyyyyyyyyy; uid=dboyyyyyyyyy; Pwd=zzzzzzzz"/>
<remove name="LocalSqlServer"/>
<add name="LocalSqlServer" connectionString="server=mssqlxx.1and1.com; initial catalog=dbyyyyyyyyy; uid=dboyyyyyyyyy; Pwd=zzzzzzzz"/></connectionStrings>
I used the 1and1 ms-sql/admin-tool to find the values for xx, yyyyyyyyy, and zzzzzzzz
In a couple of days, I will post my detailed explanation over in the classified-ads forum. If anyone wants me to email source-changes to the stock classified-ads starter kit, let me know.
Thanks again, Jeremy!
tcscushing@aol.com - Tom
Friday, May 11, 2007 10:03 PM -
User145501902 posted
http://forums.asp.net/thread/1709414.aspx
Beginners might want to check this out.
Thursday, May 17, 2007 12:33 PM