Wrong Connection When Switching Computer

Jan 5, 2007

Hi

My C# application has a DataGridView which is bound to a DataSet. I used Visual Studio to add/configure the data source. Everything works fine on my computer. When I try to run the application on another computer I can't connect to the database, because it uses a wrong connection string.

How can I make a specific connection/connection string permanent for a specific application?

Thanks.

View 6 Replies


ADVERTISEMENT

Computer Generates Wrong Answer Of Decimal Values

Feb 23, 2008

hi, i'm using the following code to generate the value of a column in a database, where the colums value is dependent upon the multiplication of two other cells in the same row. When I execute the statement, it will work fine for whole numbers, but it does not work correctly for decimal values. All columns are of type varchar(50). An exmple.................It just multiplied 200 by 2.50 and returned 600SqlCommand objCmd2 = new SqlCommand("UPDATE Portfolio SET Current_Worth=Current_Price*Number_Of_Shares WHERE Name_Of_Asset LIKE '%'+@Name_Of_Asset+'%'", objConn);objCmd2.Parameters.AddWithValue("@Name_Of_Asset", DropDownList1.SelectedValue);objConn.Open();objCmd2.ExecuteNonQuery();objConn.Close(); Any ideas? 

View 5 Replies View Related

DB Connection On Remote Computer

Oct 19, 2006

Hi,



I have installed SQL SERVER 2005 on my network machine.

How do I connect the DB from my machine.



From the Microsoft SQL server DSN CONFIGURATION PAGE on my machine,

I put in the name of my network PC and the SQLEXPRESS .

But connection FAILS.



The Server Name on my Network PC : RCH1SQLEXPRESS

The Full computer name is RCH1



So in my DSN CONFIGURATION PAGE on my machine,

I enetered as RCH1SQLEXPRESS



What am I doing wrong?

View 3 Replies View Related

Connection String To SQL Express On Another Computer

Jun 28, 2007

