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
B

brain2cpu

@brain2cpu
About
Posts
22
Topics
16
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • linq bug ???
    B brain2cpu

    Hi all, I have two expressions: var x = (from e in Program.DB.Events group e by e.Event_type_id into eg orderby eg.Count() descending select eg.Key).First(); var y = (from et in Program.DB.Event_types where et.Id == (from e in Program.DB.Events group e by e.Event_type_id into eg orderby eg.Count() descending select eg.Key).First() select et.Id).Single(); the first result (x) is ok but when using the same expression embedded in the second a wrong result came up. And here are the generated select statements from the log: SELECT TOP (1) [t1].[event_type_id] FROM ( SELECT COUNT(*) AS [value], [t0].[event_type_id] FROM [events] AS [t0] GROUP BY [t0].[event_type_id] ) AS [t1] ORDER BY [t1].[value] DESC -- Context: SqlProvider(SqlCE) Model: AttributedMetaModel Build: 3.5.30729.1 SELECT [t0].[id] FROM [event_types] AS [t0] OUTER APPLY ( SELECT TOP (1) [t2].[event_type_id] FROM ( SELECT [t1].[event_type_id] FROM [events] AS [t1] GROUP BY [t1].[event_type_id] ) AS [t2] ) AS [t3] WHERE [t0].[id] = [t3].[event_type_id] -- Context: SqlProvider(SqlCE) Model: AttributedMetaModel Build: 3.5.30729.1 The reason of the wrong result is the missing "order by" from the second select. What's wrong here?

    LINQ csharp database linq hardware help

  • linq update problem
    B brain2cpu

    db.Contacts and 3 more classes are generated by sqlmetal, the solution would be to modify this classes to have properties just for database columns I need? (the primary key is in my "column-wish-list"). This probably would work but it seems to me way to complicated and across the program there are about 5 column combinations. Thanks

    C# database question csharp linq help

  • About Microsoft SQL Server Compact 3.5
    B brain2cpu

    http://www.microsoft.com/downloads/details.aspx?&FamilyID=7849b34f-67ab-481f-a5a5-4990597b0297&DisplayLang=en[^]

    C# csharp database sql-server sysadmin question

  • linq update problem
    B brain2cpu

    I thought about this, but I did hope it's my mistake. So, there is no way to have an "updateable select" using just a few of table columns? The original goal was something like: dataViewGrid.DataSource = from ..... and permit updates, ... in grid having just 3-4 columns (not all 15).

    C# database question csharp linq help

  • linq update problem
    B brain2cpu

    It works: var names = from n in db.Contacts where n.Name.Contains("aaa") select n; foreach(var t in names) { t.Name = "xxx"; } db.SubmitChanges(); Not works (no errors but the Name field does not change) public class tmp { public string Name {get; set;} public int ID { get; set; } public string Group { get; set; } } var names = from n in db.Contacts where n.Name.Contains("aaa") select new tmp { Name = n.Name, ID = n.Id, Group = n.Group.Name }; foreach(var t in names) { t.Name = "xxx"; } db.SubmitChanges(); how can I do this without fetching all database columns? Thanks

    C# database question csharp linq help

  • Vista file access
    B brain2cpu

    Hi all, this is not a clear C# problem, but the program is in C# and can't find a better place to ask. So, the application have to maintain some documents, every user logging in must see and edit any of documents. My problem is: where to store these files? Until XP we used Program files\AppDir\Docs folder, but in Vista this not works. User's personal folders can't be used either. Please help with a good ideea/information Thanks

    C# help csharp question

  • DataGridView exception
    B brain2cpu

    Hi, I hope I'm not the only one hit by this: in some window forms I have a DataGridView having a DataSet (filled from a select) and AutoSizeColumnMode set to Fill. Before the form is showing up I get an unhandled exeption message with "This operation cannot be performed while an auto-filled column is being resized" - I have no clue about what operation we talking about and the exception is thrown randomly (and never if step through the application in debugger). If click Continue everything is OK, the form comes up filled, aligned and resized. Somebody please give me a hint.

    C# debugging

  • localization
    B brain2cpu

    After years of development I get to my first multilanguage application, and I have a problem. The windows forms part is almost ok: create the form with localize true, design it for default, after that load the form for every language, edit every text of every component - quite annoying.... but it works. The problem is with strings (messages to the user). My first idea was to store them as resource strings, but resource does not have a language so a winforms-like approach not works. Now I store strings in external text files but this way is plain ugly. Please, please shed some light - what would be the good way... (using Visual Studio 2005)

    C# csharp winforms visual-studio design help

  • serialization
    B brain2cpu

    I choose XML serialization because I need a text file, which can be edited if needed. If other methods give me a text format it would be OK.

    C# data-structures json question

  • serialization
    B brain2cpu

    I want to serialize a private field of a class: ... private ArrayList items = null; ... XmlSerializer serializer = new XmlSerializer(typeof(MyClass)); TextWriter writer = new StreamWriter(path); serializer.Serialize(writer, this); writer.Close(); the items array is serialized only if change it to public, but I do not want to do this. items are presented by the class through some properties, each making some work before returns something; the basic form of items should not be visible. Any solution?

    C# data-structures json question

  • combobox datasource
    B brain2cpu

    It is just wierd, I have something like: ArrayList al1 = .... //filled with some data combobox1.DataSource = al1; it is all OK. BUT, later I have to change the contents of the combobox, so: ArrayList al2 = .... //filled with something else combobox1.DataSource = al2; here cames up with a null DataSource (al2 is correct and no errors are shown). I also tried to get the ArrauList back: ArrayList al = (ArrayList)combobox1.DataSource; al.Add("..."); ..... but nothing changed. What could be wrong ? I would prefer the first approach.

    C# question

  • PrintPreviewDialog
    B brain2cpu

    I tried to get the DialogResult but hitting the Print does not close the dialog, so after printing the user will close the dialog so I'll get Cancel

    C# question css

  • PrintPreviewDialog
    B brain2cpu

    I have two problems. The more important: how can I know if the user did hit the Print button or just saw the preview and close the window; the best whould be to close the dialog after the user press the Print button and let me know about this (return ... , delegate, event,...) The other: how can I set the zoom? Default the dialog is very small, I managed to increase it's size but the zoom is still less then 100% and the text is not readable; I can not find anything related to zoom

    C# question css

  • .NET version dependent compilation
    B brain2cpu

    is there something like: #if theCompilerVersionIs1.0 using Microsoft.Data.Odbc; #else using System.Data.Odbc; ?? I have VS2002 and have to command line compile for 1.1 and it would be great not to change my code for this.

    C# csharp question announcement

  • fonts (maybe)
    B brain2cpu

    Basically I want to print some stuff from my program, it works just great on every single test machine, but :mad: on customer's computer when the printing should start I got an Arithmetic underflow or overflow exception at System.Drawing.Font.Init. The same error shows up when selecting some fonts (but I can still use those fonts from Word, ...) and closing the font dialog. To be even more strange if I print from an other program before starting my own printing it will work like a charm. Does anybody meet something like this? Any hint would be great, I'm :confused::confused::confused:

    C# graphics sales help question

  • "database wizard"
    B brain2cpu

    In old days In FoxPro could generate a page for a given table with edit boxes for every field, some navigation buttons, add, delete, find - all this without too much typing Is there something like that for C# ? Datagrid is not an option here because of validations, auto-calculated fields and user preferences :mad: I have a lot of tables with a lot of columns and to create all forms is just overkill. Any hints please? Thanks

    C# csharp database question

  • printing
    B brain2cpu

    how could be saved PrinterSettings: first time the user make his choises, after that I want to use the same settings (page size, orientation, ...)

    C#

  • filling dataset - speed
    B brain2cpu

    I'm shocked: the line dataAdapter.Fill(dataSet, dataTableName); (a local MySQL :mad: connection, ODBC, 8k rows) took more than 1 min to execute, it needs about 2 min to show the window just I'm so unlucky ? or it is a known performance problem here? can I do something to speed it up? (I HAVE to show all those lines) Thanks

    C# performance mysql help question

  • datagrid problems
    B brain2cpu

    I saw a lot of datagrid messages but still remain a few questions for me: 1. there is a simple way to know if the grid was edited or not (= any cell changed, deleted, added or not) 2. I want a grid that is not readonly but allows just update or update and delete but no insert, ... 3. want to scroll down: when the grid is show the last lines be visible 4. a kind of alternate color: change rows background upon a cell value (have more records for a day and I want to have rows for same day in same color, changing background for the next day) Thanks

    C# css announcement

  • tabcontrol
    B brain2cpu

    I end up with something similar: I put an accept button on the main form and "hide" it (size 1x1, flat, *color = main background) and this "invisible" button will route the Enter according to the active tab page. I can not use a single, normal button for all pages because the actions are quite different (enter, delete, view, load, ...) so the button's name would be a real problem. This thing works but MUST be some other way :confused:

    C# csharp c++ 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