Why Isn't The SQL Database Being Connected?

Jun 9, 2006

if not Page.IsPostBack then
            Dim strConn As String = "server=(local);database=NORTHWND"
    Dim sql as string = "Select EmployeeID, FirstName, LastName from Employees"
    Dim conn as New SQLConnection(strConn)
            Dim Cmd As New SqlCommand(sql, conn)
            Dim objDR As SqlDataReader
            conn.Open()'This is where it has an error and says-- 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.

The NORTHWND database is set up in the web.config file

Thanks!

 Jon

View 3 Replies


ADVERTISEMENT

Database Cannot Be Connected??

May 19, 2008

Dim delconn As New SqlConnection _
("data source=15-46SQLEXPRESS;AttachDbFilename =C:Program FilesMicrosoft SQL ServerMSSQL.1MSSQLDataProjectDB.mdf; Integrated Security=True;")
 
this is my coding,
anyone can spot an error from there??
the database can't be located somehow....
 help me ,for god sake
 

View 1 Replies View Related

Connected To Which Database

Jul 20, 2005

Hello all,I have a scripts which needs the information about the database inwhich it is running.How can I find out this information.For example if I want to know the User who has satrted this report, Iuse the SYSTEM_USER procedure.Does an equal procedure exist to find out, on which database the useris connected to.RegradsFranz-Josef

View 1 Replies View Related

Last Time Someone Connected To A Database

Aug 11, 2005

Hello all,Is there a way to figure out when was the last time someone connected toa database? SQL 2000 environment.Thanks,Raziq.*** Sent via Developersdex http://www.developersdex.com ***

View 5 Replies View Related

List All Users Connected To Database

Dec 14, 2007

Hi,

I need to be able to list all User connected to a particular database, after doing a bit of playing I have writen a simple view in the database to show this information which looks like

select spid, status, loginame, hostname, blocked, db_name(dbid), cmd from master..sysprocesses where db_name(dbid) = 'AutoCost2008

But my problem is that as this needs to be run from an application where the user is logged on as a standard user and therefore when this is run it only shows the current user, I am not sure what permissions I need to give this login to allow them to view all users connected to this database without giving them full Admin permissions, can anyone please help.


Thanks,


Gavin,

View 3 Replies View Related

Open Database In A Connected Device

Jan 19, 2007

Hi Everybody:

I'm writting an standar application in c# that comunnicates with a sql server 2005 in a mobile device. The mobile device is connected to the pc with an usb wire. In the sample I've made, I've inserted in the form main a datagridview. I go on the wizard to select the data source. I choose a Microsoft SQL Server Mobile Edition data connection. The data source is tge activesync mobile device. I create a new database in the mobile device called test.sdf. The wizard has a button to check the conecttion and it rules. A new connection appears in the server explorer. I add rows through a query. I build the solution and no problem, but when I start the debug session an sqlceexception occurs: Data Source not found. In the database connection that the project has created the connection string is: Data Source ="Mobile Device est.sdf";

I didn't write any code. I just went on the wizards. All the code has been inserted by visual studio 2005.

Any idea?

View 3 Replies View Related

How Can I See To Which Database And Table The Web Service Is Connected To?

Dec 4, 2007

Hello All!

I have one web service, which Im testing.
I would like to connect it (the web service) to a a database with the same structure as the old database I was using before.

Only difference is the name of the database and that the web service was done in visual studio 2003.
I have now VS 2005.

Can this be done through Microsoft SQLServer management studio express?

Or how can I see to which database and table the web service is connected to?


Thanks in forehand!

Nikita

View 1 Replies View Related

Publish C# Project Connected To Database?

Aug 10, 2015

i want ti publish a c# project connected to sql database, i introduced the database into my project, i use the connection string: 

  SqlConnection cn = new SqlConnection(@"Data Source=CONTA-LAPTOP;Initial Catalog=RaducuIonel;Integrated
Security=True");  if right click on the database-> properties iti show me next connection string: Data Source=CONTA-LAPTOP;AttachDbFilename="C:Program FilesMicrosoft SQL ServerMSSQL10.MSSQLSERVERMSSQLDATARaducuIonel.mdf";Initial
Catalog=RaducuIonel;Integrated Security=True    

...when i connect to server in sql i use windows autentification. And the last thing: when i publish the project it ask me: application will check for updates from [URL] or application will not check for updates. I select first option: to check for updates from here: [URL] .to another computer my application cannot connect to database (login error) .what i am doing wrong? 

View 2 Replies View Related

SQL Server 2008 :: How To Find Who Is Connected To A Database From DMV

Sep 16, 2015

I have a query that finds all SPID's connected to a particular database:

select d.name, p.*
from sys.databases d join sys.sysprocesses p
on d.database_id = p.dbid
where d.name = 'my_db'

But now we have a new rule that we should not use outdated compatibility views, and one of them is sys.sysprocesses. I checked sys.dm_exec_connections/session/requests but failed to replace my existing code. The first two don't have dbid, the last one, requests, has it, but it selects only currently executing statements.

View 0 Replies View Related

SQL Server 2008 :: How To Find Who Is Indirectly Connected To A Database

Feb 25, 2015

Recently I needed to find all processes connected to a particular database, let's call it Test_db. I have a simple query to find all connections to my database:

select *
from sys.databases d join sys.sysprocesses p
on d.database_id = p.dbid
where d.name = 'test_db'

But there was a process that was connected to another database like USE another_db_name; but was actually selecting from tables in test_db. Is it possible to catch such connections?

View 7 Replies View Related

Transact SQL :: Accurate Count Of Workstations Connected To Database?

Nov 2, 2015

How do I get an accurate count of workstations connected to a database?

View 7 Replies View Related

Select Data From Table In One Database Server While Connected To Another Database Server.

Dec 18, 2007



Hi,


Is there a way in SQL Server 2005 to use a select statement to fetch data from a table in another Server while running the query in one Server.

Like using a database Server Link in oracle...


Thanks
Pramod

View 8 Replies View Related

The Database Created Using Management Studio Cannot Be Connected To Visual Studio???help

May 13, 2008

 
 
I have created a database under management studio and i want it to be connected in visual studio but it failed
the error msgs said that the database can't be connected coz the database with same name exits but that is not true

View 2 Replies View Related

All Users Connected As SA!!??

Oct 11, 1999

Beginning this morning, when I look in Current Activity in our SQL 6.5 Server, all trusted user connections to my server are showing up under "SA".
We are running mixed security. Most of the connections are through ODBC. We have applied SP5a to SQL.
As far as I know, nothing in SQL has changed. From what others are telling me, nothing in NT or the network has changed.

Something is up. What am I missing? Where can I look?

Please help.

View 2 Replies View Related

Cannot Get Connected To My SQL Server

Mar 23, 1999

When I try to connect to my SQL server I get the following error.

Microsoft SQL Enterprise Manager
A connection could not be established to MLM1-[SQL Server] Cant allocate space for object 'Syslogs' in database 'tempdb' because the 'logsegment' segment is full. If you ran space in syslogs dump the transaction log. Otherwise use ALTER DATABASE or sp_extendsegment to increase the size of the segment.

Ok, I am not up on SQL so I'm not sure how to dump my tempdb database. I have a coworker that has only done this sort of thing in the Enterprise Manager and we can't get there. So how do I do this and make sure that I don't blow away any data? Also if I do dump my tempdb will this cure my problems and how do I avoid having this happen again?

Any help would be greatly appreciated,
Jeb

View 1 Replies View Related

Who Is Connected : Aspnet Or Iusr_

Apr 18, 2007

Hi

I spent the whole week trying to find a solution with a problem of authorization/access on a new website (aspnet2 + slqserver 2005)

The site was running well in the test environnement but once deployed the production site behavior was quite erractic. some clients run ok, others not and that changes for the same client with each session.

it appeared that the problem came from the access to stored procedures. sometime, theirs accesses were authorized sometime denied.

finally, tests showed that the client's userid was either aspnet or iusr_

by putting the same permissions on these 2 accounts, the problem is solved and all the clients are running fine.

now the question : for which reason the client connect randomly to one or the other of these 2 id ? is this normal ?

best regards

View 1 Replies View Related

Can ASP.net 2.0 Be Connected With SQL Server 2000?

Jan 7, 2006

using  vs2005 to build  web pages of asp.net 2.0, The database is SQL  Server 2000,.But I always fail to connect.
using the following  configuration in web.config:
<appSettings>  <add key="DSN_student" value="server=(local);uid=admin;pwd=123456;database=network_course"/>   </appSettings>
I also failed to connect using  the following configuration in web.config:
<add name="network_courseConnectionString1" connectionString="Data Source=(local);Initial Catalog=network_course;User ID=admin;Password=123456;"   providerName="System.Data.SqlClient" />
I am a beginner from  China  and eager to get answers! Thank you!
 

View 2 Replies View Related

SQL Srv MSDE - Not Connected Aft Install

Oct 14, 2004

I have just installed Windows 2000 Pro, Visual Studio 2003 Academic and , MSDE 2000. I get the little icon in the Service Tray(?) showing an empty circle partially overlaying a server symbol. It says Not Connected-VSDOTNET.
If I click it and get SQL Server Service Manager and put in Server name of VSDOTNET, The drop down listbox for SERVICES is empty (no SQL Server choice)
I enabled TCP/IP for this server thru SVRNETCN.DLL. I'm a newbie to pc development. Help!

View 1 Replies View Related

Display Connected Users

Mar 22, 2007

Hi everyone,

I have one Inventory system which is in VB6 and SQL Server 2000.
In my database there is table of users and userrights.

These are my application users. They are nothing to do with Windows users and SQL Server users. I am connecting to database using 'sa' login.

Now I want to display all my online users. I tried with @@SPID to manage their but not getting the exact results.

Thanks in advance.


Riyaz

View 5 Replies View Related

Can Users Be Connected During A SQL Backup?

Mar 19, 2008

We have a existing backup, re-index job that runs at night on anexisting database that is now accessed by web users 24/7.Problem is that one of the steps is to kill all users before backupstarts so it kills any transactions that are happening at that timequestion is... Can users be connected during a backup? Will removingthe kill users step slow the backup alot?any other suggestions would be appreciated.thanks

View 1 Replies View Related

List Of Connected Users

Mar 7, 2008

sorry about asking basic question, just slipped out of my mind,
how to get the list of currently connected users on one database and on whole server in sql server 2005

thanks,

View 9 Replies View Related

How Many Users Are Connected To My Aspnetdb (SQL SERVER)?

Jan 18, 2008

I have uploaded my site on localhost and sharing on intranethow can i answer these question? Q1) How many users have loggedin? and using my database?Q2) Which table has lots of load?Q3) how can i immediately close particularly connection?  

