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
K

kensai

@kensai
About
Posts
69
Topics
45
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Creating an ASP.NET UserControl with collection-type property
    K kensai

    How can I create a UserControl with a collection-type property which has a collection editor? I've a CompositeControl with an ArrayList-type property which has CollectionEditor-type designer. You can see this property on Properties window with a "..." button which launches a collection editor. This works fine and all but I want to apply the same to a UserControl and I've couldn't manage to pull it off so far. I've done the same thing what I've done with my CompositeControl but the property either doesn't even show on Properties window of the UserControl or shows as a single value property with no "..." editor button. This is what I've done with CompositeControl:

    [
    DefaultProperty("Contacts"),
    ParseChildren(true, "Contacts"),
    ToolboxData(
    "<{0}:QuickContacts runat=\"server\"> </{0}:QuickContacts>")
    ]
    public class QuickContacts : CompositeControl
    {
    private ArrayList contactsList;

    \[
    DesignerSerializationVisibility(
        DesignerSerializationVisibility.Content),
    Editor(typeof(ContactCollectionEditor), typeof(UITypeEditor)),
    PersistenceMode(PersistenceMode.InnerProperty)
    \]
    public ArrayList Contacts
    {
        get
        {
            if (contactsList == null)
            {
                contactsList = new ArrayList();
            }
            return contactsList;
        }
    }
    
    ASP.NET question csharp asp-net sysadmin

  • Need help with TableAdapter problem [modified]
    K kensai

    Alright, problem solved. I realized I'm a huge dummy and forgot a transaction I wrapped around delete operation. Turns out I forgot to add a trans.Complete() at the end of it. I added it and problem solved.

    C# database help css sql-server sysadmin

  • Need help with TableAdapter problem [modified]
    K kensai

    Yes I can delete with sql. I added a query to table adapter and I can delete records using it. However I'm trying to create a fully disconnected application so I really would like to solve this delete problem. Any ideas?

    C# database help css sql-server sysadmin

  • Need help with TableAdapter problem [modified]
    K kensai

    Solved: I realized I'm a huge dummy and forgot a transaction I wrapped around delete operation. Turns out I forgot to add a trans.Complete() at the end of it. I added it and problem solved. I have a typed DataSet mapping a local SQL Server CE 3.5 .sdf file using DataGridView on a WinForm. I can successfully add and modify data but for some reason I can't delete any. I don't get any errors either. Can you please give me any ideas about what could be wrong? I can't figure this out and I'd appreciate any help. I use simple methods like this:

    fill
    myTableTableAdapter.Fill(myDataSet.MyTable);

    add
    (after adding new row to grid also to bindingsource)
    myTableTableAdapter.Update(myDataSet.MyTable);

    delete
    myDataSet.MyTableRow row = myDataSet.MyTable.FindByID(id);
    row.Delete();
    myTableTableAdapter.Update(myDataSet.MyTable);

    The row is gone from gridview. I also check myDataSet.MyTable parameter in myTableTableAdapter.Update(myDataSet.MyTable) using debug visualizer, it's is gone from there too (row status: Deleted). But when I refill data from database, it's back like nothing happend.. I checked DeleteCommand of the myTableTableAdapter, it is defined and correct. I don't copy project database file over the newer build file either. I wrote a simple log to see the rowstatus of the row. Everything seems to work as it should but still the row comes back after a db refill:

    Log: row status: Unchanged
    Log: calling row.Delete()
    Log: row status: Deleted
    Log: entering Update() function
    Log: row status: Deleted
    Log: calling tableAdapter.Update(dataset.Table)
    Log: row status: row not found in dataset

    Any ideas?

    modified on Tuesday, May 26, 2009 6:12 AM

    C# database help css sql-server sysadmin

  • Need help with BindingSource
    K kensai

    I have a problem with binding data using BindingSource, typed dataset and DataGridView. My problem is: BindingSource, therefore grid, is empty after binding data (bindingSource.Count is 0). I couldn't figure out what I'm doing wrong and I'd be very happy if anyone could help me with this. My application structure is like this: I have two assemblies, one is Winforms UI and other is database class library. UI -DataGridView, datasource as BindingSource -BindingSource, datasource = DBAssembly.typedDataset, datamember = DBAssembly.typedDataset.myTable Database DLL -Sql Server CE database -Typed Dataset -DB class for database operations UI Code OnLoad

    this.db = new DB();
    db.BindData();

    DB Code constructor

    create typedDataSet object
    create typedDataSetTableAdapters.MyTableTableAdapter object
    create typedDataSetTableAdapters.TableAdapterManager object

    BindData()

    this.myTableTableAdapter.Fill(this.typedDataSet.MyTable)

    I'd appreciate any help with this :(

    .NET (Core and Framework) database help csharp css sql-server

  • DataBind to specific records
    K kensai

    Unfortunately, the database is Sql Server CE which doesn't support sprocs :sigh: I think I need a way to bind data to a tableadapter custom method which returns records according to a parameter, in this case ID. No idea how to do this though :-O

    Windows Forms css tutorial question

  • DataBind to specific records
    K kensai

    Thanks for the reply. The problem with Filter is that you have to retrieve all of the records first, than display the ones according to filter. Is there a way to retrieve just the records you want in the first place?

    Windows Forms css tutorial question

  • DataBind to specific records
    K kensai

    I have a DataGridView binded to this table:

    [Users]
    ID Name


    11 Qwe
    22 Asd

    Grid is directly binded with a typed dataset. I have a second table like this:

    [Records]
    ID UserID Data


    67 11 ....
    68 11 ....

    Records.UserID is connected to Users with a foreign key. What I want to do is: when the user doubleclicks User #11 I open a new grid, binded to Records table but only binded to rows where UserID = 11. Doubleclick, getting ID, new grid etc. those are I'm OK with. I wouldn't had any problems if I was doing this connected with sprocs but I want it to be binded and I simply have no idea how to do this. Can you please give me any ideas?

    Windows Forms css tutorial question

  • Gettind ID after a TableAdapter Update
    K kensai

    I'm using TableAdapter.Update() to insert data to database. Is there a way to update ID columne value of the inserted row in the DataSet, hopefully without select @@identity/scope_identity() method?

    C# database question announcement

  • Binding data to specific rows
    K kensai

    I have a gridview with users list. When I double click a row it opens a new tab with a new gridview, fetching data that does belong to that user from another table. Question is, how can I and create a connected database gridview with this selected data? I always done data task my way, using access layers and sprocs and I'd like to start learning connected/binded data operations. Tables are like this:

    Users UserRecords


    ID RecordId | UserId

    The second gridview should be binded to rows from UserRecords with like UserId=1234... I'd appreciate any info on this..

    C# question database wpf wcf learning

  • Hosting control in details view in a DataGridView
    K kensai

    I've found what I'm looking for: Customizing the DataGridView to support expanding/collapsing (ala TreeGridView)[^]

    .NET (Core and Framework) hosting tutorial

  • Hosting control in details view in a DataGridView
    K kensai

    I want to have a usercontrol displayed in a datagridview details view which shows when you press that [+] sign but I couldn't figured out how to do it. I'd appreciate any ideas about this :)

    .NET (Core and Framework) hosting tutorial

  • Deployable database solution for Windows Form project
    K kensai

    I'm in need of a deployable database solution for my Windows Forms projects. VS.NET has Local Database (.sdf) which asks you to install SQL Server Pocket Edition and Service-based Database (.mdf) which requires SQL Server Express to be installed. What can I use for my project that I can deploy in a setup?

    Windows Forms database csharp sql-server visual-studio winforms

  • Weird behaviour with Async method call
    K kensai

    Alright, thanks for the info.

    C# debugging help question

  • Weird behaviour with Async method call
    K kensai

    I'm trying to learn async threading and I stumbled on the first piece of code. It works but with weird results. I'd be glad if you could point out what's wrong with it. Here's the code I'm trying:

    private static void LongProcess(int waitTime)
    {
    Trace.WriteLine("LongProcess started");
    Thread.Sleep(waitTime);
    Trace.WriteLine("LongProcess finished");
    }

    private delegate void LongProcessDelegate(int waitTime);

    private void Start()
    {
    LongProcessDelegate lp = LongProcess;
    IAsyncResult ar = lp.BeginInvoke(2000, null, null);
    while(!ar.Completed)
    {
    Trace.WriteLine("Not finished yet");
    Thread.Sleep(100);
    }
    lp.EndInvoke(ar);
    Trace.WriteLine("All completed");
    }

    The problem is with the results. This is what I expected:

    LongProcess started
    Not finished yet
    ..
    Not finished yet
    LongProcess finished
    All completed

    But here's the Trace log when I set it to 1000ms:

    LongProcess finished
    Not finished yet
    ..
    Not finished yet
    LongProcess finished
    All completed

    At 2000ms:

    Not finished yet
    LongProcess finished
    Not finished yet
    ..
    Not finished yet
    LongProcess finished
    All completed

    What's wrong with this? Am I understanding async calls wrong?

    C# debugging help question

  • DataGridView filter
    K kensai

    I have a DataGridView bound to a table in Sql Server CE. I'd like to filter results but I couldn't figure it out so far. I'm trying to use DataView RowFilter but I couldn't manage it to work. Could you please tell me what should I look for? Here's the code, auto-generated by VS.NET, to bind data:

    this.gridRecords.DataSource = this.RecordsBindingSource;
    this.RecordsBindingSource.DataMember = "Records"; //table name is Records
    this.RecordsBindingSource.DataSource = this.tempRecordsDataSetBindingSource;
    this.tempRecordsDataSetBindingSource.DataSource = this.tempRecordsDataSet;
    this.tempRecordsDataSetBindingSource.Position = 0;
    this.tempRecordsDataSet.DataSetName = "TempRecordsDataSet";
    this.tempRecordsDataSet.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema;
    this.RecordsTableAdapter.ClearBeforeFill = true;
    this.RecordsTableAdapter.Fill(this.tempRecordsDataSet.Records);

    This is what I tried:

    this.tempRecordsDataSet.Records.DefaultView.RowFilter = "Field = 1234567891";

    .NET (Core and Framework) csharp database sql-server visual-studio sysadmin

  • Disposing generic lists
    K kensai

    How do you dispose a generic list? Does myList = null solve the problem or does this only remove the reference to the instance and wait for the GC?

    C# help question

  • CustomValidator and Gridview problem
    K kensai

    Dynamically adding customvalidator during runtime instead of adding in itemtemplate somehow solved my problem. Thanks for the links. http://www.aspdotnetcodes.com/GridView_Dynamic_Validation.aspx[^]

    ASP.NET tools help question

  • CustomValidator and Gridview problem
    K kensai

    I did. I added ValidationGroup to textbox and ValidationGroup and CausesValidation to button. Nothing changed. Thanks for the advice though..

    ASP.NET tools help question

  • CustomValidator and Gridview problem
    K kensai

    I have a customvalidator for textbox' in a gridview. The problem is, it doesn't fire up. I did put a break point to validation method but it never catches. The code is working fine in a single page with a single textbox but not in a GridView Can you please tell me what's wrong? Here's my code: private void NumericControl(object sender, ServerValidateEventArgs args) { if (Tools.IsNumeric(args.Value)) args.IsValid = true; else args.IsValid = false; }

    ASP.NET tools 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