I have an XP Pro machine running a classic ASP site in IIS - the version that comes on the XP Pro CD.  The site makes a connection to an MSDE database on the same machine named InControl.  I have moved that database to SQL Express 2005 and want to test it with the ASP site.  SQL Express 2005 is running on a separate Vista machine.  I am currently using this connection string:
objConn.ConnectionString = "Provider=SQLOLEDB;Data Source=400SC;Initial Catalog=InControl;User ID=" & uid & ";Password=" & upass & ""
Where 400SC is the name of the XP Pro machine and InControl is the database.  The variables uid and upass are pulled from Session when the connection string is created.
I have tried different Provider names and various combinations of server name and ip address with and without port numbers for the Data Source.  All of them yield some variation of this error:
 Microsoft OLE DB Provider for SQL Server (0x80004005)[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied. 
What should the connection string look like?
 Thanks for the help.
PS - If the solution involves a port, do I need to make that port an exception in the Vista Firewall?

View 4 Replies View Related

Setup And Upgrade :: Allow Only Connection From Same Computer

Jul 17, 2015

I am about to install SQL Server 2012. I have a server with IIS. There is a web application that uses the sql server. 

What should i do when i only want that application to use the database?

And so that you can only connect to the database from the same computer as the SQL server?

View 6 Replies View Related

Moving Reports To Another Computer Connection String

Jul 20, 2007

Hello
I created several Reports using SSRS and SSAS. now i have to move them to another PC, which name is different. is there a way to do this without having to open each report in BIDS and changing the connection string for each Data Source ?
thanks

View 1 Replies View Related

When I'm Connection My Asp.net Application From Remote Computer Following Error Is Occured?

Jun 3, 2008

 plz help me...
when establishing a connection to the server. when connecting to server 2005, this failure may be caused by the fact that under the default setting SQL Server does not allow remote connections.(provider: Named pipes provider, error:40 - could not open a connection to sqlserver)

View 2 Replies View Related

The Connection Manager 'OLEDB' Is Not Properly Installed On This Computer

Sep 14, 2005

Please help someone from MSFT!

View 78 Replies View Related

SQL Remote Connection Problems To A Computer On A Domain - Obviously I Am Missing Something...

Apr 6, 2008

Hi all. I am a bit new to SQL but I have studied much info, BOL, various best practices and so on. The problem is - I cannot find any tutorial which could tell me step by step how to set SQL server on a PC and connect to it from another computer (they all are on a domain). So I decided that I am doing something wrong...

I have done the following (all is done on virtual PCs):
1.I have installed a virtual PC with windows 2003, which acts as a domain controller.

2.I installed Win2003 on a second PC and added it to the domain. Installed MS SQL Server 2005 and SP2 on it. Server uses Windows auth. and all the services are running from a dedicated domain account which I added on the first PC.

I added a domain account (let's call it USER_X) to the SQL server Security/Logins

Everything is OK locally, I can connect to the server using USER_X from the same PC.

3.I installed Win2003 on a second PC and added it to the domain. Installed MS SQL Server 2005 client componenst, SSMS and SP2 on it. Logged on as USER_X. And tried to connect to the PC number 2. And failed. SSMS gives an error (1396) Named pipes error "Could not open a connection to SQL server". But the server appears on the list if I click Server name->Browse for more->Network servers. Why I cannot connect to it if I see it?
Tried to enable Windows and SQL auth, created a pure SQL user USER_Y, checked locally - ok, can connect. But cannot connect as USER_Y from the third PC.

Finally
4.I installed Win2003 on a fourth PC (did not add it to the domain). Installed MS SQL Server 2005 and SP2 on it. Server uses Windows and SQL auth. Enabled Windows and SQL auth, again created a pure SQL user USER_Y, checked locally - ok, can connect. And checked connection from the third PC - I can connect fine as SQL USER_Y to the SQL server on a PC which is not on the domain but cannot connect as SQL USER_Y to the SQL server on a PC which is on the domain!

What am I doing wrong? How to connect from a PC on a domain to another SQL server on the same domain? It is just a basic config which (I think) SQL admins have gone through many times but I am stuck.

Help, please! I hope to hear from someone who has installed SQL server on a domain and successfully created remote connections.

Thanks.

View 5 Replies View Related

ODBC Connection To Remote Computer Giving Invalid Instance() Message

Feb 20, 2007

I am trying to set up a ODBC connection to a remote database using the ODBC data source administrator. I am getting an error message complaining of an invalid instance(). The database I am trying to connect to does have a default instance and a named instance. Do I need to specify the instance name somewhere in the connection settings? I tried specifying the server name as <Remote computer IP Address>/<Instance Name> but this didn't work. Any ideas?

View 4 Replies View Related

What Wrong With My Connection Code?

Apr 19, 2005

Below is my connection code..
Public Class clsConnect
Public Shared Function getConnection () AS SQLConnection
Dim strConn As String = "Data Source=PPS_SERVER;" & _
"Initial Catalog=eCommunity;User ID=sa;Password=pps"
Dim DBConn As SqlConnection
DBConn = New SqlConnection(strConn)
DBConn.Open()
Return DBConn
End Function
 
However when i run the web this error was appeared. what possibility of this problem?
SQL Server does not exist or access denied.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Data.SqlClient.SqlException: SQL Server does not exist or access denied.Source Error:



Line 12: DBConn = New SqlConnection(strConn)
Line 13:
Line 14: DBConn.Open()
Line 15:
Line 16: return DBConn

View 2 Replies View Related

ODBC Connection For Client Application To SQL Server 2005 Express Installed On Network Computer

May 5, 2006

Hi All,

I've developed an application that connects to a SQL Server 2005 Express database. I created a DSN to connect to the database through ODBC. Currently, I am testing locally and everything works fine.

I would now like to install my application on another workstation and connect remotely to the database located on my development machine.

The client workstation does not have SQL Server 2005 Express installed on it because I would just like my application to connect remotely by creating the DSN and using ODBC. What I'm missing here are the database drivers. The "SQL Natice Client" is not available on this client workstation. How can I deploy the necessary drivers with my installation file so that I may create the required DSN name using the SQL Native Client driver?

Thanks!

View 6 Replies View Related

ADO Connection.Open Hangs If Paramters Are Wrong

Nov 5, 2007

Hi
Im writing a program that stores data to SQL server 2005.
Program writen on VC++ 2003.
Code is very simple and it works ok if server runs and parameters are ok.


try
{

HRESULT hr = m_Connection.CreateInstance(__uuidof(ADODB::Connection));

String ConnectionStr;

ConnectionStr.Format(_T("Provider=sqloledb;Data Source=%s;Initial Catalog=MyDB;User Id=%s;Password=%s;"),m_Server.c_str(),m_Username.c_str(),m_Password.c_str());

_bstr_t bstrConnection(ConnectionStr.c_str());




m_Connection->CursorLocation = ADODB::adUseClient;

hr = m_Connection->Open(bstrConnection, L"", L"", ADODB::adConnectUnspecified);
}
catch(_com_error &e)

{

_bstr_t Description = e.Description();
}

But!
if i give wrong paramterer for Data Source , it may happen if user configures it and misprints it, or if server goes offline for some reason, program just hangs on m_Connection->Open and never gives exception as it should.
Any ideas what wrong?
Thanks.

View 4 Replies View Related

Could Not Create A Connection For The Provider Invariant Name. Verify That This Provider Is Installed Correctly On This Computer

Nov 28, 2006

Hi all,
While working on the Integration Services project.
When I try to create a new Data Connection in Connection Managers for ADO .NET SAP Provider, it gives the following exception:


TITLE: Microsoft Visual Studio
------------------------------

Could not set the connection qualifier for the current connection.

------------------------------
ADDITIONAL INFORMATION:

Could not create a connection for the provider invariant name 'Microsoft.Adapters.SAP.SAPProvider'. Verify that this provider is installed correctly on this computer. (Microsoft.DataTransformationServices.Design)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft%u00ae+Visual+Studio%u00ae+2005&ProdVer=8.0.50727.42&EvtSrc=Microsoft.DataTransformationServices.Design.SR&EvtID=CouldNotCreateConnection&LinkId=20476

------------------------------

Object reference not set to an instance of an object. (Microsoft.Adapters.SAP.SAPProvider)

------------------------------
BUTTONS:

OK
------------------------------


Can anyone describe, what is the resolution for the same.

View 1 Replies View Related

Sql Server 2005 Inserting Prbblem..wrong SQL? Wrong Parameter?

Feb 19, 2006

Im trying to insert a record in my sql server 2005 express database.The following function tries that and without an error returns true.However, no data is inserted into the database...Im not sure whether my insert statement is correct: I saw other example with syntax: insert into table values(@value1,@value2)....so not sure about thatAlso, I havent defined the parameter type (eg varchar) but I reckoned that could not make the difference....Here's my code:        Function CreateNewUser(ByVal UserName As String, ByVal Password As String, _        ByVal Email As String, ByVal Gender As Integer, _        ByVal FirstName As String, ByVal LastName As String, _        ByVal CellPhone As String, ByVal Street As String, _        ByVal StreetNumber As String, ByVal StreetAddon As String, _        ByVal Zipcode As String, ByVal City As String, _        ByVal Organization As String _        ) As Boolean            'returns true with success, false with failure            Dim MyConnection As SqlConnection = GetConnection()            Dim bResult As Boolean            Dim MyCommand As New SqlCommand("INSERT INTO tblUsers(UserName,Password,Email,Gender,FirstName,LastName,CellPhone,Street,StreetNumber,StreetAddon,Zipcode,City,Organization) VALUES(@UserName,@Password,@Email,@Gender,@FirstName,@LastName,@CellPhone,@Street,@StreetNumber,@StreetAddon,@Zipcode,@City,@Organization)", MyConnection)            MyCommand.Parameters.Add(New SqlParameter("@UserName", SqlDbType.NChar, UserName))            MyCommand.Parameters.Add(New SqlParameter("@Password", Password))            MyCommand.Parameters.Add(New SqlParameter("@Email", Email))            MyCommand.Parameters.Add(New SqlParameter("@Gender", Gender))            MyCommand.Parameters.Add(New SqlParameter("@FirstName", FirstName))            MyCommand.Parameters.Add(New SqlParameter("@LastName", LastName))            MyCommand.Parameters.Add(New SqlParameter("@CellPhone", CellPhone))            MyCommand.Parameters.Add(New SqlParameter("@Street", Street))            MyCommand.Parameters.Add(New SqlParameter("@StreetNumber", StreetNumber))            MyCommand.Parameters.Add(New SqlParameter("@StreetAddon", StreetAddon))            MyCommand.Parameters.Add(New SqlParameter("@Zipcode", Zipcode))            MyCommand.Parameters.Add(New SqlParameter("@City", City))            MyCommand.Parameters.Add(New SqlParameter("@Organization", Organization))            Try                MyConnection.Open()                MyCommand.ExecuteNonQuery()                bResult = True            Catch ex As Exception                bResult = False            Finally                MyConnection.Close()            End Try            Return bResult        End FunctionThanks!

View 1 Replies View Related

How To Know Whether A Computer Is A Sql Server According To The Name Of Computer?

May 9, 2004

Thanks a lot

View 6 Replies View Related

Help Switching To SQL Authentication

Apr 1, 2006

At the moment my asp.net app is working ok and I can connect to the database using windows authentication, however i'm trying to use sql authentication on my local computer.i'm using sql server studio at the moment to manage the database. And tried numerious combinations of things to try and get it working and allow me to connect to the database using SQL authentication but still no luck :(can anyone give me some rough step by step instructions to setting up the sql username and password for forms authentication and activating it for a certain database?thanks

View 1 Replies View Related

Switching Databases In ADO.NET

Oct 9, 2006

Hi

If I have a connection open which is in database master, can I switch to another database within that connection without having to close the connection and recreating it?

Thanks

Steve

View 1 Replies View Related

Xp_startmail And Switching Profiles

May 13, 2002

Guys!
I'm using SQL Mail to send out Emails to Customers re: outstanding Invoices. I also use SQL Mail on the same box to send out emails to our Sales Reps with summaries of outstanding invoices. Now, I've set up multiple outlook profiles on the server. I tried using

xp_startmail @user = 'CreditControlDept'
xp_sendmail .... (to customers)
xp_stopmail @user = 'CreditControlDept'
xp_startmail @user = 'InvoiceTracker'
xp_sendmail...(to internal sales reps)
xp_stopmail @user = 'InvoiceTracker'

DOES NOT WORK!!! the profile does'nt switch at all. SQL Mail sends out all the emails using the profile that it started with. How can I use xp_startmail and xp_stopmail to switch between different user profiles.

Regards
Uday

View 1 Replies View Related

Switching Off Replication For A Restored DB

Oct 19, 2000

Hi

If I dump a replicated Db and restore it onto another DB, how do I switch off replication from the restored DB. I believe there were some scripts developed for this in 6.5.

Any suggestions will be appreciated.

Rich

View 1 Replies View Related

Switching Signs + And - In Matrix

Apr 10, 2008

Could anyone help me to find out how to switch signs of "+" and "-" in matrix drilldown?

In columns drilldown i have wright (that means "+" for drilldown and "-" for drillup)

In rows I have it conversely, don't know why and don't where I can change this.

Thank you!

View 2 Replies View Related

Switching From Per Seat To Per Processor License

Aug 6, 2004

We have an active database that sits on SQL Server 2000 that currently has per seat license...but now want to switch to per processor.
If I go to ControlSQL Server 2000 License Set up...it doe not give me the option to choose per processor.

Do I need to un-install/re-install SQL Server 2000 and choose the per processor choice and then re-attach our database ?

It seems like a lot of work..please advise.

Thank you

View 7 Replies View Related

Switching In And Out Of Bulk Logged Mode

Jul 22, 2004

I sometimes have problems when running index rebuilds due to the tran log growing too big. MS suggest switching the db from full recovery mode to bulk-logged mode fur the duration of the rebuild. Question is, when you switch a db from full recovery to bulk logged, does that invalidate the tran log backups up to that point? When the db is switched back into full-recovery mode, are the following tran log backups still in sequence?

Clive

View 2 Replies View Related

Switching Compatability Mode From 6.5 To 2000

Jan 9, 2006

Do you know of any resources in terms of Transact SQL in order to migrate from 6.5 to 2000?

View 1 Replies View Related

SQL 2012 :: Switching From One Database To Another Within The Same Script?

Jan 28, 2015

I would like to know how I can switch from one database to another within the same script. I have a script that reads the header information from a SQL BAK file and loads the information into a Test database. Once the information is in the temp table (Test database) I run the following script to get the database name.

This part works fine.

INSERT INTO @HeaderInfo EXEC('RESTORE HEADERONLY
FROM DISK = N''I:TESTdatabase.bak''
WITH NOUNLOAD')
DECLARE @databasename varchar(128);
SET @databasename = (SELECT DatabaseName FROM @HeaderInfo);

The problem is when I try to run the following script nothing happens. The new database is never selected and the script is still on the test database.

EXEC ('USE '+ @databasename)

The goal is switch to the new database (USE NewDatabase) so that the other part of my script (DBCC CHECKDB) can run. This script checks the integrity of the database and saves the results to a temp table.

What am I doing wrong?

View 2 Replies View Related

Dynamically Switching Databases In A Script

May 2, 2006

I've got a situation where I need to execute portions of a script against every database on a given instance. I don't know the name of all the databases beforehand so I need to scroll through them all and call the "use" command appropriately.

I need the correct syntax, the following won't work:

DECLARE DBS CURSOR FOR
SELECT dbname
FROM #helpdb
ORDER BY dbname

OPEN DBS

FETCH NEXT
FROM DBS
INTO
@dbname

WHILE @@FETCH_STATUS = 0
BEGIN

USE @dbname

The last line - the "USE" statement - is invalid. The following for example works:

USE master

But when supplied a declared variable a syntax error results for the use command because it expects an identifier.

So .. what is the correct syntax to pass a declared parameter to "USE", or is there another way to meet this requirement?

Thanks for your time.

View 6 Replies View Related

SSRS Configure Error While Switching Panels

Nov 6, 2013

i want to upload reports in ssrs , when i trying to configure reporting service configuration manager, getting error" there was an error while switching panels. The most likely cause is an error retrieving wmi properties. the exception details are access is denied . You must have an administrator on the report server computer to use this tool".

View 2 Replies View Related

Switching Between Network Service And Local System....!

Apr 29, 2008



It is simple question, just slipped out of my mind at this time...... how do we change Security Context for 2005 version from network to local system.
thanks,

View 1 Replies View Related

Problem With Context Switching Feature In SQL 2005

Jan 26, 2007

Hi,

One of our client application launches a execuatable on server by calling master..xp_cmdshell. We are migrating to SQL 2005 and I would like to use the Context Switching feature

We have sql login €œclient€? which is used by clinet application and has very least privelge and have only required access to requried database and tables.
xp_cmdshell is disabled by default on our server and I would like to enable xp_cmdshell, launch the executable on the server and disable xp_cmdshell.I have created another SQL Login €œBob€? and is member of sysadmin. The below SP is created by logging in as €œBob€?. My objective is to grant execute access on this SP and grant impersonate access to sql login €œclient€? . So that client application connecting to SQL server can launch the executable by calling the SP

create proc Bob.[Bob_enable_xp_cmdshell]
with execute as 'Bob'
as
EXEC sp_configure N'show advanced options', N'1' RECONFIGURE WITH OVERRIDE
EXEC sp_configure N'xp_cmdshell', N'1'
RECONFIGURE WITH OVERRIDE
EXEC sp_configure N'show advanced options', N'0' RECONFIGURE WITH OVERRIDE
-- launch the application using xp_cmdshell and disable the xp_command shell

When I try to execute (exec [Bob].[jtr_enable_xp_cmdshell]
) the above SP by logging in as €˜Bob€™, I€™m getting the below error


Msg 15247, Level 16, State 1, Procedure sp_configure, Line 94
User does not have permission to perform this action.
Msg 5812, Level 14, State 1, Procedure jtr_enable_xp_cmdshell, Line 4
You do not have permission to run the RECONFIGURE statement.
Msg 15123, Level 16, State 1, Procedure sp_configure, Line 51
The configuration option 'xp_cmdshell' does not exist, or it may be an advanced option.
Msg 5812, Level 14, State 1, Procedure jtr_enable_xp_cmdshell, Line 6
You do not have permission to run the RECONFIGURE statement.
Msg 15247, Level 16, State 1, Procedure sp_configure, Line 94
User does not have permission to perform this action.
Msg 5812, Level 14, State 1, Procedure jtr_enable_xp_cmdshell, Line 7
You do not have permission to run the RECONFIGURE statement.


Please note the SQL Login €œBob€? is a member of sysadmin fixed role. Thank in advance for you help.

With regards
GK

View 10 Replies View Related

SQL 2005, OPENQUERY And Security Context Switching

Oct 4, 2007

Hi,

I need to allow only a specific group of users to use a linked server. Rather than granting each user access in the linked server I create and give access to a local SQL login "link_user" and then grant the group impersonate to "link_user". The folllowing statements then work fine:


EXECUTE AS LOGIN = 'link_user'

SELECT * FROM OPENQUERY(linked_server, 'SELECT * FROM ...)


But when I use the exact same statements in a stored procedure I get the folllowing error:


Msg 7416, Level 16, State 1, Procedure linktest2, Line 5

Access to the remote server is denied because no login-mapping exists.


I need to be able to work with the result set which is why I use OPENQUERY rather than EXECUTE... AS... AT which works fine also in stored procedures!?

Is there another workaround then to create all users in the linked server security?

Rgds
Bertrand

View 1 Replies View Related

Switching Excel Worksheets Based On Date

Feb 25, 2007

Hello,

I need to pull data from an Excel Workbook (DTS Excel Source) where the data is stored in worksheets that are each named one of the twelve months of the year. The package is fired by a job that runs once a month. Currently, I have to go into the select statement of the Excel source before the process runs and change the name of the Worksheet that the data is pulled from.

How can I set up the sql statement for the Excel source so that I can pull from the Worksheet that contains the name of the current month?

Thank you for your help!

CSDunn

View 2 Replies View Related

Switching Database's And Retrieving Table, Etc Info

Jul 8, 2007

I have a query that gets the tables, columns, indexes, index_columns for all tables in a data base.

But, I need to be able to select any data base on the server
and then drill down into the tables, columns, etc.

I looked at sys.databases but can't see how to relate that to the
sys.tables to extend my query.

Is there a way?

I've looked at the information_schema area and catalog views
but I don't see a solution yet.

View 7 Replies View Related

Failed To Generate A User Instance Of SQL Server Due To Failure In Retrieving The User's Local Application Data Path. Please Make Sure The User Has A Local User Profile On The Computer. The Connection Will Be Closed

Dec 7, 2006

This is my first time to deploy an asp.net2 web site. Everything is working fine on my local computer but when i published the web site on a remote computer i get the error "Failed to generate a user instance of SQL Server due to failure in retrieving the user's local application data path. Please make sure the user has a local user profile on the computer. The connection will be closed" (only in pages that try to access the database)
Help pleaseee

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved