locked
How can I do this with LINQ to Entity Framework? RRS feed

  • Question

  • String tag = ((PictureBox)sender).Tag.ToString();
                cn.Open();
              
               cm = new SqlCommand("select * from Artikujt where Barkodi like '" + tag + "'", cn);
    
                dg.Visible = true;
                dr = cm.ExecuteReader();
    
                dr.Read();
    
                if (dr.HasRows)
                {
                    //  tot += double.Parse(dr["Cmimi"].ToString());
                  
                    dg.Rows.Add(dg.Rows.Count + 1, dr["Emri"].ToString(), double.Parse(dr["Cmimi"].ToString()).ToString("#,##0.00"), 1);
                   
                    dg.Rows[dg.Rows.Count - 1].Selected = true;
                }
                dr.Close();
                cn.Close();
                //lblTotali.Text = tot.ToString("#,##0.00");
                Llog1();

    • Moved by Dave PatrickMVP Saturday, January 2, 2021 11:02 PM looking for forum
    Saturday, January 2, 2021 10:12 PM

All replies

  • I'd try asking for help over here.

    dotnet-entity-framework - Microsoft Q&A

     

     



    Regards, Dave Patrick ....
    Microsoft Certified Professional
    Microsoft MVP [Windows Server] Datacenter Management

    Disclaimer: This posting is provided "AS IS" with no warranties or guarantees, and confers no rights.

    Saturday, January 2, 2021 11:02 PM