dangrmous's Q&A profile
Visual C# Retrieving Data Types from OleDb. Issues???
Hi! I'm accessing an Access database from C# using OleDB. I'm trying to pull out a variety of datatypes. This is my code so far: while (aReader.Read()) { intGameKey = Convert .ToInt16(aReader[ "intGameKey" ].ToString()); //dtGameDate = aReader["dtGameDate"].ToString(); strSeasonType = aReader.GetChars[ "chrSeasonType" ].ToString(); strHomeTeam = aReader[ "strHomeTeam" ].ToString(); strVisitTeam = aReader[ "strVisitTeam" ].ToString(); MessageBox .Show(strSeasonType + " " + strHomeTeam + " @ " + strVisitTeam); } I can retrieve all the two lower strings (strHomeTeam and strVisitTeam), and I can retrieve the "intGameKey ...Show All
Visual Studio 2008 (Pre-release) Limiting the size of the JournalEntryBackStack
Hi, I am building an application that navigates from one page to another using NavigationService Navigate(object) where the object is a PageFunction that I construct. No Uri-based navigation scenarios are possible in the application. The pages are hosted in a Frame that owns the navigation journal. And, I'm setting KeepAlive to True for all these pagefunction objects involved as it'd be impossible for me to restore the exact state of the page otherwise when I navigate Back to it. I'm also providing some CustomContentState to do some additional context restoration when the page is navigated back to. This works quite well and navigation back/forth is instantaneous but, expectedly, my app's memory footprint grows pretty quickly and out-of- ...Show All
Visual Studio 2008 (Pre-release) WCF and MSMQ 3.5 Not working together?
Hi I've installed the november versions of .net3, the sdk, and orcas. The MSMQ samples worked fine with this setup and MSMQ 3. I then installed KB897171 (Vista MSMQ beta - May this year), and recreated all the queues. Since then, none of the MSMQ samples are reading the queue (although writing works). The samples worked again once i uninstalled KB897171. Are there any known issues with running WCF with the Vista beta version of MSMQ Thanks Simon Simon, the MSMQ build referred in this KB was meant specifically for WCF Beta 1. It is not needed for WCF to work and is not supported anymore. MSMQ version coming with the operating system is what is needed for WCF, on both Vista ...Show All
SQL Server Compress/Zip Reporting Services Export options
Hey everyone, I have an issue where i am sending out files with 30,000+ lines and they are reaching the 11mb, 12mb in size. This is becoming and issue for us, as we are only allowed to email up to 10mb in size. I have tried reducing all spaces in the data, removing any graphics etc from the report , but still the excel file is over 11mb. One thing i did find was that, if i export it to excel, then open the file and save as a different file name the file size drops 50% !! I was wondering if anyone has been able to zip/compress the exported file before it gets emailed It would be a great feature for MS to include in the next service pack.. Take advantage of the built in Zip support in Windows.. Look forward to hearing ...Show All
.NET Development reading text from .emf file
Is there a way to read the text from a .emf file I tried StreamReader without result. Thank You. Hello Nikos, You code is quite fine you dont have any problem in that. eml is an email file Right. I dont think its liek a normal text file what you create in a notepad. It may be encrypted. It may have some structure. It may have some different encoding. There are a lot of possiblities with that. So think again what you are doing. If you still want to do it. Then try different Encoding i.e Unicode, ASCII, UTF and try to open this file in notepad and then from your code using different encoding then compare both and see when does it match. It may match using some encodings... Best Regards, ...Show All
Visual Basic Addhandler question
Hello. A question please. If I set the datasource property of a combobox with a datatable and I have an addhandler statement to handle the combobox.selecteditemchanged, adding a row in the datatable, the addressof procedure is executed BEFORE the update the datatable. Is there a way to execute the addressof procedure AFTER (to update the datatable) Thanks... Try the ComboBox.SelectionChangeCommitted Event: http://msdn2.microsoft.com/en-us/library/system.windows.forms.combobox.selectionchangecommitted.aspx ...Show All
SQL Server Prerequisite not met, please install SQL reporting service
We have SQL 2005 SP1 and SMS SP2 on a W2K server. Each time we try to install DCM 2.0 report engine, we get a prompt: Prerequsiste not met, please install SQL reporting services Being new to SQL 2005, it appears that reporting services and Visual Studio both installed with no problems. Have we missed something Please advise. Thanks. Do you have IIS installed on your server When installing Reporting Services with SQL 2005, IIS is a requirement for the installation. If IIS is not installed, the Report Server option is to install a FilesOnly installation. If this is the case, you will need to use the Reporting Services Configuration tool to complete the installation. If RS is not installed at all, ...Show All
Visual Studio Team System Class length too long
Does anyone have any suggestions on limiting the length of a class through a rule We are getting developers writing classes exceeding 8000 lines which I think is generally a manifestation of poor design. Does anyone else agree with my assessment How could this be accomplished through a rule as it is analyzing the MSIL and not the source code Although, it could be possible to count the number of lines within a class by using each member's SourceContext, I don't think this is the way to go as this information is only available if PDB's are present during analysis. You could apply standard metrics, such as cyclomatic complexity, to determine the complexity of a class: public override ProblemCollection Check(Member member) { ...Show All
.NET Development Copy Directory ??
Is there anything built-into .Net to allow me to easily copy a directory (and all it's subdirectories and files) from one path to another. I see there is an easy way to move it (System.IO.Directory.Move), but I don't see anything similar for copying. I know I could always write my own recursive function to loop through everything and copy it one by one, but I'm assuming (hoping) that something like this already exists. Yep, there is. In VB.NET, you'd use My.Computer.FileSystem.CopyDirectory() to recursively copy a folder. You can use that in C# too. Don't be shy, that's what the framework is all about. Here's what you do: Project + Add reference, select Microsoft.VisualBasic; add this statement in your ...Show All
Visual Basic How to find the number of VbCrLf's in a string?
I have some code that adds line numbers to a richtextbox control. The code requires that there is at least 2 lines of text in the richtextbox for it to work. How do I detect if there are less than 2 VbCrLf's in a string A simple routine which will give you the occurences Function CountOccurences(ByVal searchIn As String, ByVal searchFor As String) As Integer Dim ipos As Integer = 1 Dim IntCount As Integer = 0 If searchIn.Length > 0 Then Do While InStr(ipos, searchIn, searchFor) > 0 ...Show All
Visual Basic How to pass a compative operator (=,+,>,etc.) to a subroutine?
Can a comparative operator, such as >,+,=, etc. be sent to a subroutine for use on strings, decimal, integer, etc. What I am currently doing is sending the operator in an optional string then using a select case to select each operator, then doing the comparison in each case. This code could be greatly simplified if I could send the operator as an object to the subroutines. Here is a sample subroutine I am using: Private Sub SelectiveSetRowColor( ByRef DGV As DataGridView, ByVal Column As String , ByVal Value As String , ByVal ColorValue As Color, Optional ByVal Operand As String = "=" ) For x As Integer = 0 To DGV.Rows.Count - 1 If DGV.Rows(x).Cells(Column).Value.GetTy ...Show All
Visual Studio Team System Lock vs CheckOut for Edit
Can someone explain me the difference. The Exactly. You need to check out the file for the server to realize that you are editing it. Checking out the file marks it as "read-write". In answer to your second question, you can right click on the file and check it out yourself (right-click, checkout for edit...). You should not have files in your local file system that are writable and managed by source control. You should not mark the file as writeable yourself, but tell check the file out (making it writable in the process). To minimize network traffic, the server keeps a record of which version of which files you have locally. With TFS, you must do all file system management via the sou ...Show All
Visual Studio Tools for Office VSTO 2005 and Outlook 2007?
Hi, I'd like some informations...I've started to use VSTO 2005 to build my plugin for Outlook 2003 some months ago...but a few weeks ago an user told me he has successfully installed my plugin into Outlook 2007! However, he's the only case... Do you have any clue Should they change the PIA, something else I still don't understand how this guy have been able to install (he neither...he just double-clicked the installer, and voila! :)) Please help me ;) Bye LastHope Installed a new PC for Office 2007.. same problem here... you can't install the PIAs for Office 2003 on a PC with just Office 2007.. can't belive that nobody on MS thought about that.. sigh... ...Show All
.NET Development Transforming Large xml files (2 to 5 GB of xml data) using XslCompiledTransform. Application hangs while transform
I am trying to transform an xml file (1- 2 GB) with an existing xslt. At the time of tansforming the application hags. Dim transformer As XslCompiledTransform = New XslCompiledTransform() 'load the xsl transformer.Load(m_XSLFile) ' add parameter for transformation Dim xslArgs As XsltArgumentList = New XsltArgumentList() ' transform the input xml transformer.Transform(InputXmlReader, xslArgs, output) ' remove all the information from the memory output.Flush() ' close the transformed xml output.Close() for smaller files this will work fine (up to 80-100 MB). if the file size is greater than 100 MB the application hangs. is there any better way to transform heavy xml files ...Show All
Software Development for Windows Vista SqlWorkflowPersistenceService not loading all instances
I have a simple workflow with two code activities and a delay activity between them. I also initialize a SqlWorkflowPersistenceService setting it to persist instances when idle automatically. I then have a loop that creates 10 instances of the workflow and start all of them. It starts all the instances, persist them all to the database and after the delay expires the first instance gets loaded and finishes executing. The process then sits there for a number of minutes after the timer expired and eventually loads all the other 9 instances and finishes processing them. What could be causing that behaviour The code initialize the SqlWorkflowPersistenceService looks like: SqlWorkflowPersistenceService persist = new SqlWorkflowPers ...Show All
