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
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 fileThanks! Jon
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 ***
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.
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.
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?
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?
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.
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?
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
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?
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?
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 ?
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!
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!
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
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
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?
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.
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.
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.
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
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
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()
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.
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?
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