Currently, our application is issuing a 'select count(*) from systypes' command to check to see if the database connection is live (has not been reaped by the firewall.) This is somewhat inefficient. Perhaps a less expensive way to implement this functionality is to issue a ping statement to the instance? At least a more simple SQL query is needed.
I'm sure this function is typical in application architecture. What recommendations do you have for confirming that a database connection is alive and viable from the application?
After digging for some time now into the "guts" of SSRS, I am wondering if anyone out there has any ideas which might help me at this point.
I am trying to write an Invoice report.
Each report can have 1 to n invoices on it. Each invoice can have 1 to n line items (spanning several pages for the larger ones) Each page must have a fixed header and footer with account and payment information on it (the page header and page footer work OK for this).
And here is the problem. Each invoice must also include 1 to n images at the end of the report. 2 on a page and take up an entire 8.5 by 11 inch page. (spanning many pages when many line items exist)
Since the report already has a page header and footer with the report detail stuffed in a table in the middle of the page (report body), I am stuck.
I have read several posts which talk about having a can-grow container with a subreport in the existing footer, but I can't even come close to getting this to work. My footer would have to take up the entire page and having nothing but a subreport in it.
I can not provide a link to the images in the report, as each report must print in its entirety without user involvement (no drilling down).
I am thinking that my report is too complex for SSRS at this time. I would love to be proven wrong by someone on this forum.
Does anyone know how i can keep an ssis package used for real time reporting alive no matter the amount of errors it gets? So for instance the server im streaming to is shutdown for maintenance, and the connection dies, its needs to just keep re-trying. In other words the maximum error count is infinite. i dont just want to set max err count high, i want it out of the picture all together.
I've completed my first SQL project, for which I've built a DTS Package. First thing it does it drop all records in the destination table, before importing new records from a txt file and then massaging them.
After I got done, I realized that if the data source is not available for some reason, the records will still be dropped, the process will fail, and the destination table will be left empty. In this case, leaving the existing records intact would be preferable to not having any.
How can I test that the txt file exists before dropping the records?
Thanks,
Randy
ps: Users will maintain a link to the table. I plan to update the table after business hours. If someone happens to have their linked application open while I'm trying to update the table, will it fail?
What is actually happening when a conversation timer is being used in terms of the dialog_timer column in sys.conversationendpoints? For example, I was using the following query to tell me which conversation timers are currently running:
SELECT * FROM sys.conversation_endpoints
WHERE dialog_timer > '1900-01-01 00:00:00.000'
However, I have noticed that periodically the dialog_timer value goes back to '1900-01-01 00:00:00.000' and the query fails, starting up another timer. Then, the original timer magically appears again, working just fine. So, I changed to this query:
SELECT * FROM sys.conversation_endpoints
WHERE far_service
IN
(
'TimerService1',
'TimerService2',
'TimerService3',
)
But this seems like the long way around and doesn't really indicate that the timer is running or not, just that its present in the sys.conversationendpoints catalog view. What is the proper way to see if timers are running? If one dies for some reason, I need to restart it.
We are having some problems with the SQL Server 2005 Keep Alive mechanism causing dropped connections. The Keep Alive time and interval appear to work as documented. However the number of retries made before dropping the connection seems to be variable. When running Network Monitor I have seen this vary between 3 and 9 retries. The value for TcpMaxDataRetransmissions in the registry is set to 5. Does anyone know what the correct number of retries should be for SQL Server 2005 Keep Alive? Is this dynamically determined or is this a bug?
How viable is it to use MS Access as a front end (via ODBC) to a SQL Server2000 database?The users would access via the internet using a netgear vpn setup.Thanks,Paul S
We tested this new feature ("Keep Alive" for orphant connections to automatically close) with no success - neither the standard properties nor slightly changed properties worked.
We tested like this: SQL Server 2005 - ADO.NET Client The client established an explicit lock on one row at one database. Afterwards we disconnected the client by pulling out the network-cable. We waited about 35 sec for the sessios to close - but nothing happend; we waited another minute but nothing changed. SQL Server Management Studio and the command line "netstat" told us that the connections are alive ... so what went wrong? Did we miss something?
Our goal is, that such "orphant connections" get cleaned up and also their inked locks on the database. BTW we installed the sp1 before all the tests started!
I added a connection (ADO.NET) object by name testCon in the connection manager - I wanted to programmatically supply the connection string. So I used the "Expressions" property of the connection object and set the connectionstring to one DTS variable. The idea is to supply the connection string value to the variable - so that the connection object uses my connection string.
Then I added a "Backup Database Task" to my package with the name BkpTask. Now whenever I try to set the connection property of BkpTask to the testCon connection object, by typing testCon, it automatically gets cleared. I am not able to set the connection value.
Then after spending several hours I found that this is because I have customized the connection string in testCon. If I don't customize the connection string, I am able to enter the "testCon" value in the connection property of the BkpTask.
I need detailed instructions on how to connect to a database from a Microsoft Access 2007 database to a Microsft Office Accounting 2007 database. The accounting database is an SQL 2005 datbase. It has an instance name of "MSSMLBIZ".
When I try I get an SQL error 53. Do not have permissions or database does not exist.
Hi-I have a sql server database, and am wring web apps to access it.I've created databases different ways, and ended up with different owners (eg dbo, nt authorityetwork services...)I also have connection strings using windows authentication, and some using a user name and password.I have read that using windows authentication is the best way to go, as far as security goes, but I have noticed some connectivity issues when I upload the site to the server, and test it remotely. What is the safest 'owner' of the database, and what's the safest way to connect?Thanks Dan
I'm having problems with the code to connect to an SQL DataBase...i'm not experienced with asp.net. I used to work with VB.NET 2003 and SQL Server 2000. Recently i instaled VB.NET 2005 and SQL Server 2005, becouse i couldn't install the earlier VB and SQL (problems with install) so i install the new versions of VB and SQL 2005, but this is like new to me. The problem is that there is new features that i'm not familiarized with...I have this code, a simple code to retrieve data to the webform: ------------------------------------------------------------------------------------------ Imports System.Data.SqlClientPartial Class data-ask Inherits System.Web.UI.Page Private Sub page_load() Dim connection As SqlConnection Dim mycommand As SqlCommand Dim myDataReader As SqlDataReader Dim SQLStmt As String connection = New SqlConnection("Server=matrixWebSite1;uid=sa;pwd=1234;database=aspnet-books;trusted_connection=yes") connection.Open() SQLStmt = "SELECT * FROM books " mycommand = New SqlCommand(SQLStmt, connection) myDataReader = mycommand.ExecuteReader() While myDataReader.Read() Response.Write(myDataReader.Item("books_name") & " - " & myDataReader.Item("book_price") & " Euros<br>") End While connection.Close() End SubEnd Class -------------------------------------------------------------------------------------------What happens is that when i load, the page is blank (no errors is shown) just blank page.I don't know if the connection to database(outside the code) is right (permitions, etc...)Can anyone tell me what is the problem? Thank you....
I am completely new to this so sorry if i am doing something stupid.I have a basic code for connecting to Database but for some reason i get the next error: " System.Data.SqlClient.SqlException: 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: TCP Provider, error: 0 - No connection could be made because the target machine actively refused it.) " By the way, before this i had an error: 40. i have done many things to fix that but now for some reason those little icons has changed their form, i used to does it mean anything? Here's my connecting code. SqlConnection myConnection = new SqlConnection( "server=localhost; database=master; connection timeout=2; Trusted_Connection=yes;");
try { myConnection.Close(); } catch (Exception ed) { Label1.Text = ed.ToString(); } } log:2007-04-24 18:04:25.34 Server Microsoft SQL Server 2005 - 9.00.1399.06 (Intel X86) Oct 14 2005 00:33:37 Copyright (c) 1988-2005 Microsoft Corporation Express Edition on Windows NT 5.1 (Build 2600: Service Pack 2)2007-04-24 18:04:25.34 Server (c) 2005 Microsoft Corporation.2007-04-24 18:04:25.34 Server All rights reserved.2007-04-24 18:04:25.34 Server Server process ID is 4176.2007-04-24 18:04:25.34 Server Logging SQL Server messages in file 'c:Program FilesMicrosoft SQL ServerMSSQL.1MSSQLLOGERRORLOG'.2007-04-24 18:04:25.34 Server This instance of SQL Server last reported using a process ID of 7516 at 24/04/2007 18:04:16 (local) 24/04/2007 16:04:16 (UTC). This is an informational message only; no user action is required.2007-04-24 18:04:25.34 Server Registry startup parameters:2007-04-24 18:04:25.34 Server -d c:Program FilesMicrosoft SQL ServerMSSQL.1MSSQLDATAmaster.mdf2007-04-24 18:04:25.34 Server -e c:Program FilesMicrosoft SQL ServerMSSQL.1MSSQLLOGERRORLOG2007-04-24 18:04:25.34 Server -l c:Program FilesMicrosoft SQL ServerMSSQL.1MSSQLDATAmastlog.ldf2007-04-24 18:04:25.35 Server SQL Server is starting at normal priority base (=7). This is an informational message only. No user action is required.2007-04-24 18:04:25.35 Server Detected 2 CPUs. This is an informational message; no user action is required.2007-04-24 18:04:25.57 Server Using dynamic lock allocation. Initial allocation of 2500 Lock blocks and 5000 Lock Owner blocks per node. This is an informational message only. No user action is required.2007-04-24 18:04:25.59 Server Database Mirroring Transport is disabled in the endpoint configuration.2007-04-24 18:04:25.60 spid5s Starting up database 'master'.2007-04-24 18:04:25.70 spid5s Recovery is writing a checkpoint in database 'master' (1). This is an informational message only. No user action is required.2007-04-24 18:04:25.76 spid5s SQL Trace ID 1 was started by login "sa".2007-04-24 18:04:25.79 spid5s Starting up database 'mssqlsystemresource'.2007-04-24 18:04:26.03 spid5s Server name is 'ALEX-D8997A1AB0SQLEXPRESS'. This is an informational message only. No user action is required.2007-04-24 18:04:26.03 spid8s Starting up database 'model'.2007-04-24 18:04:26.03 spid5s Starting up database 'msdb'.2007-04-24 18:04:26.28 Server A self-generated certificate was successfully loaded for encryption.2007-04-24 18:04:26.34 Server Server is listening on [ 'any' <ipv4> 2936].2007-04-24 18:04:26.34 Server Server local connection provider is ready to accept connection on [ \.pipeSQLLocalSQLEXPRESS ].2007-04-24 18:04:26.34 Server Server named pipe provider is ready to accept connection on [ \.pipeMSSQL$SQLEXPRESSsqlquery ].2007-04-24 18:04:26.34 Server Dedicated administrator connection support was not started because it is not available on this edition of SQL Server. This is an informational message only. No user action is required.2007-04-24 18:04:26.35 Server The SQL Network Interface library could not register the Service Principal Name (SPN) for the SQL Server service. Error: 0x54b. Failure to register an SPN may cause integrated authentication to fall back to NTLM instead of Kerberos. This is an informational message. Further action is only required if Kerberos authentication is required by authentication policies.2007-04-24 18:04:26.35 Server SQL Server is now ready for client connections. This is an informational message; no user action is required.2007-04-24 18:04:26.45 spid8s Clearing tempdb database.2007-04-24 18:04:26.78 spid8s Starting up database 'tempdb'.2007-04-24 18:04:26.84 spid5s Recovery is complete. This is an informational message only. No user action is required.2007-04-24 18:04:26.84 spid11s The Service Broker protocol transport is disabled or not configured.2007-04-24 18:04:26.84 spid11s The Database Mirroring protocol transport is disabled or not configured.2007-04-24 18:04:26.87 spid11s Service Broker manager has started.
Hi I have uptil now only used the WYSIWYG for retrieving info from my DB, but now i want to insert some information to the DB in a sub. My connectionstring is in web.config and is as follows <connectionStrings> <add name="shopConnectionString" connectionString="Data Source=IP.ADRESS.GOES.HERE;Initial Catalog=shop;Persist Security Info=True;User ID=MyId;Password=********" providerName="System.Data.SqlClient" /> </connectionStrings> How do i connect to this connectionstring from inside a sub?
I am not able to connect to my database. When I run the following, I get the meassageSystem.Data.SqlClient.SqlException: SQL Server does not exist or access denied.Although SQL SERVER 2000 WINCC is very much running.Trying to solve the problem for days now. Pl help. pcg <%@ Page Language="C#" Debug="true" Trace="true" %><%@ import Namespace="System.Data.SqlClient" %><%@ import Namespace="System.Data" %><script runat="server"> // Insert page code here // void addtosalelist(Object sender, EventArgs e) { Trace.Write("Note - Entered addtosalelist"); string connectionstring= "server=(127.0.0.1);trusted_connection=true;database=LocalHaat.mdf"; SqlConnection dbConnection= new SqlConnection(connectionstring); dbConnection.Open(); Trace.Write("Note - DB connection set up"); Trace.Write("Note - DB connection opened"); //string commandstring = "INSERT INTO Salelist(sellername, email, address,city,category, itemname, itemdescription,price,paymentmode,negotiable,location) " + "Values(@sellername, @email, @address,@city,@category, @itemname, @itemdescription,@price,@paymentmode,@negotiable,@location)"; string commandstring = "INSERT INTO SaleList(SellerName,SellerCity,ItemName) " + "Values(@SellerName,@SellerCity,@ItemName)"; SqlCommand dbcommand= new SqlCommand(commandstring, dbConnection); SqlParameter sname = new SqlParameter("@SellerName", SqlDbType.VarChar, 30); sname.Value = txtname.Text; dbcommand.Parameters.Add(sname); SqlParameter scity = new SqlParameter ("@SellerCity", SqlDbType.VarChar, 15); scity.Value = city.SelectedItem.Value; dbcommand.Parameters.Add(scity); dbcommand.ExecuteNonQuery(); dbConnection.Close(); } </script> Error MessageSQL 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 11: string connectionstring= "server=(127.0.0.1);trusted_connection=true;database=LocalHaat.mdf";Line 12: SqlConnection dbConnection= new SqlConnection(connectionstring);Line 13: dbConnection.Open();Line 14: Trace.Write("Note - DB connection set up");Line 15: Source File: D:Localhaatsell.aspx Line: 13 Stack Trace: [SqlException: SQL Server does not exist or access denied.] System.Data.SqlClient.ConnectionPool.GetConnection(Boolean& isInTransaction) +472 System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(SqlConnectionString options, Boolean& isInTransaction) +311 System.Data.SqlClient.SqlConnection.Open() +383 ASP.sell_aspx.addtosalelist(Object sender, EventArgs e) in D:Localhaatsell.aspx:13 System.Web.UI.WebControls.Button.OnClick(EventArgs e) +83 System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +57 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +18 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33 System.Web.UI.Page.ProcessRequestMain() +1266
--------------------------------------------------------------------------------Version Information: Microsoft .NET Framework Version:1.1.4322.573; ASP.NET Version:1.1.4322.573 Request Details Session Id: satdf0jfaoo3tzjd31vxa355 Request Type: POST Time of Request: 08/07/2007 19:08:19 Status Code: 500 Request Encoding: Unicode (UTF-8) Response Encoding: Unicode (UTF-8) Trace Information Category Message From First(s) From Last(s) aspx.page Begin Init aspx.page End Init 0.000044 0.000044 aspx.page Begin LoadViewState 0.000070 0.000026 aspx.page End LoadViewState 0.004889 0.004818 aspx.page Begin ProcessPostData 0.004929 0.000040 aspx.page End ProcessPostData 0.009899 0.004970 aspx.page Begin ProcessPostData Second Try 0.009935 0.000036 aspx.page End ProcessPostData Second Try 0.009972 0.000037 aspx.page Begin Raise ChangedEvents 0.009995 0.000023 aspx.page End Raise ChangedEvents 0.010583 0.000588 aspx.page Begin Raise PostBackEvent 0.010612 0.000029 Note - Entered addtosalelist 0.028321 0.017710 Unhandled Execution Error SQL Server does not exist or access denied. at System.Data.SqlClient.ConnectionPool.GetConnection(Boolean& isInTransaction) at System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(SqlConnectionString options, Boolean& isInTransaction) at System.Data.SqlClient.SqlConnection.Open() at ASP.sell_aspx.addtosalelist(Object sender, EventArgs e) in D:Localhaatsell.aspx:line 13 at System.Web.UI.WebControls.Button.OnClick(EventArgs e) at System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) at System.Web.UI.Page.ProcessRequestMain()
Hi all, I am new to ASP and having some problems, please help. I am following an example in a book called "Building database driven flash applications". It is to create a flash based front end quiz with ASPx pages and intergrated sql database through ms sql enterprise 2000. I am using Visual Studio 2003. Im a building the administration side which allows update/delete of players and quiz features. The players page uses a data grid, sql connection control and sql command control to connect to the db. This works fine and displays the data. Players.aspx.vbPublic Class ManagePlayers Inherits System.Web.UI.Page#Region " Web Form Designer Generated Code " 'This call is required by the Web Form Designer.<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent() Me.cnnTriviaGame = New System.Data.SqlClient.SqlConnectionMe.cmdgetplayers = New System.Data.SqlClient.SqlCommand ' 'cnnTriviaGame 'Me.cnnTriviaGame.ConnectionString = "workstation id=LYNDSEYS;packet size=4096;user id=Lyndsey;data source=LYNDSEYS;per" & _ "sist security info=True;initial catalog=Projectdb;password=lyndsey" ' 'cmdgetplayers 'Me.cmdgetplayers.CommandText = "SELECT *, Players.* FROM Players" Me.cmdgetplayers.Connection = Me.cnnTriviaGame End SubProtected WithEvents dgPlayers As System.Web.UI.WebControls.DataGrid Protected WithEvents playersgrid As System.Web.UI.WebControls.DataGridProtected WithEvents cnnTriviaGame As System.Data.SqlClient.SqlConnection Protected WithEvents cmdgetplayers As System.Data.SqlClient.SqlCommand 'NOTE: The following placeholder declaration is required by the Web Form Designer. 'Do not delete or move it.Private designerPlaceholderDeclaration As System.Object Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init 'CODEGEN: This method call is required by the Web Form Designer 'Do not modify it using the code editor. InitializeComponent() End Sub #End RegionPrivate Sub Page_Load(ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles MyBase.Load ' First time the page is loaded (not a form postback) If Not IsPostBack Then ' Create a new SqlDataReader Dim objDR As SqlClient.SqlDataReader ' Open the connection placed on the aspx page cnnTriviaGame.Open() ' Get the data by executing the command on the aspx page objDR = cmdgetplayers.ExecuteReader ' Set the grid data source playersgrid.DataSource = objDR ' Show the data playersgrid.DataBind() End If End SubPrivate Sub dgPlayers_ItemCommand(ByVal source As Object, _ ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs) _Handles playersgrid.ItemCommand ' e.Item is the row of the DataGrid where the link was ' clicked. ' Check for what kind of action the user wants to take If LCase(Trim(e.CommandName)) = "Select" Then ' update player Server.Transfer("UpdatePlayer.aspx?idPlayer=" & e.Item.Cells(0).Text) Else ' View the player's answer history Server.Transfer("ViewPlayerHistory.aspx?idPlayer=" & e.Item.Cells(0).Text) End If End Sub For other pages in the application is says not to connect to the db this way but simply create the command and connection control dynamically in the Visual Basic code. When I click a link in the players data grid to go to another page I get an error. This is the same error for all other pages.
Line 35: ' Open the connection Line 36: objConn.ConnectionString = Application("strConn") Line 37: objConn.Open()
the strconn variable is set up in the global.aspx.vb under the application start sub routine. This is the code it asks you to put from the book:Application("strConn") = "data source=YourServer;" & _ "initial catalog=TriviaGame;integrated security=SSPI;" & _ "persist security info=False;workstation id=Server size=4096" The code I have put in:Application("strConn") = "data source=LYNDSEYS;" & _"initial catalog=TriviaGame;integrated security=SSPI;" & _"persist security info=False;workstation id=Server size=4096"
My server is called: LYNDSEYS My database is called:Projectdb My project is called:myproject and the folder where all my pages are is :"TriviaGame" Does anyone have any idea where I am going wrong please. I dont know if it is a simple mistake i am making. Is the initialcatalog where my database name goes or something else? Help please, I hope I have made sense. Lyndsey x
can i have multiple user and password in a connection string ?? for example : <add name="strCon" connectionString="Data Source=test;Initial Catalog=test;User=test, guest;Password=test, guest" providerName="System.Data.SqlClient" />- or is there any other way ?? the reason is that i have created a view that hits 2 database that requires user info and pass ..............any advice is appreciated
Please someone guide me how to make a connection from a different network / outside to the database server at my office. Do I need to configure anything at the server or my local PC? Thanks.
VS2005 i just wonder how can i avoid repeating my connection string. in every form load and control event, i create connection. is there a way that i will only create once and just call it? i tried using method but it didn't work. it's looking for the connection string.. or maybe I'm doing it incorrectly. pls help!
i am when connecting database latter receiveing exception error.Error is : An unhandled exception of type 'System.Data.SqlServerCe.SqlCeException' occurred in System.Data.SqlServerCe.dll
i am when connecting database latter receiveing exception error.Error is : An unhandled exception of type 'System.Data.SqlServerCe.SqlCeException' occurred in System.Data.SqlServerCe.dll
I registered a domain on Internet. I cannot access my Datatbase on my WebSite. [on www.waist7.com] What connection string Shall I write ?
I created my Database with MSSQLmanager on INTERNET on my domain. I added a new TABLE and some data .
I do not know what I should write in "data source=?????" My database is Called "JOB" so i wrote: Dim SQ as new SQLConnection("Data Source=localhost;Initial Catalog=JOB; user=me;password=myPass;") Where did i go wrong ??? [Maybe 'localhost' should be replaced with something else. ?]
Actually I get A RUNTME ERROR SAYING: "Connection cannot be opened....maye because on default settings you cannot access Databases Remotely !"
I think the mistake is in the connectionString. What is the right connection string ??? Where can I find it Displayed ? [in MSSQLmanager]
Could someone help me out? I am stuck and I don't have $245.00 to pay for Microsoft Technical phone support. Basically I am trying to establish a connection to my database using C#. When I try to connect I can step into the line of code, but an exception is thrown. Error message in the debugger: ServerVersion = 'myConnection.ServerVersion' threw an exception of type 'System.InvalidOperationException'
C# code: SqlConnection myConnection = new SqlConnection("Data Source=BVCOMPUTER;Initial Catalog=TheMarket;User ID =bill;Password=celebrate4ever"); When the above line of code is executed, then In the IDE debugger when I do a watch on myConnection, there is a tree node labeled "ServerVersion" The following messageis displayed there: Also there appears to be a property of "ServerVersion" named "base".The error message stored there is the following: base {"Invalid operation. The connection is closed."} System.SystemException {System.InvalidOperationException} ---------------------------------------------------- Note that I can drag and drop a grid control on my web form and point to the database I want to connect to. But for some reason when I manually try to connect, I am not able to.
I get a Connections to SQL Server Files (*.mdf) require SQL Server Express 2005 to function properly error when I try to create a new SQL Server .mdf database in Visual Web Developer. I tried to re-install SQL Server express but get a message that it is already installed. I also have SQL Server 2005 installed. Could that be the problem?Any help would be appreciated. Thanks.
Hi I have deployed a website on a server having Windows2000, IIS5.0 . It uses SQL Server 2000 which is on another remote server. While developing I used the visual tools in VS.net to make a connection and have used DYnamic properties of the connection object to map the connection string to the entry in to the config file. This works fine on my developement machine which has IIS and SQL Server 2000 on the same machine. The entry in the web.config for my connection string is:
value= " server=xxx.yyy.com; Trusted_Connection=yes;provider=SQLOLEDB.1;Initial Catalog=events; User id=myuser; Password=password;"
where xxx.yyy.com is the server running SQL Server2000.
I do not get any error but the conncetion doesnot happen and my datagrid doesnot get filled. The code for creating the connection is designer generated code. Any clues? -svp
All my dreams will come true with this ASP.NET langauge if I only can succesfully connect to my SQL Server 2000 database... I've tried many ways, many parameters...
Can somebody plz gimma the right code to connect a database?
My question is, are the user id and password optional when creating a database connection string? I've created an asp page without including them, but in my aspx page (which is basically supposed to do the exact same thing as the asp page), I'm receiving the following error:
Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection. 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: Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection.
Source Error:
Line 48: DisplayConnection = New SqlConnection("Server=infomart;Database=psg") Line 49: DisplayCommand = New SqlCommand("SELECT RollOutID,RequestedDate,Background,Product,StagingPushDate,ProdPushDate FROM rolloutrequests ORDER BY RollOutID DESC", DisplayConnection) Line 50: DisplayConnection.Open() Line 51: DataGrid2.DataSource = DisplayCommand.ExecuteReader() Line 52: DataGrid2.DataBind()