aarrgghh's Q&A profile
Visual C# Database - Best Practices
I am working on a database application and was hoping someone might be willing to give me some advice on what the "best practices" are regarding where to put my database access code: Should I place the database access code in my Main method, the Load Event of the main form, a seperate method inside my main form, or in a seperate class file Thanks! Here is a good list with resources, it is allways good to seperate it in tiers, but remember that it depends on your needs. Data Access Layer with SqlWrapper library A Data Access Layer to persist business objects using attributes and reflection ...Show All
SQL Server Row Size Limitation of Report Model?
Hello, I am trying to create a Report Model based on Data View that references a SQL View. I get a an error when building the Report Model based on this view: An error occurred while executing a command. Message: Arithmetic overflow error converting expression to data type int. Command: SELECT COUNT(*) FROM [dbo].[myViewName] I don't know exactly how many rows are returned from this view, but I do know that it can contain quite a few rows. I tried to find out how many rows were in the view by running a SELECT COUNT() on the view, but I got the following error from SQL Server 2005 query window: Msg 8115, Level 16, State 2, Line 1 Ari ...Show All
Visual Studio 2008 (Pre-release) WCF Internals
Is there any whitepaper out there that details some of the internal behavior of the WCF listener framework I would like to know things like the implications of running several services in the same process as opposed to splitting them into different processes running in parallel. I want to know if having all my services listening on the same TCP port (netTcpBinding) has any performance implications as opposed to having each service listen on a different port. I know that ASP.NET had several good whitepapers on the HTTP Pipeline and some "what happens when" timelines that detail what the runtime does when a request is received. ...Show All
Visual Studio Express Editions SqlConnection from Toolbox Pane's DATA
Is there a way that we can show those controls (classes) on Toolbox Pane of Data like OleDBConnection, SqlConnection, ODBCConnection, Command Classes and other controls like the Visual Studio full version I want to put a reference on my form by putting an SqlConnection. Or is there an easy way to do it Or can I just put a connection string at the App.config and invoke that defined connection string every time I need it + Remember that the express eeditions will not allow you to connect to remote databases using the wizards, if you do want to the only way is to do it the manual way and build the data layer yourself. ...Show All
Windows Forms Why and How to get around Tab Control in UserDraw = large tabs
I am subclassing the tab control. As soon as I pass the SetStyle for UserDraw the tab rects are way bigger than they were drawn by the control itself. Is this a bug or what's going on How do I overcome this without having to resort to doing my own tab control entirely Anyone have any ideas Thanks! The on paint command is called&nbs ...Show All
SQL Server Data sources and deployment of packages
I notice that when deploying a package that uses data sources behind its connection managers, the deployed package has the connection string built within the package that gets deployed. From a previous post from Kirk - "What I'd suggest is that you create a Data source per machine and have all the connections reference it. You'll still need to create a connection manager in each package, but they will all reference the same data source. Moving to different machines is no problem because you can have a "machine resident" data source file that properly points to your "ETL Server"." How are data sources defined for a machine Is this simp ...Show All
.NET Development New System.Threading.Thread vs BeginInvoke
Hi! I'm having the following dilemma on how to handle multi threaded operations. I have to handle the case of multiple of calls per second that must be executed asynchronously. Creating a new Threading.Thread object is a simple solution, however I dont think its the best choise, since thread creation and destruction overhead would be too much. Creating a delegate sub and calling BeginInvoke also creates a new thread. My Question: 1) Is there a difference in performance between the two methods 2) Do the two methods use a thread pool For instance, if 100 calls are made almost simultaneously, would 100 threads be created ThreadPool::Qu ...Show All
Windows Forms Table names
I need a quick and easy way to retrieve table names from database using VB.net and access. Anyone And yet another: SELECT name FROM sysobjects WHERE xtype = 'U' AND type = 'U' Executing that query should get you all User Tables. ...Show All
Visual C++ Why is VC8 code much slower than VC7.1?
I have built the code below using both MSVC 7.1 and 8.0 beta 2, using the command shown in the initial comment. When run on a 3GHz P4 with 1GB RAM, running XP SP2, the output is as follows: VC7.1: Time = 62 VC8.0: Time = 110 Why does the 8.0 build take 1.77 times as long to run Thanks, Keith MacDonald ///////////////////////////////// // cl -Ox -EHsc -MT TimeTest.cpp #define WIN32_LEAN_AND_MEAN #include <windows.h> #include <iostream> #include <vector> #include <algorithm> class View; class Document { public: Document() {} v ...Show All
Visual Studio Toolbox integration with a tool window?
To be a target / consumer of existing toolbox functionality in VS, does my window have to be a document window or will it work for a tool window as well Thanks, Notre This works with a toolwindow, as I just did it ...Show All
Visual C# Newbie to C# - documented differences between ansi C and using C#
I'm used to programming with versions of Ansi C and now I've been given C#. Without going out and buying a C# book, is there a net site that covers the diffrences in producing code for the visual c~ environment. Worked examples would be an added benefit! If not, what books are worth considering Thanks Get Jesse Liberty's Programming C# (Oreilly) ...Show All
Visual C# How to determine file reading progress
I am using streamreader to read lines of text from a file. I would like to indicate on a progress bar the status of the reading process. What would be the best way to determine where I am within the file so that I could divide this number by the filename.Length member to display in my statusBar I'm having trouble finding the right method for indicating where the file pointer is... You can try checking yourStreamReader.BaseStream.Position. I guess it could be a bit off though due to buffering done by the StreamReader. ...Show All
Smart Device Development Splitter click event
the compact framework does not support the click event for slitters. I need to know when this is clicked because I am doing my own dynamic resizing of a custom control that I made. I am not trying to change the behavior of the splitter, I just need to temporarily suspent my dynamic resizing while the splitter is in use because it is causing the splitter to behave strangely. Is there a way to know when the splitter is being clicked/touched It turns out that I misdiagnosed the problem. What exactly determines how far left or right the splitter can go. Here is some code that reproduces the problem I am having. ...Show All
Visual C# How to convert an integer number to alphabet
Is it possible in .NET to convert an integer number to alphabet Like this: 1 ---> One 2 ---> Two .... I don't want to create a mothod for this, I need a .NET module, like Int32.Parse(). Thanks for any help. Check this article http://www.codeproject.com/samples/number_to_text_converter.asp ...Show All
SQL Server MDX based report parameters misbehave when inter-dependent
Hello, We have problems when creating report parameters on AS based queries. If the parameters are inter-dependent (one dropdown is filled by a query depending on the value of a previous parameter selection), then if the depending parameter is set to <Select a value> and then the first one's value is changed we get a strange error message: Value cannot be null. Parameter name: value This erorr doesn't occur in preview mode ! It is easily repoducible on the ADV works cube with the graphical query designer: Just drag [Measures].[Reseller Extended Amount] [Sales Territory].[Sales Territory].[Sales Territory Region] to the mai ...Show All
