Problem Making Sql Database Connection In Deployed Site
Dec 12, 2007
VWD 2005 Express. Visual Basic. Sql Server 2005. I am trying to establish a connection to a SQL database. The connection (and all other database reads and writes) work fine in debug and in "view in browser" from VWD. I am running the VWD on the same server that hosts the site. When on my server (Windows 2003 Server) under IIS, the connection attempt times out.
Below is the code that is failing (only on the server when deployed):
Private Shared Sub OpenConn(ByVal cmd As SqlCommand, ByVal Success As Boolean)
Dim conn As New SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings("GoodNews_IntranetConnectionString").ToString)
'The connection string resolves to ("Data Source=HQSERVERHQSERVER;Initial Catalog=GoodNews_Intranet;Integrated Security=True"
We have a small .NET intranet site and I have some experience with Reporting Services. What I am looking to do is develop some reports on our website. However, I would like to make it so the user can do some customization of their reports.
For example, there would be sections of reports (Headcounts, Turnover, etc.) and in each section there would be measurements they could click to include. So I could select the Headcounts section and select the measurements such as Terminations, Hires, and Period End Headcount. I may not select the Turnover sections at all. I am almost thinking like a Google page where you can move around the sections and have your own customized report. Maybe these sections could work as Web Parts, or something like that.
Does any of this make sense? Is it possible? Are there are websites or examples that are out there that I could get an idea to see if this has been done and how to do it?
Is there a way by which we can make the Connection in the connection manager retry for a certain amount of time?
I have a DataFlow Task which uses a OLE Source which is connected to a database. there are time when the connection to the database is not available due to some transport level error. so i wanted the connection manger to make a couple of tries before giving up and saying that it was not able to connect and it timed out..
i have the Connect TimeOut and the General Timeout properties set to 0, but is there a way to retry?
I created a COM-visible .NET class that I want to use to run my SSIS packages. I did this so that I could store variables, connection strings and other options in a central database and have my class set the appropriate connections and variables in the packages and then run them and also log all of my package logging to one central database as well.
I got one package to work in this setting (the package used an ADO.NET connection to call a couple of stored procedures and an SMTP connection manager as well as 10-15 user variables). However my second project is not working when I call it using my .NET class (it works if I manually run the package from SQL Server). When I check my logging it says that it is encountering this error ("SSIS Error Code DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER. The AcquireConnection method call to the connection manager "INFERNO.Wyethport.Wizard+NET" failed with error code 0xC0202009. There may be error messages posted before this with more information on why the AcquireConnection method call failed.") The only other error message that I get is ("component "OLE DB Destination" (1785) failed validation and returned error code 0xC020801C.")
I have set up my packages to save sensitive data with a password and my .NET class sets the password before loading and executing the package so it isn't that problem. Does anyone have any ideas? This has become increasingly frustrating as I don't feel like I understand the goals and concepts behind SSIS security so I am not sure that I am even attacking the problem correctly.
Hi all, I hope this is a simple issue that I'm overlooking something or have contradicting permissions set somewhere. I have a fairly basic site with a subfolder containing an aspx page. The user logs in to gain access to the subfolder. That part works fine.On another page(also within a subfolder in the subfolder), they can post form data to a database (SQL Server 2000) which exists on a different server than my web server. This page opens fine, but when submitting the data (only one value to one field for my testing purposes), it bombs and returns the error "Login failed for user"...In my connection string I've specified the username and password which I assigned to the db in Enterprise Manager (not sa, btw). I've also tried letting IIS control the UID/PW, and even specified no UID/PW in either the connection string or the db. Anonymous access enabled in IIS for this virtual directory also returns the error. (?)I should mention that in Visual Studio, the connection string was automatically set to my local development machine's workstation ID. I removed that and have tried replacing it with the server name, blank, etc.(in notepad) - to no avail. dll's are in their proper places, etc. The only thing not working is the database connection.Using: IIS v6, SQL Server 2000, and Visual Studio.NET 2003 (1.1 framework)Anyway - any suggestions? There are so many places to enable/disable permissions, it's getting confusing. I hope it's something I'm overlooking and not a problem with our SQL installation...Thanks!--Donnie
hi I am not able to create connection string through vwd express for sql express database file n getting a 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: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified) plz tell me where is the problem n how can i resolve it Thanks n with regardsCN
Hi all, i'm making a webpage via the walkthrough of webmatrix. I use the tutorial 'Build an End-to-End Application (with C#.NET) '. The problem is that this tutorial works with an access db. I'll try to start the same thing but using an sql server.
Nowhere i can't find (because i don't look at the right place i gess) how i have to make a sqlconnection via webmatrix with c# using a keyfield to filter my data and to fill out a datagrid.
I followed an excellent tutorial (from Microsoft) about creating and using a SQLExpress db table internal to your website and the site I created works just fine - locally. When I publish to my web host provider I get this error:
[SqlException (0x80131904): 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: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)]
My web host provider supports .NET 2.0 but doesn't support MS SQL Server. But that should matter - right? Because I'm putting the db instance right in the website?
I did a search and followed some of the advice:
I went into the SQL Server Surface Area Config Mgr and set SQLExpress for local and remote connections and rebooted/republished. I also have SQL Server 2005 installed as a separate entity (if that makes a difference).
I still get the above error. This is the connection string from the web.config:
Hi everybody I have installed SqlServer 2005 on my server but my Windows application on the client computers should connect to server via ODBC connection so what should i install on the client computers (that don't have any sql server installed) to enable them to connect? When i want to create ODBC connection on client computers through (Control panelAdministrative ToolsData Sources) i don't see SQL-Server 2005 ODBC driver in the list ....could anyone help me? Kind Regards.
Hi, I am not sure if I select right Froum:) It might be a basic question but could you please help me on that?
Working Environment:
I have developed application on SQL Server 2005 and now wants to Run on Client Site, I am using access as a front end and SQL server 2005 back end through ODBC (System Dsn) which is working good. (user has been added on SQL Server and on Database)
Question:
1) Do I need to create new System Dsn Or other DSN (Keep in mind I have already create System DSN in Server) at each client site to access application from Server?
(If yes then I am trying to do that, it allow me to create (with required database which is on Server) and verify but doesn’t save on ODBC list so I can’t use that name to run appliation on client site)
It might be a basic question but could you please help me on that?
Working Environment:
I have developed application on SQL Server 2005 and now wants to Run on Client Site, I am using access as a front end and SQL server 2005 back end through ODBC (System Dsn) which is working good. (user has been added on SQL Server and on Database)
Question: 1) Do I need to create new System Dsn Or other DSN (Keep in mind I have already create System DSN in Server) at each client site to access application from Server? (If yes then I am trying to do that, it allow me to create (with required database which is on Server) and verify but doesn€™t save on ODBC list so I can€™t use that name to run appliation on client site)
I have packages that must generate log errors dynamically including time of execution and the name of the task.
I make it changing the properties of the connection inserting two expressions.
1.-I alter the File Usage Type to 1 to generate this files. 2.- I alter the connection string as: @[User::myvariable] +"constant_description"+ time description+ +".txt"
The time description is : (DT_STR,40,1252) DAY (GETDATE())+"-"+(DT_STR,40,1252) MONTH( GETDATE())+"-"+(DT_STR,40,1252) YEAR( GETDATE())+" + REPLACE( (DT_STR,10,1252) (DT_DBTIME) GETDATE(),":","_") But it is not the problem
In those packages I have one connector for all the tasks and in execution time it creates one file for each of the tasks.
The problem is the way I insert in the filename the task name.
I have a pre-execute event handler in each task that modifies a string variable( myvariable) appending the task name. When I execute de package it works great but when I only execute a task, the program do not enter in the event and do not put the task’s name.
How can I put that name without using that handler? There is another handler can I use to do it that happens before the system generates the new file name and after pre-execute? Anyone knows another way to do this kind of things?
Hi, I have installed on my laptop SQL server 2005 Developer edition, I can change ANY of the settings of the SQL server and OS.
I am writing code with a team using continuous integration where the connection string is the following: "Provider=SQLNCLI;Server=.SQLEXPRESS;Database=Secret;Trusted_Connection=Yes;"
is there a way (create an alias,rename server, other?) to make my local dev SQL server accept the connection string above, as at the moment I have to rename the connection string every time before checking in code and after downloading the latest version from the code repository.
I developed a site using Visual Web Developer 2005 and the database used is SQL Server 2005 Express edition.Everything works fine. However, when I move the site to my IIS server, it says that my database is read-only.Is it because my SQL Server is an express edition?
Please see the detail of tables with fields in SQL server 2000.·TableStudent .Table Good Qualities( It is a list of Students) (It is a list of Good Qualities)1-Student Id (P.Key)1- Serial No. (P. Key)2-Student Name 2- Good Quality· Table Bad Qualities .Table Future Plans(It is a list of Bad Qualities) (It is a list of Plans)1-Serial No. (P. Key) 1- Serial No. (P. Key)2-Bad Quality 2- Future Plans·Table-Personality1-Student Name/ID2-Good Qualities3-Bad Qualities4-Future PlansData will store in Personality table like thatStudent IDG.Q.No B.Q.NoF.P.No101 3 2 1101 4 5 NUll101 8 Null Null202 4 8 9202Null 3 1Required ResultNow I have to generate a report of One student andsometimes of many students comprising of their Name, G.qualities, BadQualities and Future Plan. To generate report User input will be onlystudent id.I Need help in making relationship of these tables as well as inMaking a Query. Any suggestion to get the required result. Speciallyplease look at the Personality Table because I do not understandPrimary key for it. Should I just include the Serial No. as Primarykey.Please make necessary changes to get the required result.I shall be really thankful to you for your kind favor.
Hi, I use Sql server express 2005.I have two databases: db1 and db2.I use Studio Management. I connect with my administrator account 'admin'. 1) When i rightclick on db1 (and also on db2) and i take the properties / general, i see for both db: owner = servernameadmin .When i take properties / Files, i see for db1: owner = servernameadmin , but for db2, it remains empty.why and does it mean that db2 has no owner? But then, why do i see in properties / general : owner = servernameadmin? 2) i want to make 'admin' owner of db2 (for creating a database diagram), so in properties / Files, i click on the button with three dots.A windows "select database owner" appears, i click on button 'browse', but then all i see is:built-in administartorsbuilt-in userssa... Whatever i choose (e.g; built-in administrators), i get the message: an entity of database cannot be owned by a role, group ... error 15353). Why do i not get the account 'admin' in the browse windows and how to make 'admin' owner of db2? Thanks for helpT.
I am a bit new to using MS-SQL, up till now my main adminstration was in Oracle.
I have a question, my developers make changes to my MS-SQL databases, however, they always login as a local admin or use their domain WIndows accounts - with the given privileges. Then they amend the database. My idea is to avoid logging into an MS-SQL server without using a Remote Desktop. So they will need some kind of a client.
What is your experience and what would be the best way to do this? Meaning, what software can I use that does not require a license fee?
With Oracle I can install the Oracle client which has an SQLPLUS to login remotely. Does MS-SQL have something similar?
Thanks in advance.
I did use Google to search, I also have an MS-SQL Developer Edition, but this seems to come with another server itself.
Hello everyone!I'd like to know which method is better for making a copy of anexisting database in SQL Server 2000, restoring from a backup of theoriginal, or using DTS to copy the objects to the new database. Anycaveats or drawbacks to either method? I'm just trying to lay thegroundwork for internal policies for managing our databases, and I justwant to make sure we use the best method.Thanks!
I have a 6.5 db that I want to create a copy of, I can move it to eithera machine running 7 or 2000. I am more used to doing this in Oracle sopls bear with me...I don't want to have any downtime on the 6.5 db, so I'm thinking perhapsimport is the best way to go? I am assuming that 6.5 backups are notcomaptible with either 7 or 2000 restore, or I'd go that route.The database in question is fairly simple, pretty well just tables fullof data, no stored procs...suggestions?TIA
I am trying to maintain a small database on my iPAQ, can somebody tell me that would database be created in SQL Server Mobile on my iPaq and can my VB.net based Windows CE application can access data from the database on my iPAQ
I am wondering how some of you update your database once it is already been in use. So take for example you have a few tables and users can enter data into the site. Now suppose you either add tables to the db or you add fields to an existing table. I am using sql express 2005 and just want to copy the db over with the copy website but it would overwrite any data users entered.Is there any easy solutions or suggestions for this.Thanks
I am developing a web site with asp.net 2.0 and c#, using Visual Studio 2005 and Microsoft SQL Server 2005 ( I am still learning about these technologies and languages ). I transferred my web site files to a new computer. I created a empty SQL database called "SiteData.mdf", I stopped the SQL server and then I replaced this database with a previous one with the same name and already populated with data. I used this maneuver in order to avoid having to insert all data again. The web site works fine when running inside Visual Studio, however when I try to run it in its published format it gives this error message: Server Error in '/MA' Application. Cannot open database "SiteData" requested by the login. The login failed.Login failed for user 'CENTAURUSASPNET'. I also observed that inside the SQL Server Management Studio, in the database properties, it shows "ETHERASPNET" as User or Roles ( however "ETHERASPNET" was created using the old computer's name [ or should I say domain ? ]) but the permissions list correctly displays the new name "CENTAURUSASPNET". I think that I, probably, should create a new user using the name "CENTAURUSASPNET" because it would use the name of the new computer ( or domain ) and then I should delete the old user name. Actually I tried to do that but I get the message "An object named ‘CENTAURUSASPNET' cannot be found". So, 1) What should I do to get the database being connected with the published web site ( note: I am publishing it in my own computer for awhile ) ? 2) How do I create the new user name "CENTAURUSASPNET" ? 3) I also would like to know why the name of the database in the Server Explorer panel of VS appears as "centaurus.SiteData.dbo" -while- inside the Object Explorer panel of the SQL Server Management Studio it appears simply as "SiteData" ?
I am new to the internet field. Can anybody help me in administering the SQL database on the site. Are there any tools so that I can administer the database on the site straight from my PC??? If there, please tell the URLs so that I can refer them. And please tell me other issues which are involved in administering the database on site.
How can I maintain a parellel SQL server database on my PC?? How can I take backup from my site to the SQL database which is placed in my PC?? I want to keep backup of my database in my PC.
Hi All,Just wondered if i could ask you for some advice and help.I'm looking to write a site, and one of the functions of the site is to remind the user of a certain event at a certain time. I was wondering how i would do this? or if anyone has a working example i could use?Also I dont quite know what database to use...... would MySQL do the function i am after???? If so then no more problem lol If not what database would you recommend i use?ThanksDanny
I am developing a web site with asp.net 2.0 and c#, using Visual Studio 2005 and Microsoft SQL Server 2005 ( I am still learning about these technologies and languages ).
I transferred my web site files to a new computer.
I created a empty SQL database called “SiteData.mdf�, I stopped the SQL server and then I replaced this database with a previous one with the same name and already populated with data.
I used this maneuver in order to avoid having to insert all data again.
The web site works fine when running inside Visual Studio, however when I try to run it in its published format it gives this error message: ~~~~~~~~~~ Server Error in '/MA' Application. Cannot open database "SiteData" requested by the login. The login failed. Login failed for user 'CENTAURUSASPNET'. ~~~~~~~~~~~ I also observed that inside the SQL Server Management Studio, in the database properties, it shows “ETHERASPNET� as User or Roles ( however “ETHERASPNET� was created using the old computer’s name [ or should I say domain ? ]) but the permissions list correctly displays the new name “CENTAURUSASPNET�. I think that I, probably, should create a new user using the name “CENTAURUSASPNET� because it would use the name of the new computer ( or domain ) and then I should delete the old user name. Actually I tried to do that but I get the message “An object named ‘CENTAURUSASPNET’ cannot be found�. So, 1) What should I do to get the database being connected with the published web site ( note: I am publishing it in my own computer for awhile ) ? 2) How do I create the new user name “CENTAURUSASPNET� ? 3) I also would like to know why the name of the database in the Server Explorer panel of VS appears as “centaurus.SiteData.dbo� –while- inside the Object Explorer panel of the SQL Server Management Studio it appears simply as “SiteData� ?
Hi.Does anyone know any web site with common database models presented andexplained.Database models like calendar, adressbook, storehouse...Thnx in advance
I have contracted a webproject to be done. My client allready has a website. I need to create another website that replace the existing one with the new look. This is the problem. The old website has a Database that is associated with user registration & all other data of the company. So, I need to implement the same database to the new website which I am going to develop.
In this case, how can I start? can I add a SQL express databse to the new project and import the data while the development phase? or should I use a SQL server installed while developing the site?
Please give me an easy to understanable reply that I can deal with the old database?
Label3.Text = command4.Parameters["@UserName"].Value.ToString(); }Exception Details: System.InvalidOperationException: String[1]: the Size property has an invalid size of 0.Line 48: Line 49: conn.Open(); Line 50: command4.ExecuteReader(); Line 51: conn.Close(); and here is my stored procedure ALTER PROCEDURE dbo.myStoredProcedure --
(@ProductID int, @UserName varchar(255) OUTPUT)
AS
SET @UserName = (SELECT UserId FROM Products WHERE ProductID = @ProductID) what is wrong? i never seen that error and i don't know from where could it came from please help me, thanks
How would I hide the sa account to be accessible under Logins for a restricted User in sql server 2005 and also other folders like Replication, Managment, etc need to be hidden too.