To Maintain Two Different Connections For Different Servers In ASP.Net Application(sql Server And Oracle)
Oct 10, 2007
I am working in ASP.NET 2.0 and using sql server 2000 as backend . In my
application i need to insert/update to oracle database table lying on
different server. Please let me know how can i maintain two different
connecttions to different databases lying on different servers.....
I am working in ASP.NET 2.0 and using sql server 2000 as backend . In my application i need to insert/update to oracle database table lying on different server. Please let me know how can i maintain two different connecttions to different databases lying on different servers.....
I have two production servers in the same data center. I need to ensure that database remains available if a catastrophic server failure or a disk failure occurs. I need to maintain transactional consistency of the data across both servers. I need to achieve these goals without manual intervention. I was suggested to use this optionTwo servers configured on the same subnet. SQL Server Availability Group configured in Synchronous-Commit Availability Mode<<<<But I think the correct answer should be Two servers configured in Windows Failover Cluster in the same data center SQL Server configured as a clustered instance<<<<
Hey everyone, I'm new to .NET and I've recently inheirited a rather large and busy asp.net website. I was asked to add a testimonials section on each page that will randomly pull a testimonial out of the db. This is fine, however, I'm getting random errors about the DB connection either being closed or connecting. Here is the code for the testimonials class: 1 public SqlDataReader GetTestimonials(ref SqlDataReader reader, int iCatID, string sLanguageType)2 {3 SqlCommand cmd = new SqlCommand("sp_DVX_Testimonials_Fetch", Connection);4 cmd.CommandType = CommandType.StoredProcedure;5 6 cmd.Parameters.Add(new SqlParameter("@Cat_ID", iCatID));7 cmd.Parameters.Add(new SqlParameter("@LanguageType", sLanguageType));8 9 reader = cmd.ExecuteReader();10 11 return reader;12 } I know this isn't the best way to do this (especially for each page[this site averages about 1000 hits a day]), so I was wondering was--is there a way to maintain a single DB connection that's set up in the Application_Start that will maintain the connection so I don't have to worry about this error. If not, does anyone and any ideas as to what would help? Thanks in advance!
I need the application not to expire the session always. I need to maintain the session always even if the user keeps the web application idle for long time.
We have a Silverlight based application which currently supports only one production version. Idea is to support three concurrent versions of the same application and user will switch to the newer versions based on their interest or they can still continue with the older version.
We still have to use the existing database for all these three versions.
What is the best way to architect this so that we can differentiate the code between the versions and still keep the data in sync and run all the versions in parallel.
Hello,Newbie of sorts. Been reading up on best practices though.I'm trying to optimize performance to the SQL DB vs. the Web server andan ASP application. I've read that you're supposed to open late/closeearly which makes sense. In the past I'd created a connection and thrownmany queries against the same connection. Now, I'm working with arecordset object which is returned and the ActiveConnection is closedafter each query. My impression was this was faster ... not sure though.That might be more of an ASP question but let me elaborate on the SQLserver side:I was using the SQL Profiler to try to watch connections. I wasn't evensure what fields to show, but I was watching SPID's and Event Classesfor the user in question. I'd see Audit Login and Audit Logouts, butwasn't sure how they matched up.- When I had a single connection object with many queries against them,there'd be multiple SPID's showing up as Login and Logout.- When I had multiple connections each with a single query, there'd onlybe a single SPID wich each sql query being shown.My initial assumption was that each SPID was a connection, but I'mthinking that's not quite right.Is there a way to watch connections come and go? I'm just using anordinary ODBC connection for now.Any help would be appreciated enormously. Many thanks,rob
I have setup a database mirroring session without witness - ServerA is the principal, ServerB is the mirror,. Each SQL Server instance is hosted on its own machine on sql2005 EE SP2. The mirroring is working correctly. If I submit to server ServerA command:
ALTER DATABASE MYDBNAME SET PARTNER FAILOVER
, ServerB becomes the principal, it means that mirroring works correctly.
My issue is with the SQL Native Client and a front-end ASP application (actually IIS 6.0 site) that needs to make use of this database. I have setup my front-end application to use SQL Native Client and specified the failover server in connection string. Here is the connection string that I am using :
Everything works perfectly on my front-end application when ServerA is the principal. If I execute on server ServerA command:
ALTER DATABASE MYDBNAME SET PARTNER FAILOVER
, ServerB becomes the principal, and the failover occurs correctly on the database side. The problem is that my front-end application is not able to query the database on ServerB. The error appears:
Microsoft SQL Native Client error '80004005'
Cannot open database "MYDBNAME" requested by the login. The login failed.
This behavior my appication till I unload IIS 6.0 pool application. After that my front-end application becomes work correctly with ServerB.
When I swap server, I execute on server ServerB command:
ALTER DATABASE MYDBNAME SET PARTNER FAILOVER,
my IIS 6.0 application automaticly turn back to ServerA without any action on my side.
I am using SQL Native Client last version http://download.microsoft.com/download/2/7/c/27c60d49-6dbe-423e-9a9e-1c873f269484/sqlncli.msi (issued in February 2007). Has anyone experienced this issue? I'm thinking that it's a problem in the SQL Native client
Does anyone know where I can get some good examples of how to set up a linked server to an Oracle data source in SQL 2000? I can't seem to get a link set up to my Oracle database. In particular I am wondering how the communication works between OLEDB to the Oracle Instance and how to trouble shoot issues (for example, would is the Oracle Listener what OLEDB is talking to?) Thanks!!
My application which ran perfectly well yesterday suddenly stopped working in this morning with following error message. I didn't change anything, at least I believe. Interesting thing is that I don't use any Oracle connection but connects to MS SQL Server 2005 Express version locally. Error messages are different according to the connection string though I don't think it makes difference: ConnectionString = <add key="Databasehandtool1" value="Data Source=.SQLEXPRESS;Database=handtool;SSPI=true" />ErrorMessage from VS2008 ="Unable to get records. Object reference not set to an instance of an object." ConnectionString = <add key="Databasehandtool1" value="Data Source=.SQLEXPRESS;Database=handtool;User Id=handtool_DB;Password=mypassword" />ErrorMessage from VS2008 = "Unable to get records. Unable to connect to database. ORA-12154: TNS:could not resolve the connect identifier specified." By the way, the application was generated from IronSpeed 5.1 Enterprise. My development environment is : VS2008, SQL2005 EXPRESS, Windows XP SP2, ASP.NET 2.0 We have actually an Oracle server in the network though. My gut feeling is that something might have changed in my network server during the night but how come it can possibly affect my application running on my local PC. I checked the connection of local SQL Express Server from SQL Server Management Studio and it connected well with UserID=handtoo_DB and showed all tables and stored procedures required for the application. So there is no problem in SQL Server database side. I would welcome and appreciate any input. fudata
I was wondering if there is a way to move ODBC connections between SQL servers? We are replacing our current server with newer hardware, and I have pretty much everything figured out except this.
Hi, What I want to do is simple to explain, hard to obtain (i guess): I want to fill a dropdownlist with the names of the sqlservers detected on the system. I´ve installed a sw recently that prompts for that, and when you select that server, then it prompts you to insert username and password, and then appears a dropdownlist again with the names of the databases of that sqlserver. Is this possible to do, at least fill dropdownlists with sqlservers and database names?!?I don't see how, thanks!
I'm rapidly understanding that much more of my application as a whole is in SQL Server that I would have originally thought.
Stored Procedures Triggers Constrains And so on
It generally means that some of the stuff I'd have naturally done in the Business Layer might be best done in SQL - certain issues in the Business Layer might be best being triggers or constraints for example...
One thing that still puzzles me, and I'd like some references or advice now as it's a blank area in my mind is how this interfaces to your asp.net code.
Obviously I call stored procedures and the like from code, and use parameters, etc, not problem, it's more what I do when these stored procedures or associated triggers fail (or a constrain fails - though this should be less likely)?
SQL sends back an error? But what? Then what do you get your page to do, especially if SQL failed midway through a 'big' transaction? Do you have save 'where the user was somehow' so they don't start inputting again?
It's all a bit vague at the moment, some detail would be nice? :)
Coldfusion Web appls from Oracle to SQL Server 2005 - How to use Application Roles in Coldfusion.
Is there anyone who has used application roles in Coldfusion Applications? How would you set this up?
I know how to set up application roles. If you establish your application role and you move from one page to another, how would you run cfquery since you loose your initial user connection in place of the application role connection. Are there alternatives to using application roles in Coldfusion?
Hi, I have developed .NET application on 32-bit system with Oracle 10g and works very well. When I have deployed the application on the Client server I am getting the following error
"Attempt to load Oracle Cleint libraries threw BandImageFormatException. This problem will occur when running in 64 bit mode with the 32 bit Oracle client components installed"
I did have installed Oracle x64 bit client on the system still getting the same error. I have tried to uninstall the oracle instances and also installed ODACHome for .NET as well (64-bit). No luck so far.
I tried to use VS 2005 to connect to the Oracle instance and I still go the same error.
I tried to used the System.Data.OracleClient namespace with following code snippet OracleConnection con = new OracleConnection(); con.ConnectionString = "Data Source=testdb; User ID=scott; Password=tiger"; con.Open(); con.Close();
Same error.
Is there any way that you guys know of or if anyone has come across this situation please advise me on how to over come this issue.
I have been investigating the number of connections activeinactive to a certain database server and I have stumbled across an application which seems to not be clearing its database connections.For one instance of a client there was >70 sql connections which eventuated from the closing and reopening one 1 screen in the culprut app. Once the application was closed all of the connections are recycled but its evident that within the application itself it is not correctly reusing already existing open connections.
I have raised a point with the main programmer that we need to investigate more into how the application is managingot managing its ADO .NET connections to SQL.
I am starting with doing some reading here URL... and I was hoping to get some more information about the possible impact of excessive sql connections on the SQL Server itself. Our organization is quite lucky in that our SQl Servers are Overspecced given their workload, bearing that in mind I would like to dig a bit deeper to get some stats if I can to highlight the scope of the issue to the managementprogrammers.Our SQL server peaks at 6500 processes and a good 70% of those are due to this applications mis-management of its sql connections.
I created linked server to Oracle 8.0.5 on ODBC data source. When I run query like: select * from linked_server_name..Schema_name.Table_name it hangs up I read in Books Online that the syntax is: linked_server_name.catalog.schema.object_name What is the _catalog_?
And also, is there a way to run PASS THROUGH QUERY against linked server, but not using OPENQUERY?
Running SQL2000 on Win2000 server. Installed Oracle8 client from Oracle for Winnt CD. This appeared to install OK could use SQL*PLUS to link to Oracle servers. Setting up a Linked server and then doing an openquery gave an error:
' msadora reported an error ole/db returned a message Oracle client & networking component were not found ..'
Any ideas? Should we have a Oracle for Win 2000 CD. It worked for SQL2000 on Winnt server.
I was told in one of my systems classes that the real performance bottleneck in accessing information from the database was the opening of a connection from the application to the database.
To combat that problem I was advised to use a Singleton Factory pattern and to have that Factory instaniate a connection and open it, then pass references to that connection for all of the objects that it created. All of those objects passed the connection reference to the objects they created and so on. Basically that meant that I only ever had one connection open at any one time for my entire application. And I was able to implement this solution at my previous job where I was developing in Oracle. I primarially used OracleCommands and OracleDataReaders to get the informaton into and out of the database. I thought this was a very nice solution. Having this many DataReaders accessing a single connection was not a problem because OracleConnections don't get locked from having more than one DataReader open at once.
At my current job, however, I use SQL Server. I am concerned that the single connection will not work in my new enviroment as the SQLDataReaders lock up the connection while they are using it. If the information that I recieved about opening connections being the real bottleneck, then I am hesitant to have a connection instanciated and opened for each method, but I am concerned that a whole lot of errors will be generated if I use the single connection method. Also, how do DataAdapters effect my decision of which approach to use.
Any advice would be most helpful. If you have any questions that would help answer just ask. Thanks.
i am having 2 sql servers one is web sql server server and other server is my local sql server. i am making web application through which i want to connect both sql servers at a time and by selecting data from web server i want to insert it into my local sql server both having same database on which i want to work , i want to know how it can be done my idea as follows in web.config i specify 2 connection string and by selecting data from websql server database table i going to store it in dataset and then i return dataset to another function which connects to local sqlserver database.but database records are much large. can any body guide me . i am going to place my web application on local server (C# asp.net 2.0) . thank you,
i tried this code c# file public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) {
//dr.Close(); //dbcon2.Close(); } web.config<configuration> <appSettings> <add key="abccon1" value="Data Source=comp01;Initial Catalog=abc;User Id=sa ; Password=sa"/> <add key="abccon2" value="Data Source=comp01;Initial Catalog=abctest;User Id=sa ; Password=sa"/> </appSettings> <connectionStrings/> this 2 databases are from single my loacl server it wont work it gives exception please healp me.
We have Oracle-based enterprise resource planning (ERP) application that facilitates order entry, invoicing, dispatch, stock management, and purchasing. However, it took as much as 30 seconds to perform queries from the remote offices, which were linked via Frame Relay.
Any experiences or ideas shared will be greatly appreciated.
We are planning to move all of our System Center Databases that reside on front end servers to each system center application to a centrally located SQL 2012 server. We'd like to centralize everything and have our DBA care for the server. here is our setup:
SCOM has 1 monitoring and 1 Data warehouse server. SCCM has 1 server with all roles on it. DPM database is on the same server as Application. Same with SCVMM. I have 2 questions regarding this move:
1. Can I have all these databases running on 1 SQL instance?
2. Is there a best practice document that highlights steps and "gotchyas"
I am going to use the backup and restore function to copy data from one server to the other server. We would like to keep the servers in sink at this point (not instantaneously but update the server say once a day) and I would like to do this by using the back up transaction logs. I have tried to back up from individual transaction logs but in also seems to restore the full database also. The database is roughly 6 gig and transaction logs are about 25- 50 meg. I really do not want to have to restore the database every time.
I know I could set up replication but this has been more of a pain administering this on a daily basis. I would like to do a schedule and forget type of thing. This is going to be done on 6.5.
I am trying to export the result of a select into a .csv file using SQL Server 2000 DTS. The data for varchar fields has leading zeroes in the database, which is very much required in the csv file.
But, the .csv file trims the leading zeroes. How do we force to maintain the same data as in source?
I had used Text File Destination Connection as the destination, with the below options File Extension: .csv File Format: Delimited File Type: ANSI Text Qualifier: Double Quotes ("") Row Delimiter: {CR}{LF} Column Delimiter: comma
Source Data: 0123 Target Data (Requirement): 0123
The data in .csv: 123 (This is the issue)
When I open this file in a Text Editor, I do see the data in double quotes..."0123".
I am using SQL Server 2012. I Want To Maintain all Type Logs In Particulars database or server. I want to track all Query Which Execute in Particulars Database. and all other activity?