View 4 Replies View Related

Maintaining A Log For The Users Connected To Sql Server Db.

Dec 8, 2005

Hi !

I need to maintain a record such as how many time any user (e.g, sa) connects to the sql server. Means whenever any person is connecting to the database through application or directly, then i need to know that through which sql user(e.g sa), any body connected.

Regards,
Shabber Abbas Rizvi.

View 1 Replies View Related

View Users Connected To SLQ Server?

Jul 20, 2005

Is there a utility that will allow me to see what users on my network areconnected/active on SQL server?Ryan

View 4 Replies View Related

I Have Some Problem When I Connected To Informix By SSIS

Jul 16, 2007

Hi all,

I have problem when I connect to Informix by DataReader Source(SSIS)

Look for error report


Error: 0xC02090F5 at Data Flow Task, DataReader Source [1]: The component "DataReader Source" (1) was unable to process the data.

Error: 0xC0047038 at Data Flow Task, DTS.Pipeline: The PrimeOutput method on component "DataReader Source" (1) returned error code 0xC02090F5. The component returned a failure code when the pipeline engine called PrimeOutput(). The meaning of the failure code is defined by the component, but the error is fatal and the pipeline stopped executing.

Error: 0xC0047021 at Data Flow Task, DTS.Pipeline: Thread "SourceThread0" has exited with error code 0xC0047038.

Error: 0xC0047039 at Data Flow Task, DTS.Pipeline: Thread "WorkThread0" received a shutdown signal and is terminating. The user requested a shutdown, or an error in another thread is causing the pipeline to shutdown.

