Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
|
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 23rd, 2010, 05:00 PM
Authorized User
 
Join Date: Dec 2010
Posts: 21
Thanks: 4
Thanked 1 Time in 1 Post
Question How do I write data to my database using the CreateUserWizard?

I am a total Noob to ASP.Net.
I am using Microsoft Expression Web's "CreateUserWizard" control.
Our database is on a web-host's server.

Whenever I attempt to try to create a user using the wizard, the following error pops up:

"The SSE Provider did not find the database file specified in the connection string. At the configured trust level (below High trust level), the SSE provider can not automatically create the database file."

*by the by, when I try to change the trust level, the webhost server shows its own error, saying that I'm not allowed to change the trust level. duh, right?*

I have the following connection string in my web.config (omitting the real values):

Code:
		<connectionStrings >
        <add name="ConnectionString"
		connectionString="Provider=[someone];Data Source=[somewhere];Initial Catalog=[somewhereelse];User Id=[someoneelse];Password=[Areallymysteriouspassword];"/>
		</connectionStrings>
I have contacted our web-hosting service, and they pretty much said "[do your own dang programming]" and sent me the following via e-mail:

"You will... need to manually create [a table in our web-application (mylittleadmin)] and other information in it so that the database will be compatible with the one that you have in your forms."

"After you have successfully used the database information that we have [provided you] and have [also] created the tables and some string values for the individual tables or elements, you will need to match [this] information in your script so that [the] information will be synchronized with [what] you have in your database."

It also doesn't help that they speak in broken english over an unstable phone-line, and their e-mails are not in well-refined english either (thus my [paraphrasing])

I tinkered with the tables, and it's still coming up with the same error. I can only assume that I'm doing something wrong.
 
Old December 28th, 2010, 11:44 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

You may want to take a look here: http://weblogs.asp.net/scottgu/archi...25/423703.aspx


Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
The Following User Says Thank You to Imar For This Useful Post:
MtheK (December 31st, 2010)
 
Old December 31st, 2010, 04:59 PM
Authorized User
 
Join Date: Dec 2010
Posts: 21
Thanks: 4
Thanked 1 Time in 1 Post
Default

Hey, cool, you actually responded to my post!
I'm using your ASP.NET 4 in C# and VB book as a reference (though our webhost uses 2.0)

The connection string etc. in the link that you provided for me looks to be pretty much exactly what I already have. Now I don't think that the connection string is my problem. The webhost that we have provides a connection string for us. I've been looking at the membership and user table properties, and have been scratching my head over it. Your book seems to say that VWD and SQL pretty much makes it all for me, but our webhost's program (MyLittleAdmin for sql) requires me to make the tables and their properties myself. I have gotten as far as creating the tables. Currently I'm scratching my head over the table properties, i.e. procedures, rules, relationships, etc.

Again, I'm totally new to this stuff.
 
Old January 1st, 2011, 11:55 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

You definitely don't want to create the tables manually. Instead, use of one of the following methods:

1. Use aspnet_regsql. This is discussed in Appendix B, page 771 and further. You can use this tool if you can access your database remotely.

2. Use the Database Publishing Wizard as discussed in Chapter 19 on page 723 and further. With this option, you create the database locally, then use the wizard to create SQL scripts you can run against your host's database.

Hope this helps,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old January 3rd, 2011, 03:43 PM
Authorized User
 
Join Date: Dec 2010
Posts: 21
Thanks: 4
Thanked 1 Time in 1 Post
Default

Thanks, that's helpful. I do have a question about the connection string. That's what I knock my head over the most. If I'm connecting to a server on my network, then the data source is the server's name, right? i.e. "\NETWORKSERVER" and the initial catalog is simply the database name? i.e. "ASPDATA" and nothing else? I'll continue messing with it. Thanks for your help, Imar
 
Old January 3rd, 2011, 04:26 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

If the server has a default instance of SQL Server, it's just NETWORKSERVER without the leading slash.Otherwise, if it has a named instance, it's NETWORKSERVER\InstanceName.

You may find the following article useful as well: http://imar.spaanjaars.com/395/confi...ql-server-2005

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old January 3rd, 2011, 05:00 PM
Authorized User
 
Join Date: Dec 2010
Posts: 21
Thanks: 4
Thanked 1 Time in 1 Post
Default

Thanks for the link.

This is exactly the line of code I'm using, and it keeps coming up with the same error. Does it only work this way if I preview it in the browser? I am testing it on the internet, so I'm not sure if that has any effect.

Code:
<configuration>

		<connectionStrings >
        <add name="LocalSqlServer"
			connectionString="Data Source=NETWORKSERVER; Initial Catalog=ASPWEB; Integrated Security=SSPI; Trusted_Connection=True"
			ProviderName="System.Data.SqlClient"/>
		</connectionStrings>

    <system.web>
    
		<customErrors mode="Off"/>
		
    	<authentication mode="Forms" />

    </system.web>

...
If you say it's right, I'll assume it's correct and that there is something else I'm doing wrong.

Thanks, man, I think it's awesome that you're taking the time to help me out.
 
Old January 4th, 2011, 05:36 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Quote:
and it keeps coming up with the same error
What error do you get?

A few other observations:

1. You may need a <clear /> statement directly under <connectionStrings> to clear any previous connection strings.

2. Not sure what you mean with "I am testing it on the internet". If NETWORKSERVER is on your LAN, this might work provided enough firewall ports are open and NETWORKSERVER allows remote connections. However, if NETWORKSERVER is on the Internet and the web site isn't or in a completely different location, this won't work. Integrated Security typically only works over a LAN.

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old January 5th, 2011, 12:54 PM
Authorized User
 
Join Date: Dec 2010
Posts: 21
Thanks: 4
Thanked 1 Time in 1 Post
Default

Quote:
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
What I mean by "testing it out on the internet" is that I publish it out to a webhost, then browse to it via internet explorer.
 
Old January 5th, 2011, 01:06 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

But is your SQL Server installed on the same machine / network as the Web Server? Otherwise, the two won't be able to communicate using integrated security.

If they are, it might work, if your host allows it. Have you contacted them for connection string information? They typically provide you with this information, or they have FAQs / documentation that explains the necessary settings.

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!





Similar Threads
Thread Thread Starter Forum Replies Last Post
Write to a database MMJiggy62 Beginning VB 6 3 August 24th, 2006 12:11 AM
Write data from access database to text files hayley Classic ASP Basics 1 February 1st, 2005 08:54 AM
Write to DataBase HELP!!! reidcor Javascript 3 January 19th, 2005 02:58 PM
Database Write and Email inquiringminds BOOK: Beginning ASP 3.0 9 September 21st, 2004 06:33 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.