Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
P

pgraeve

@pgraeve
About
Posts
8
Topics
5
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • VS SQL "Designer"
    P pgraeve

    Is there any way to COMPLETLEY turn off the SQL "designer" so you can just type in all the TransactSQL and VS will NOT "reformat" your SQL when you save it! I HATE it when it destroys my nicely formatted SQL (for example in views!) It is AWFUL and makes me want to go back to my Query Analyzer - which I would do, but one of the BIG concepts of VS was ONE PLACE to do all your programming...

    Visual Studio database visual-studio tutorial

  • Outlook "like" Date Groupings
    P pgraeve

    Actually doing the "groups" in the ListView is not a problem (I am using Infragistics Grid Control and grouping by dates is easy…) but what I need is the function which accepts in a date, and returns a string for "Yesterday", "Tomorrow", "Last Month", etc... I know it sounds easy, but it gets pretty complicated quickly to do it right and take into account all the possibilities. For example, on the first day of the month, if you send the function yesterday’s date, the function needs to return "Yesterday" not last month. Same thing for first day of the year etc… Anyway, whenever I run into something even slightly complicated, I always figure someone smarter than me has already written some very elegant and efficient code to handle it! MS has this code for Outlook, just wondered if anyone had replicated it in a good C# example.

    C# tutorial csharp question

  • Outlook "like" Date Groupings
    P pgraeve

    I am just looking a good C# example of grouping a list of data by "Date Groups" like Microsoft does in Outlook 2003 Inbox where e-mail is grouped by "date terms" like "Today", "Yesterday", "Tomorrow", "Two Weeks Ago" etc... I started embarking on this code myself but it got complicated quickly so I thought someone smarter than me must have already tackled this one and posted a good article on how to do it somewhere - anyone know of one??? Thanks in advance!!!

    C# tutorial csharp question

  • Explanation about Properties
    P pgraeve

    It is difficult to tell exactly what you are asking here - but if you talking about directly mapping database fields to a text box (or similiar control) on a form (of course, as the other message said, this is not a recommended OO methodology) but I'll use it sometimes for test purposes etc. If you are using Sql server you can use the following query to simply query the field metadata from Sql's System Tables. You can then loop through this recordset and assign the fields to the corresponding Form controls. If you are consistent with your naming conventions (i.e., naming the controls the same name as the fields) you can do this in one simple loop. In addition, you can setup your Update procedure and Insert procedure parameters in the same loop. As mentioned before, I wouldn't do this for a production App - but works great to model try some test cases or work up a quick "demo" etc... Here is query to extract field meta data, this will work for a Table or a View since Sql stores the Columns Definitions for both in the same system tables. If you are using a Sproc for your select, the query is a little more complext but I can send that to you as well if you need it. Hope that helps... ALTER PROCEDURE dbo.GetFields ( @TableName varchar(128) ) AS SELECT o.sysObjectID, o.sysTableName, c.name AS sysFieldName, c.xtype AS sysDataTypeID, t.name AS sysDataType, c.length AS sysFieldSize, c.colid AS sysOrdinalPosition, c.isoutparam AS sysIsOutputParameter, ISNULL(c.scale, 0) AS sysScale, c.prec AS sysPrecision FROM dbo.systables o INNER JOIN dbo.syscolumns c ON o.sysObjectID = c.id INNER JOIN dbo.systypes t ON c.xtype = t.xtype WHERE o.sysTableName = @TableName ORDER BY c.colid

    C# database question

  • create "washed out" images?
    P pgraeve

    that is very helpful - thanks Nick!

    C# com tutorial question

  • create "washed out" images?
    P pgraeve

    i see applications and even Longhorn using more and more of what i would call images with a "washed out" effect (not sure what the real term is for this effect) - like the girl with the video camera in this screen shot from Longhorn. How do you load a "normal" image into a picture box for example, and give it this "washed effect"? http://www.zolknetwork.com/contentimages/longhorn/screenshots/3683/mypictures.jpg Thanks!!!

    C# com tutorial question

  • reading from sqldatareader
    P pgraeve

    What is the BEST / HIGHEST PERFORMANCE method of reading data from a SqlDataReader and returning a "default" value if the value from the reader is null. I have several different methods that all work but all involve calling a seperate void to test the values or catch the null exception. I just keep thinking there has to be a better way - i.e., one "slick" and simple line of code; but I can't seem to find it???

    C# question performance

  • using static
    P pgraeve

    I find it much easier if a class is going to have an empty constructor to make the class's properties and methods static. But I haven't read or seen anything on the "ramifications" of using static a bunch. One one hand it seems as though it would help the system's performance since static methods and properties are loaded on system startup - but does this dramatically affect the system's "startup" time; and memory usage - or enough to worry about it anyway? And is calling static methods etc. offer any significant performance increase over intializing a class with an empty constructor and then utilizing its methods etc.? Has anyone discovered some good "rules of thumb" for determining when to make a method or property static? I typically create static sql connection strings, color properties, etc... based on the above questions, is this a good idea or not?

    C# performance database help question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups