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
M

michael nabil

@michael nabil
About
Posts
12
Topics
3
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • how to remove node from string formatted xml using c#
    M michael nabil

    thanks for your response this code remove all sub nodes in

    ItemRef

    but i need to keep the sub node

    *م1

    thanks

    C# csharp xml tutorial

  • how to remove node from string formatted xml using c#
    M michael nabil

    I have an string parameter with xml content in it. Basically the string have an XML inside.

    7-1623419127
    2021-06-11T06:45:27-08:00
    2021-06-18T10:26:37-08:00
    1624037197
    3
    E0000-1624055316
    *michael
    470000-1623418914
    Accounts Receivable
    2021-06-11
    1
    *michael
    false
    false
    2021-06-11
    2021-06-11
    1200.00
    10000-1623418832
    Vat 14%
    14.00
    168.00
    0.00
    1368.00
    false
    true
    10000-1623418756
    Tax
    9-1623419127
    30000-1623418915
    *م1
    صنف رقم 1

    10
    30.00
    300.00
    10000-1623418756
    Tax

    12-1623419127
    40000-1623418915
    *م2
    مواصفات ملابس 2
    15
    60.00
    900.00
    10000-1623418756
    Tax

    13-1623419127
    14-1623419127
    60000-1624037191
    total
    1200.00

    i want to Delete

    and

    with out delete

    *م1

    C# csharp xml tutorial

  • how to convert Character codes HTML to arabic using c#
    M michael nabil

    i get data from QuickBooks like this

    *أاإ ب ت ث ج ح خ د ذ ر ز س ش ص ض ط ظ ع غ

    it retrain the encoding of the xml response declare is ISO-8859-1 (ISO Latin 1) like this

    Ï Ì Í Î å Ú Û Ý Þ Ë Õ Ö Ø ã ä Ê Ç Ã á áÃ

    i didn't find away to convert it to Arabic direct so i convert it to html encode like this

    Ï Ì Í Î å Ú Û Ý Þ Ë Õ Ö Ø ã ä Ê Ç Ã á áÃ

    now i want to convert html encode to Arabic i don't know how can help me thanks

    C# csharp html tutorial question

  • how to convert Character codes HTML to arabic using c#
    M michael nabil

    i have string in Arabic language but it's appear like that

    Ï Ì Í Î å Ú Û Ý Þ Ë Õ Ö Ø ã ä Ê Ç Ã á áÃ

    Basically I need to convert My source string to Arabic and I do it using following code: i try

    string responseXML = Encoding.UTF8.GetString(Encoding.Default.GetBytes(responseXML));

    result

    Ï Ì Í Î å Ú Û Ý Þ Ë Õ Ö Ø ã ä Ê Ç Ã á áÃ

    but the right result is

    string"د ج ح خ ه ع غ ف ق ث ص ض ط م ن ت ا أ ل لأ ب ي س ش ظ ز و ة ى لا ر ؤ ء ئ ذ"

    What I'm doing wrong here?

    C# csharp html tutorial question

  • Multidimensional Arrays error in fill IList Interface
    M michael nabil

    thanks a lot

    for ( i = 0; i < datavalu.GetLength(0); i++)
    {
    InvoiceLine invoiceline2 = new InvoiceLine();
    invoiceline2.description = datavalu[i, 0].ToString();
    invoiceline2.itemType = datavalu[i, 1].ToString();
    invoiceline2.itemCode = datavalu[i, 2].ToString();
    invoiceline2.internalCode = datavalu[i, 3].ToString();
    invoiceline2.unitType = datavalu[i, 4].ToString();
    invoiceline2.quantity = int.Parse(datavalu[i, 5].ToString());

                invoicelines.Add(invoiceline2);
                
                
            }
    

    my mistake was

    InvoiceLine invoiceline = new InvoiceLine();

    create instants before loop

    C# help css database

  • Multidimensional Arrays error in fill IList Interface
    M michael nabil

    thank for you help but i think it's hard create instance to each new line in invoice lines first i used this code to see result

    string[,] datavalu = new string[dataGridView1.Rows.Count, dataGridView1.Columns.Count];

            foreach(DataGridViewRow row in dataGridView1.Rows)
            {
    
    
                foreach (DataGridViewColumn col in dataGridView1.Columns)
                {
                    datavalu\[row.Index, col.Index\] = dataGridView1.Rows\[row.Index\].Cells\[col.Index\].Value.ToString();
    
                }
            }
            int i = 0;
    
            foreach(string ss in datavalu)
            {
    
                listBox1.Items.Add(ss);
                i++;
            }
    

    I think I thought wrong from the start. Often there are simpler ways Do you know a better way

    C# help css database

  • Multidimensional Arrays error in fill IList Interface
    M michael nabil

    black

    C# help css database

  • Multidimensional Arrays error in fill IList Interface
    M michael nabil

    You're absolutely right but I'm trying code and my problem isn't with grid view but my problem is with how to fill invoicelines right i try another way to show invoicelines in listBox1 and run good

    string[,] datavalu = new string[dataGridView1.Rows.Count, dataGridView1.Columns.Count];

            foreach(DataGridViewRow row in dataGridView1.Rows)
            {
    
    
                foreach (DataGridViewColumn col in dataGridView1.Columns)
                {
                    datavalu\[row.Index, col.Index\] = dataGridView1.Rows\[row.Index\].Cells\[col.Index\].Value.ToString();
    
                }
            }
            int i = 0;
    
            foreach(string ss in datavalu)
            {
    
                listBox1.Items.Add(ss);
                i++;
            }
    

    rustle after that i change code to this but run wrong

    for ( i = 0; i < datavalu.GetLength(0); i++)
    {

                invoiceline2.description = datavalu\[i, 0\].ToString();
                invoiceline2.itemType = datavalu\[i, 1\].ToString();
                invoiceline2.itemCode = datavalu\[i, 2\].ToString();
                invoiceline2.internalCode = datavalu\[i, 3\].ToString();
                invoiceline2.unitType = datavalu\[i, 4\].ToString();
                invoiceline2.quantity = int.Parse(datavalu\[i, 5\].ToString());
    
                invoicelines.Add(invoiceline);
                
                
            }
    

    some thing i miss can you help me

    C# help css database

  • Multidimensional Arrays error in fill IList Interface
    M michael nabil

    public class InvoiceLine
    {
    public string description { get; set; }
    public string itemType { get; set; }
    public string itemCode { get; set; }
    public string internalCode { get; set; }
    public string unitType { get; set; }
    public int quantity { get; set; }
    public UnitValue unitValue { get; set; }
    public int salesTotal { get; set; }
    public double valueDifference { get; set; }
    public double totalTaxableFees { get; set; }
    public Discount discount { get; set; }
    public int netTotal { get; set; }
    public double itemsDiscount { get; set; }
    public IList taxableItems { get; set; }
    public int total { get; set; }
    }

    I'm sorry i forget to attach the class i didn't understand your answer "Because you only have one instance of the class and you insert it multiple times into the list. And each time round the loop you overwrite the values you set in the previous instance." if i have 10 records in grid it means 10 instance to insert one invoice sorry i can't under stand your example about phone and car

    C# help css database

  • Multidimensional Arrays error in fill IList Interface
    M michael nabil

    Thank you for your response. buz i load csv file in grid view after that i want to convert this data to multidimensional arrays

    C# help css database

  • Multidimensional Arrays error in fill IList Interface
    M michael nabil

    Thank you for the quick response. Can you explain with code

    C# help css database

  • Multidimensional Arrays error in fill IList Interface
    M michael nabil

    Hello everyone, my project get data from dataGridView after that convert rows to Multidimensional Arrays and i want to assign Multidimensional Arrays to IList Interface but the IList Interface fill last row in gridview every time my code

    public IList invoiceLines { get; set; }

    InvoiceLine invoiceline = new InvoiceLine();
    string[,] datavalu = new string[dataGridView1.Rows.Count, dataGridView1.Columns.Count];

            foreach (DataGridViewRow row in dataGridView1.Rows)
            {
    
    
                foreach (DataGridViewColumn col in dataGridView1.Columns)
                {
                    datavalu\[row.Index, col.Index\] = dataGridView1.Rows\[row.Index\].Cells\[col.Index\].Value.ToString();
    
                }
            }
            int i ;
          
            for ( i = 0; i < datavalu.GetLength(0); i++)
            {
               
                invoiceline.description = datavalu\[i, 0\].ToString();
                invoiceline.itemType = datavalu\[i, 1\].ToString();
                invoiceline.itemCode = datavalu\[i, 2\].ToString();
                invoiceline.internalCode = datavalu\[i, 3\].ToString();
                invoiceline.unitType = datavalu\[i, 4\].ToString();
                invoiceline.quantity = int.Parse(datavalu\[i, 5\].ToString());
    
                invoicelines.Add(invoiceline);
                
                
            }
    

    my data

    description itemType itemCode internalCode unitType quantity
    Food EGS EG-538486562-1314 1314 EA 1
    Food2 EGS EG-538486562-1315 1500 EA 5

    my problem is that invoicelines return 2 rows same data in last row in the grid

    Food2 EGS EG-538486562-1315 1500 EA 5

    Can anyone tell me why please Thanks in advance

    C# help css database
  • Login

  • Don't have an account? Register

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