I've only been workign with Database programming for 6 months or so, specfically SQL Server. I've setup a site through a hosting company that is pretty reputable and allows me plent of space/bandwidth etc. However, they've recently been having problems with one of their servers (the one I'm co hosted on) as an "abornamlly" large amount of connections are being opened up on their server.
I realize that SQL Server is designed to handle large amounts of traffic and my humble little site probably isn't killing it with shear traffic, but I'm wondering if my programming practicies are sub par and causing problems.
I'm coding in ASP (work hasn't given us the chance to migrate to .net). Anyway my site is getting some 30 - 40k hits a day on the actual web portion and probably another 10-20k on backed stuff - all which open up database connections to do their work.
I've had locks and blocks routinely because of this and I'm afraid I'm just going about this all wrong.
So I'm wondering if there is a way to maintain an established connection in ASP across multiple pages and/or sessions so I don't have to constantly drop and reconnect to the db?
I have been looking everywhere and cant seem to find out how to do this using 2.0I would like to have my connection strign in my web.config file being decralred publicly in my pages so that I dont have to repeat lines of code throughout pages.In my web.config I have this.<connectionStrings> <add name="myconn" connectionString="Data Source=.SQLEXPRESS;AttachDbFilename=|DataDirectory|ASPNETDB.MDF;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient" /> </connectionStrings>then in my pages I haveImports System.DataImports System.Data.SqlClientPublic sqlconnection As New SqlConnection(ConfigurationSettings.AppSettings("myconn"))Public sqlcommand As New SqlCommandPublic sqldataAdapter As New SqlDataAdapterPublic sSQL as StringFunction getdata()sSQL = "INSERT INTO tbl_Idea (Status) value (@Status)Dim dbcommand As New System.Data.SqlClient.SqlCommand(sSQL, sqlconnection)Dim statusparam As New SqlParameter("@Status", SqlDbType.NVarChar)statusparam.Value = "PENDING"dbcommand.Parameters.Add(statusparam)sqlconnection.Open()dbcommand.ExecuteNonQuery()sqlconnection.Close()for some reason this code does not seem to work. It keeps telling me The ConnectionString Property has not been initialized.I do the same thing in my asp.net 1.1 pages using vs 2003. Can some one help or atleast point in the right direction.thanks
I am having an asp.net web site hosted in my machine's IIS (5.1). This aspx files are accessing data from an sql server 2000 database located in another machine. While i am trying to open a connection from the aspx files to the database, an error showing login failed for that user. Not a trusted sql server connection. so i unchecked the "allow anonymous access" in the directory security. But now its working from my machine (the web server, localhost). but when i try to access the aspx files from another machine with my system ip, the same error exists-Login failed for the user and not a trusted sql server connection.
in microsoft doc there is written on the topic of BP Extensions with SSD's in SQL Server 2014: only clean pages are written to disk... does this mean data pages that have not been modified yet? or also those data pages that have already been modified, and where log has finished writing and the transaction has been marked as commited??
why are there clean data pages being written to L2 cache to make space for other not modified pages? I mean, shoudnt they be modified first, before letting other unmodified data pages into the Cache? I mean they have still to be modified..that makes no sense to me to page them out and page them in again just for other data pages...
I'm a new user that is playiing with a few of the MS web tools available. I have been trying out the ClubDB sample as part of looking at visual web express. I have installed the sample and ran it in multiple directories while debugging. Most of the directories have now been delected. My problem now is that I cannot add back ClubDB and access it remotely because somewhere in the SQL database there are connections made for each of the previous "test" runs of the sample. I have run SSEUtil and deleted all connections involved (no clubdb or aspnetdb connections still connected) but that doesn't seem to fix it. For example, there still seems to be a table somewhere that remembers that I once had a "clubdb" connection in websitemainapp_data.
My questions are: - where is this information stored? - is there an easy to use tool to clear all of these persistant connections.
I need to get a unique value to use for a record *before* the record is added to a table. It doesn't have to be contiguous with existing records, but it must always be unique, has to be persistent over multiple instantiations of an ASP.NET application, and has to work in that sort of a multi-session environment (where other sessions could need additional unique values before the first session gets around to actually adding a record to the table).
I considered generating and using unique CLSIDs for this, but the resulting value also needs to become part of the filename of some files that are being saved to the disk (and those names also saved in the table), and including text CLSIDs along with other filename data would make for some unpleasantly long and difficult to work with filenames.
I also don't think there's a practical way for me to use a trigger associated with an identity column for this, because I need to save files to disk using the unique value before I even know if the record will in fact end up being added to the table, and what's more, the numbers and names of those files will vary in ways that might be difficult to handle in a stored procedure.
What I'm thinking I will have to do is create a separate database table called something like "UniqueIDGen". This table would have a single record in it with a single integer value, initialized to a value of 1. Then, each time an ID is needed, this one record would be locked, read and incremented by 1. The only reason for doing it this way instead of with an application variable, as I see it, is that the values need to be unique and continue incrementing in perpetuity, no matter how many times the ASP.NET application is recycled or the server is rebooted.
But I still have to wonder if there might be a more efficient method provided by SQL Server for this type of unique value generation ... something that is equally as persistent without requiring an entire table with only a single record to be allocated to such a basic task. Does anyone know of a more elegant solution for this?
I have what looks like a completed install of SQL Server Express Edition, accomplished via unattended setup as part of a custom application (on a machine hereafter dubbed Machine "A").
So far, though, I can't access this instance from a remote SQL Server Management Studio because SSMSE can't see the installed database engine.
I've verified that:
The SQL Server Express installation on Machine A has remote connections enabled. The SQLBrowser on Machine A is enabled and running. Machine A's Windows Firewall is disabled. Using a test tool, I can see that UDP messages sent to SQLBrowser (on port 1434), arrive (i.e. it complains about their format in the System Log).
It seems that Machine A's SQLBrowser isn't responding to requests, but there's no obvious reason why.
There's one clue in Machine A's event log:
Whenever SQLBrowser is started or restarted, there's a warning in the App Log:
"The configuration of the AdminConnectionTCP protocol in the SQL instance SQLEXPRESS is not valid." (eventid 3).
I suspect this is very poor design but I've been asked to research this: can I maintain a persistent communication session inside an sqlclr proc? (tcp/binary packets)
The process has to maintain very high throughput - setting up and tearing down a connection on each transaction is cost prohibitive. For TCO and deployment reasons it is preferable not to have a separate windows service etc that accepts requests from inside the clr proc. Is there the luxury of an alternative integrated into the database?
we have migrated from win 2000 to win 2003. now web site which has database connection with sql server 2000 ( running on same win2003 server ) , is running very slow. pl help as soon as possible.
I have developed a report that when displayed in page layout view is giving me blank pages with only heaer & footer information even though none of my groups have page breaks designated. This also occurs when exported to PDF.
Can anyone provide some information on why this is occurring and how to remedy it ?
i'm not sure that i understand how sql server stores data.
in documentation, i found that sql server stores data in pages.
every page have size of 8192 bytes (8060).
as i understand well, every table row is stored in one page. also, every table row can not be larger then one page. and that's where my confusion starts - because it sounds like we can not have data in table that is larger then 8060.
please, if you can you help me to understand this.
Hi everyone, I have a simple question about Rows in Pages for you. In my opinion, rows are the storage of the data in databases. I would like to ask that there are any important properties of Rows which I am not aware.
I have a report with a few subreports and after each subreport I've added a page-break. But I want to skip a page and to leave it blank if the previous subreport ends at an odd page, so the next subreport will start at the next odd page instead of the even page.
I use a transparent rectangle to add page breaks after each subreport, but because I don't have access to the Global.PageNumber variable in the body section of the report, I don't know when the page is even, so a second rectangle with a custom expression for the Visibility property is unuseful.
Does anyone know how to fix this issue?
Thank you and I look forward to seeing some suggestions.
Hello, Iam a new developer to asp.net, I have been trying to connect a database to a asp.net page but many times i failed. actually i dont want to connect just directly by dragging and dropping controls rather i wanted to bind controls like textboxes and comboboxes but at first i think i have to make querystrings to and sqlconnection to connect to the database. I mean i have to manually code all these items to get my pages connected. but most of the time i face the bug which is: Server Error in '/WebSite2' Application.
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) is that because of the fact that i dont sql server management studio installed actually i tried the same process with some other pcs that does not have sql server insatlled but it was working pretty well, but now i dont have a sql server installed and the problem still insists. hope i have clarified my problem, sorry if it is a bit lenghty thanks and regards
Has anyone come up with an easy way to change the code page sort order in the master database. Unfortunately, I inherited two machines running different codes and neither one is ANSI standard. I would like to get them both back to ANSI. Each one contains approximately 15 custom databases.
Any suggestions except prayer would be much appreciated.
Does anyone know a workaround for the code page translation that occurs if you use bcp to transfer data in and out of SQL Server. I have a table that I am losing certain characters in the transfers.
SQL Server 7.0 has the -C code page specifier added to BCP to address this but I am running 6.5 currently.
Does anyone have any experience detecting and repairing torn pages? Does Optimization repair Torn Pages ? Any help or resources would be much appriciated.
I have two identical databases DB1 and DB2. And each have 4 tables
In DB1 i will insert the data in the following order For Every set of 4 records Insert into Table1 Values .. Insert into Table2 Values .. Insert into Table3 Values .. Insert into Table4 Values ..
In DB2, i will insert the data as
Insert into Db2..table1 select * from db1..table1 Insert into Db2..table2 select * from db1..table2 Insert into Db2..table3 select * from db1..table3 Insert into Db2..table4 select * from db1..table4
i.e. a bulk copy.
What is hapening is if i run DBCC SHOWCONTIG on both the database tables, it shows avg Space used for DB2 tables as more than 90% but for DB1 it is 4 - 5 %.
And if we check the device stace used by db1, it will be 10 times more by the DB2 for the same set of data. Both databases have different devices to store the log.
1. Can we have any command/procedure to reasllocate all the data so that minimum pages are used to store the data.
2. One more thing, is there any diff in SQL server 6.5 installed on Dell6100 ( Pentium Microprocessor ) and winNT 4.0 ? Because what is hapening is, if the log space is full, and if we Stop and start the SQL server on Dell system, it is not at all clearing the log space occupied. But in NT it is clearing the LOG.
3. Does any SQL server service Packs affect this..? If any let me know
4. If we create saperate LOG devices, what othere information is stored in the Data devices othere that data. Because in my case, DB1 is occupying more space than the actual data inserted.
I am trying to understand how the data in sql server is stored andalso regarding fill factor and page splitting.1) My first question what is the difference between Index pages andData pages.and how are they different for clustered and non clustered indexes andheap tables.2) What is the relation between index and data pages.2) BOL says that fill factor is used to define the amount of freespace on each page of index. I am confused here what does index pagesand data pages containfor clustered/non clustered/heap tables.3) Why does page splits occur and do they occur due to the lack ofspace in index or data pages?Thanksskura
I've built a few reports using Reporting Services. The number of pages in my reports isdifferent in the on-screen rendered report from the printed version. My report properties are set to an A4 page (210 x 297) and also Globals.Page give me a different result. (on the screen I see 2 pages and I print 6 pages).
I've created a simple .rdl report and seems to show the preview under my visual studio. But, when I add the .rdl file into the server and export them to be a .PDF, The pdf is created with two blank pages for every single page with data. Please comment me to fix this.
Could you tell the correct way to use Reporting Services on ASP.NET pages?
Now I wanna create an ASP.NET page to show some reports, and I hope to control all logic by program, so I need know the API between ASP.NET and Reporting Services.
For example, I wanna pass some data to Reporting Services via API, and then Reporting Services handle the data and return reports to me, and then I can show the reports on my web pages.