Error: 0xC0047021 at Data Flow Task, DTS.Pipeline: Thread "WorkThread0" has exited with error code 0xC0047039.

SQL Command :
select * from hist_itenary
where book_no in (select book_no from book where updt_date_time like '2007/07/07%')

but when i use this command that not contain where statement(select * from hist_itenary ), this command has working.


Thank you for your answer



chonnathan

View 3 Replies View Related

Access Forbidden: Too Many Users Are Connected

Oct 22, 2007

I have a web application that runs on IIS on Windows XP professional. I have reached the max number of connections to the IIS website. So, I tried the approach of disabling HTTP Keep-Alives.


All is fine and dandy until my Business Intelligence Studio report project attempts to set the parameters for a report using report viewer at which point I get the following error message:


"The request failed with http status 401: access denied."


How can I fix this? I have posted this over at the asp.net forums, but I figured I would check here to see if anyone else has solved this problem.

View 1 Replies View Related

When Windows Firewall Is ON, SQL Server Does Not Get Connected Thru TCP

Jul 27, 2006

I am using SQL Server 2005 Express + SP1 on a Windows Small Business Server(SBS) box. The SBS is connected to a client thru LAN.

Following are what I gave as IP address and DNS on the server:

IP: 192.168.16.2, subnet mask : 255.255.255.0, Preferred DNS server: 192.168.16.2, Default gateway and Alternate DNS Server blank

On the client, I have,

IP: 192.168.16.4, subnet mask : 255.255.255.0, Preferred DNS server, Default gateway and Alternate DNS Server blank

I can ping and connect to either of the machines.

If I do a sqlcmd -S "tcp:servernameINSTANCE,port", I get the following error message:
HResult 0x80090304, Level 16, State 1
SQL Network Interfaces: The Local Security Authority cannot be contacted

Sqlcmd: Error: Microsoft SQL Native Client : Cannot generate SSPI context

If I do a sqlcmd -S "tcp:192.168.16.2INSTANCE,port", it connects to SQL Server.

I have the Windows Firewall ON. If I Off the firewall, I do not have any problem at all.

I included File and Printer Sharing, sqlsvr.exe in the Exception list of the Windows Firewall.

Any help to solve the issue is appreciated.

Thanks.

View 7 Replies View Related

Help! New Reporting Services Install Cannot Be Connected To!!

Nov 2, 2007

Help!!


I've installed Sql server 2005 enterprise edition in full onto windows server 2003 as investigating the BI option. All fine except reporting services just fails to connect to the reports server. Im connecting using management studio on the same machine ie local.

charecteristics:
- Currently using the same Domain administrator username and password everywhere as in testing as dont want to be sidetracked by connection issues- has total access across the network.
- http:\servername
eports works fine but httpervername
eportserver does not work
- Reporting services configuration is showing all green ok symbols and that connects fine
- all other components are fine.
- Changed to TCP & named pipes for database in Surface config but no luck (in the features section of this tool clicking in windows integrated security brings up same error

Getting a long piece of HTML code message which can't copy, but the 2 key parts of the error message below seem to be:

1) "Client found response content type of 'text/html; charset=utf-8', but expected 'text/xml'." which is at the top
2) "The file you are attempting to save or retrieve has been blocked from this Web site by the server administrators." in the body


Any ideas as need to fix asap

Many Thanks

Ash

View 4 Replies View Related

Sql Query Statements &&amp; ADO.NET Connected Classes.

Oct 9, 2007

Hi all,

Do I still need to write the .sql query statements (in SSMS) if I use the ADO.NET connected classes like GetSchema method or the DbDataAdaptor Object?

I'm very new to Visual Studio 2005 & SQL Server 2005..

Thanks!

View 3 Replies View Related

Error After Db Failover If Client App Already Connected To Db

Apr 7, 2008

The following looks very much like the problem reported for the JDBC driver.

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=688897&SiteID=1
https://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=191767

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

I've written a small VB .Net app using Visual Studio 2005 to test mirroring from the client's perspective.

I have a button that does the following: 1) opens a connection to a sql 2005 database (SP2), 2) uses the connection, 3) closes the database connection.

After running this code, but while the client app is still running, I failover the database to the failover partner.

