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
R

redspiderke

@redspiderke
About
Posts
16
Topics
9
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • reportviewer in multi-tier winform environment
    R redspiderke

    Hello, I have a simple multi-tier winform application (c# and SQL database) where I want to add some reporting functions. Business Logic, DataAcces layer and UI are the most important Layers in my project. I am searching for a flexible way to add the reporting so I thought to do it by adding an extra class libary project to my sollution where i handle the reporting. I hope this makes it possible to deploy the dll to my clients when a report changement take place. Is there someone who: - have a sample solution - show me how to access reports form the libary class - know a better/easyer way to add a flexible reporting function to a winform application. Thanks for advise.

    C# database csharp design algorithms business

  • SelectedValue and comboboxen
    R redspiderke

    Luc, I think you are right !!! I fixt it with the code below:

        private void txtBrand\_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (txtBrand.SelectedValue is DataRowView)
            {
                string BrandID = Convert.ToInt32(((DataRowView)txtBrand.SelectedValue)\["Brand\_Id"\]).ToString();
                int ID = Convert.ToInt32(BrandID);
                GetVtgBrandTypes(ID);
            }
            else
            {
                int ID = Convert.ToInt32(txtBrand.SelectedValue.ToString());
                GetVtgBrandTypes(ID);
            }
        }
    

    maybe not nice but it works :)

    C# help debugging question

  • SelectedValue and comboboxen
    R redspiderke

    When I do:

    textBox1.text = txtBrand.SelectedValue.ToString()

    the textbox shows the value "3". An integer I think :) But when I convert the textbox to an variable the debugger complains.

    Kan een object van het type System.Int32 niet converteren naar het type System.Data.DataRowView.

    After a long search i fixt it like this:

    private void txtBrand_SelectedIndexChanged(object sender, EventArgs e)
    {
    if (txtBrand.SelectedValue is DataRowView)
    {
    string BrandID = Convert.ToInt32(((DataRowView)txtBrand.SelectedValue)["Brand_Id"]).ToString();
    int ID = Convert.ToInt32(BrandID);
    GetVtgMerkTypes(ID);
    }
    else
    {
    int ID = Convert.ToInt32(txtBrand.SelectedValue.ToString());
    GetVtgMerkTypes(ID);
    }
    }

    ... this works :-)

    C# help debugging question

  • SelectedValue and comboboxen
    R redspiderke

    Hi, I want to fill the 2nd combobox with values dependent on the value from the first combobox In reallife: The first combo contains car brands, the second a list of types. I want that when I select Ford I only get the types from Ford

    // Vul comboboxes
    private void GetVtgMerken()
    {
    txtBrand.DataSource = _Brand.GetVtgBrand();
    txtBran.DisplayMember = "Brand_Name";
    txtBran.ValueMember = "Brand_ID";
    }
    private void GetVtgBrandTypes(int ID)
    {
    txtType.DataSource = _Brandtype.GetVtgBrandTypes(ID);
    txtType.DisplayMember = "type_Naam";
    txtType.ValueMember = "MT_Id";
    }

        // Fill the second combo 
        private void txtBrand\_SelectedIndexChanged(object sender, EventArgs e)
        {
            // first debug
            textBox1.Text = txtBrand.SelectedValue.ToString();
    
                 // first attempt
                 int ID = Convert.ToInt32(txtBrand.SelectedValue.ToString());
                 // second attempt
                 int ID = Int32.Parse(txtBrand.SelectedValue.ToString());
                 
           // the new select
            GetVtgMerkTypes(ID);
        }
    

    When I use Convert.toInt32 or int32.parse I always get the error like below. System.FormatException: Input string was not in a correct format. Textbox1.text displays the value correct (ex. 3) Is there someone who can help ?

    C# help debugging question

  • populate combobox by passing parameter to seperate class
    R redspiderke

    Mark, Thanks, the answer was indeed easyer than the question, solved the problem ! In class "cls_role.cs":

    public DataTable GetRols()
    {
    DataTable DT = new DataTable();
    string Query = "GetRols";
    DT = _dbHelper.ExecuteDataTable(Query);
    return DT;
    }

    In Winform:

    private void GetRols()
    {
    Cls_Role Role = new Cls_Role();
    cmbRole.DataSource = Role.GetRols();
    cmbRole.DisplayMember = "Role_Name";
    cmbRole.ValueMember = "Role_ID";
    }

    I was thinking to complex :-D

    C# database tutorial

  • populate combobox by passing parameter to seperate class
    R redspiderke

    I have 14 forms and 20 combo's in total, So each form has max 2 comboboxes on it.

    C# database tutorial

  • populate combobox by passing parameter to seperate class
    R redspiderke

    Hi, I have +20 comboboxes in my windows app. and thought its best to have the code in a seperate class and than call that class and pass the parameters using a constructor... With this one function I hope to fill every combo box that i have in my application from a database table. But not sure how to get started with it. thanks Wouter

    C# database tutorial

  • report ....
    R redspiderke

    Hi, I have a winform application and want to add some reports to it. Because my Data Access Layer can do MsSQL, Access, MySQL and Oracle I search for a "database independent" solution (now I use generally SQL Express). If posible I like the idea to have standalone reports so If I need to change the report I don't need to rebuild the entire solution. I'am searching for a good tutorial to do this and have quick an easy to implement reports! I know the first answer on this post is: Search google, but i've been there and can't find an good answer on the question so far... only more questions :-) Is there someone who can give me a good hint? thanks

    C# database question mysql sql-server oracle

  • SQL sync with SQLCE
    R redspiderke

    Hi, Quick and simple question :-) Is there a simple way to sync a sql2005 db with a sqlCe database on a mobile device. Is there a default path on a windows mobile device where i can connect to (c:\....) ? I need a fixed path on the mobile device to push the updates to. Thanks for the advice. grtz Wouter

    C# database question

  • reportviewer with untyped dataset or separate datalayer
    R redspiderke

    Hi, I use reportviewer to display reports in a small application some years ago. I've implemented it "quick and dirty" and now it's time to clean up :-) I have seen many samples and walkthroughs but haven't found any that uses untyped dataset or a separate datalayer. One of the things is that I want to avoid adding separate datasets and end up having many .xsd files in my solution. At this point I'am thinking to try to get everything in a seperated libary and add this to my project. This gives me (I hope) the opportunity to edit the reports and re-add them to my application by overwriting a simple dll at the moment I want. Is there someone who know a good walkthrough or can give me some sample code to do this.... or can tell me that it's a stuppid idea and knows a beter way to do this. thanks

    C# tutorial

  • count times together
    R redspiderke

    Hi, For a sportevent I need to make to calculate the overall time after each round an this for 15 rounds. The input and output timeformat is "HH:mm:ss:ff" because I need the millisecond precision. Maybe it's a stupid question, but I can't figure out how I can do this. Is there someone who can tell me how I make the sum of 2 different times. so I can start from that point. thanks for the advise. grtz. w

    C# question

  • pass data from runtime created form to main form.
    R redspiderke

    Hi Colin, A Standard form is just a form you make with the interface from Visual Studio(the basic Form1.cs in a new solution for example). The runtime form is a form that I totaly create from code when i hit a button. private void button2_Click(object sender, EventArgs e) { Form frmRuntime = new Form(); frmRuntime.Show(); } In realtime i have a form frmMain with a couple of buttons. Each button opens a form that is not visible in my solution explorer but is generated 100% from code. The problem is that I want pass de data (textboxes) from the code generated form to the main form (frmMain).

    C# csharp winforms help

  • pass data from runtime created form to main form.
    R redspiderke

    Sorry,with a winform I mean a standard form :-)

    C# csharp winforms help

  • pass data from runtime created form to main form.
    R redspiderke

    Hi, I need to build a application where I have a mainform and multiple runtime generated forms. There are many good methods to pass data between 2 winforms but I have a problem to get it work with runtime generated forms. Is there someone who have a simple sample where i can start from. Thanks

    C# csharp winforms help

  • load user predefined control at runtime created form
    R redspiderke

    Yes thanks!!! I used the same way but made an error in the namespace

    C# design help

  • load user predefined control at runtime created form
    R redspiderke

    I have a predefined user control designed at design time, and want it to load a form at runtime it seems simple but i can't get it to work pls help

    C# design help
  • Login

  • Don't have an account? Register

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