Showing posts with label website. Show all posts
Showing posts with label website. Show all posts

Wednesday, March 28, 2012

How do i access the SQL server from a website.

How do I access the SQL server from a website, using my Machine Account, not the ASP.NET account?

thanks.

.intrino.On www.connectionstrings.com you can see all of the possible types of connection strings.

When you say "my machine account" do you mean a SQL Server Login, or using impersonation and your Windows account. If you want to use your Windows account, are both machines in the same Windows domain, and do you have a domain account?|||I want to use my account that is like so:

myDomain/Intrino

Instead the site connects as myDomain/ASPNET to the SQL server...and the connection string that i have set up is the SSPI and my IIS is setup as Windows Authentication and it setup as well in the web.config to use the Windows login.

I would like to connect as myDomain/Intrino...how do I transfer the login into the connection string?|||Anyone have any information on this?...|||You need to have ASP.NET run under a different account (your account).

In the Web.Config:

<identity impersonate="true" userName="domain\Jane" password="pass"/>|||So no way to the Web.Config dynammically to impersonate the user logged on?

Thanks for the answer.

.intrino.sql

Friday, March 9, 2012

How can upload and connection my mssql database my site

I make a site in my computer it's work localhost I make mssql connection in localhost but ? don't know how i make mssql connection on website

This is a little hard to explain: But if mssql is installed on your development machine, then it makes sense that it would work, when you are testing in on localhost. That same database is most likely NOT installed on your web host. You didnt provide the details we would need to help you work through this issue but we may be able to walk you through getting it setup correctly...

Post your connection strings (minus any user names and passwords) and tell us if you are using a web host that includes an MSSQL or MSSQL-Express installation.

|||

? upload my mssql database from ftp my site i use that connection but don't work

data source=.\SQLEXPRESS;attachdbfilename=|DataDirectory|\char.mdf;integrated security=true;user Instance=true"

|||

Thats a connection for an SQL Express Database, that exists inside your project, is uploaded and auto attached the first time the application is run.

I've never been able to get that to work on a webhost. It always seems to work just great in a development enviroment, but I dont think I've had a single time, across multiple hosting providers, that the attach method has worked without at the very least, some minor tweaking. Mostly thats because shared hosting enviroments get really funny about attaching databases.

I would contact your webhost. Make sure they have SQL Express 2005 running on the machine you are trying to run your site on. I would also ask them if there is a way that you can attach the file manually (through the Configuration Manager or the Management Studio Express 2005) and then we can modify your connection string to point to it.

Who is your web host?

|||

hi

i create my database on web host

and my connection string

New

SqlConnection("data source=server Catalog=database; User ID=username; Password=password; Integrated Security=True;")

but error

An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)

|||

This gets hard to troubleshoot at this point, because there are so many variables. Typically this is something you're going to be able to solve with the data source= section.

Good values if your application is running on the same server as the database will be

data source=localhost

data source=127.0.0.1

data source=(ip address of server)

But you may be in a shared hosting enviroment - which may have a shared database server, so you may need to specifiy an instance name as well. Have you contacted your hosting provider yet to try to resolve this issue?

How can take Back-Up and restore database from a web form wsing asp.net(vb.net)

I want to give a facility to backup database restore database to the customer in my project.
Database is stored in sql server 2000.
From the website the browser can take backup by clicking BACKUP button and
restore database by clicking RESTORE button.
is it possiable in asp.net programatically ?

In SQL Server you backup a database using the "backup database" command. You restore a database using the "restore database" commands. You can lookup the complete syntax to these commands.

You issue these SQL commands from asp.net just like you would any other SQL command. The backup command will work even if others are using the database at the moment you do the backup. The biggest problem would be the restore. If you are going to restore a database over an existing database (overwrite it) then that database must not be in use or you will get an error.

Brian

|||i do not really recommend this approach whether you can or not !!!!
this is an admin job and it is better not to have a wide access to do this kind of operation..... i am not sure about if you can do it or not ... !!|||Its definitely possible, take a look at this page on MSDNhttp://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_ba-bz_35ww.asp This details the TSQL commands that are necessary to perform the backup/restore. Once you create the commands just execute them with SqlClient.
Hope This Helps

Friday, February 24, 2012

How can I use mdf files from sql server 2005 exp. edition.

Hello,

I am a candidate for web programming..I would like to desing a website and I have a good host which is supporting .net 2.0 and sql server 2005 service. So I would like to ask you

1) how can I use sql server express edition's mdf database file there. or Can I store and use this "mdf"s in ftp folder? What should I do. ..

2) I have only one database "right" there and should I manage everything in one database. For example asp.net configuration manager created ASPNETDB.mdf and ldf...so if Can you inform me about this issue?

Maybe my questions is not advance, they are very basic but I want to learn

Thank you very much for your helps.

Hi,

From your description, it seems that you want to deploy the database in your SQLExpress to the SQLServer2005 database on your host server, right?

If so, I suggest that you should use some tools to achieve that instead of attaching MDF manually. First, you may use aspnet_regsql.exe tool convert the database in SQLExpress to your local SQLServer series database. In you case it's SQLServer2005. After that, use SQLServer export and import wizard to upload the database (including table and schema) to the SQLServer2005 instance on your server.

For aspnet_regsql.exe, see:

http://msdn2.microsoft.com/en-us/library/ms229862.aspx

Thanks.