When click my button again, I get the following 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)". Checking the Event log on what is now the mirror, I see a string of "18456 Login failed for user 'testuser'"

If I close the app and launch it again, it does the right thing (and connects to the new primary). Also, instead of closing/re-opening the app, if I wait long enough (e.g. 10 minutes), then try again, it connects successfully to the new primary. Finally, instead of closing/re-opening the app if I tweak the connection string (e.g. change the application name) then try to connect again, that also works.

Based on articles I've read online, I've disabled the connection pool in my connection string, but that didn't solve my problem (although I'm getting a different error than if pooling is on).

Here is the connection string I am using:

Data Source=DB1PACS,12345;Failover Partner=DB2PACS,12345;Pooling=False;Initial Catalog=PACSTest_Client;Integrated Security=No;User ID=testuser;Password=*****

Here is the code snippet that I run before and after the failover. Based on the fact that I'm not using Pooling, the ClearAllPools() if overkill. Any help would be appreciated; I've been researching this for days without luck.

I can keep clicking the button that runs this code, and it keeps failing. If I wait long enough (e.g. 10 minutes) and then click the button again, it works. Or I could quit/restart the app, or tweak the connection string.

Dim TestClient_Connection As New SqlClient.SqlConnection(txtConnectionString.Text)

If Me.DataGridView1.Rows.Count > 0 Then Me.Test_ClientDataSet.Clear()

Try

TestClient_Connection.Open()

Me.User_TTableAdapter.Connection = TestClient_Connection
Me.User_TTableAdapter.Fill(Me.Test_ClientDataSet.User_T)

TestClient_Connection.Close()
TestClient_Connection.Dispose()
SqlConnection.ClearAllPools()

Catch sqlex As SqlClient.SqlException

txtErrorMessage.Text = "Error State: " _
+ sqlex.Errors.Item(0).Number.ToString _
+ " Message: " + sqlex.Message

End Try


Similar to the JDBC driver article I mentioned, when using the connection string above (where DB1 is the principal and DB2 is the failover partner) if DB2 is the actual principal when I initially query and close the database connection, then after failover to DB1 my application reconnect just fine.


Thanks

View 8 Replies View Related

Mirroring Databases Connected Through A View

Oct 12, 2006

I have two databases db_A_primary and db_B_primary, both databases are on one Primary server.

db_B_primary has a View into db_A_primary.

Scenario: db_A_primary goes down and failsover to db_A_mirror on the Mirror server.

In this scenario when the View in db_B_primary is accessed will it automatically be redirected to look at the db_A_mirror database on the Mirror server?

Barry.

View 3 Replies View Related

T-SQL (SS2K8) :: Query To Display All Data Connected To ID In One Row

Oct 23, 2014

I have a table that I am trying to query to display all data connected to a id in one row. What is the best way to achieve this?

Something like this:

ID| CRS1 | CRS2 | CRS3| CRS4 ....
1 | A101 | A102 | A103 | A104 ....

CREATE TABLE Class
(
id int,
yr int,
trm varchar(2),
crs varchar(30)

[Code] .....

View 3 Replies View Related

Drop Temporary Tables Whilst Connected ?

Jul 20, 2005

Just a quicky about temporarary tables. If using QA, when you create atemporary table, it gets dropped if you close the query. Otherwise youneed to state 'DROP TABLE myTable' so that you can re-run the querywithout the table being there.Sometimes, you can have quite lengthy SQL statements (in a series)with various drop table sections throughout the query. Ideally youwould put these all at the end, but sometimes you will need to dropsome part way through (for ease of reading and max temp tables etc...)However, what I was wondering is :Is there any way to quickly drop the temporary tables for the currentconnection without specifying all of the tables individually ? Whentesting/checking, you have to work your way through and run each droptable section individually. This can be time consuming, so beingnaturally lazy, is there a quick way of doing this ? When workingthrough the SQL, it's possible to do this quite a lot.ExampleSQL Statement with several parts, each uses a series of temporarytables to create a result set. At the end of a section, these worktables are no longer needed, so drop table commands are used. Thefinal result set brings back the combined results from each sectionand then drops those at the end.TIARyan

View 2 Replies View Related







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