Steven_Cahill's Q&A profile
SQL Server Stored proc poor performance need help with query optimization
I currently have a stored procedure in our SQL Server 2000 environment that will run great most of the time but periodically throughout the day it will start to run poor. Once I issue an sp_recompile on one of the largest tables (NominationScheduledQuantity with 2 million rows) in the database the stored procedure runs great again. I am assuming this is because a more up to date plan was generated. The code of the stored proc is: CREATE PROCEDURE ursp_Nom_GetDisaggNominations ( @ContractID INT, @DateGasFlow DATETIME, @CycleCode CHAR(3), @FilterZeroQuantityNomFlag CHAR(1), @TransTypePooling CHAR(2), @CycleCodeTmy CHAR(3), @CycleCodeEvn CHAR(3), @CycleCodeID1 CHAR(3), @CycleCodeID2 CHAR(3) ) AS BEGIN Set NoCount On DECLARE @TodayDat ...Show All
SQL Server Problems with Autogrowth feature
I cannot via SSMS change the autogrowth setting for a database. It is currently set to restricted and I want it set to unrestricted. I make the change, click ok and no error appears but when I open it again the change is not there. I also tried creating a new database and noticed that the autogrowth setting of unrestricted is not copied from the model db to the new one. This happens only with the log file. I have SQL 2005 SP1. Any help is appreciated. Hi Heather, The maximum size for a log file in 2005 is 2TB. I'm betting that although filesize is displaying as "restricted", the MAXSIZE is indeed 2TB (2,097,152MB). So, within the confines of capacity limitations, it is unlimited so to s ...Show All
.NET Development Inheriting from DataRow
Is it possible How do i create my own class which will be inheriting all the features of DataRow so I can expand it to have a Tag property public class MyDataRow : DataRow { public MyDataRow(DataRowBuilder builder) : base(builder) { } // your code here } ...Show All
Visual Basic Not sure how to create this class design. Here is the Class1 code with a read only property. [AMENDED twice].
I was wondering what would be the syntax to achieve an end result of something like this: Dim MyClass as New Class1 With MyClass.User .Name = "Dude" .Email = "Dude@email.com" End With With MyClass.Employee .Name = "Whoever" .Email = "whoever@comp.com" End with I've tried classes within classes, structures within classes; but I keep getting all kinds of errors. This was my last try: Namespace CompanyInfo Public Class Class1 Public Class User Public Name as String Public Email as String Public Referred as String = "Paper" 'A default, doesn't need to be set End Class Public Class Employee Public Name as String Public Email as String ...Show All
Windows Forms Current row in datagridview
Is it possible to set the Current row in datagridview I recommend you to set the CurrentCell property of the DataGridView to any cell in the row you want to be current row. If you programmatically change the current cell, the SelectionChanged event will be raised firstly and then the CurrentCellChanged event be raised secondly. In this case, both the selected row and the current row are changed. ...Show All
Visual Studio 2008 (Pre-release) Jan CTP I followed all of the instructions But where is it?
I followed all of the instructions for the January CTP http://www.microsoft.com/downloads/details.aspx familyid=1ff0b35d-0c4a-40b4-915a-5331e11c39e6&displaylang=en First of the credentials were wrong, once I figured that out, I had to figure out to change the networking to allow internet access so I could proceed with the activation of Server 2003. OK, Now what I don't see any programs installed other than those that are installed by default. Am I missing something Do I need to do yet another download Are the instructions flawed (Flawed Instructions Is that possible ) Enquiring minds want to know. Terry Out of sheer frustration, I decided I'd start all over again. I d ...Show All
Visual Basic Is there a way to access local variables from another sub/function?
topic thanks not quite sure I agree with that TaDa. you can pass values via parameters when constructing an object yes, but if you already have an object constructed but want to change a property then you can do so without re-creating an instance again of that class Example: //class 2 private theName as String = String.Empty public property TheName() as String get return Me.theName end get set (ByVal value as String) Me.theName = value end set end property //class1: Dim theSecondClass as new Class2() theSecondClass.TheName = "Bob" you can also pass parameters into the Class2 via constructor yes: //class 2: public sub n ...Show All
Smart Device Development path not found - vs2005 to SQLCE .sdf file
Hi there, i'm currently working on a Windows mobile 5.0 application using Vs2005. my original intention was to store data in mobile access tables and them integrate this with data on a desktop pc. having searched a few forums (this one included) i find i cant do that anymore so i now want to store data in sql server ce on the pocket pc and integrate that with data in the desktop pc in SQL Server. To SQL server Pro's i'm sure this is easy but unfortunately i'm new to both Vs2005 and SQL so any assitance would be greatly appreciated. i've created a .sdf database and attached this to my project (also set it as content) but when i try to connect to the database (using either emulator or on the Pocket Pc itself) it s ...Show All
Visual Studio Express Editions filter the capture of users the character " or char(34)
hi. Please helpme, i development in C# whith ASP.NET , how do i filter in the capture of users the character ( " or char(34) ) in one textbox. thank you. Agc, private bool valida_caracteres() { int icol = 1, icount = TxtCaracteres_permitidos.Text.Length; string scaracter = null; char schar34; schar34 = '"'; if (icount == 0) { return false; } while (icol < icount) { scaracter = TxtCaracteres_permitidos.Text.Substring(icol,1); if (scaracter == schar34.ToString()) { return true; } icol = ++; } return false; } ...Show All
Visual Studio Problem with persisting tool window positions & docking state
Hi there, many users of our product (a VS add-in) regularly report that positions & docking state of the tool windows we create are not persisted across VS sessions. We create tool windows using IVsUIShell.CreateToolWindow and pass it in a valid GUID of the persistence slot in the registry (and this GUID key really exists in the registry). Nevertheless, in some cases the positions and docking state of tool windows are not persisted, and the tool windows display in the default state & position on the next VS restart. The VS logs some users submitted to us contain one interesting cue: in case the tool window positions are not persisted, the log contains the following entry: <entry> <record>143</record> <time&g ...Show All
Visual Studio Crystal Report with images - Export 2 PDF
I'm using VS 2005 & the included version of CR, I'm exporting some small (by enterprise standards) reports to PDF (via small ADO.NET data sets), and for the most part all works well. However, I've noticed that once or twice a week CR runs into some kind of problem which often ends up causing the aspnet_wp.exe process to recycle. When this happens the .aspx pages are fine (although slower to produce than normal), but I cannot generate any PDFs via CR. One interesting symptom is that the ASPNET account's Temp folder starts filling up with temporary CR files at this time, with names like temp_a29f6342-1e64-4dfa-bcfd-33ad9fab2bf1.rpt. Some files are 16 KB, others are 680KB, always these 2 sizes (my actual PDFs are around 50 - 70 KB). Th ...Show All
SQL Server How to create PK in duplicate column?
Hi, How to create PK in duplicate column for example: id fname lname age departments 1 aaa aaa NULL NULL 3 aaa bbb NULL NULL 7 aaa b NULL NULL ... I want to create PK on fname column. Primary Keys are by definition "unique". You cannot have duplicates. From your example, a index on fname is what you want. ...Show All
Visual Basic C:\Documents and Settings\...\My Documents\Visual 2005\...\bin\debug\Reports *Spaces will not let me open .doc file in word*
Hi, if someone on here could help me, I'd really appreciate it. I am currently building a program that will be able to open excel and word documents in their appropriate programs. Heres my code: Dim Job As String = txtJob.Text Dim str2File As String str2File = "" str2File = Application.ExecutablePath str2File = str2File.Substring(0, str2File.LastIndexOf( "GaugeHelper.EXE" )) Dim wordstart As New Process wordstart.StartInfo.FileName = "winword.exe" wordstart.StartInfo.Arguments = str2File & "\Reports\" & Job & "\" & Job & ".doc" w.Start() I can get it to work, except for one thing, When you use the common folder name \Documents and Settings\ Word will try to ...Show All
Visual C++ The problem from non-unicode to unicode.
i have a non-unicode code as follows: HANDLE hThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)WorkFunction, NULL, 0, NULL); BOOL WorkFunction() { BOOL b = HttpSendRequest(g_hRequest, NULL, 0, NULL, 0); if (!b) { return 1; } return 0; } after I transfer it into unicode code, it has the following error: : error C2440: 'type cast' : cannot convert from '' to 'unsigned long (__stdcall *)(void *)' Please tell me how to change it and make it right. I appreciate your help. static DWORD __stdcall SendRequestThreadProc(LPVOID parameter) { const HINTERNET requestHandle = (HINTERNET)parameter; if (requestHandle != NULL) { return ...Show All
.NET Development unable to process request -> No connection could be made because the target machine actively refused it.
Hi there, I have a thin client (windows) on the front and some web services on the server. When we have multiple simultaneous connection hitting the service we are getting this error: Server unable to process request -> Unable to connect to remote server -> No connection could be established as the server actively refused it. It only happens for 3 or more connections simultaneous using the server. Could this be a Windows license limit issue on the server, not allowing users. When I connect alone there is no problem the client talks to the server just fine (which reinstates the connection and port settings are all fine). Since the connection is over http, I dont see a firewall issue too. Please comment on what could be causin ...Show All
