You must Sign In to post a response.
  • Category: .NET

    How to Convert vb.net to C#.net Code

    Hi

    How to convert this code vb.net C#.net. I tried code conversion in Google error through any one convert and post here.

    Dim data As DataTable
    Dim lb() As Byte = data.Rows(0).Item("MemberImage")
    Dim lstr As New System.IO.MemoryStream(lb)
    Image1.Image = Image.FromStream(lstr)
    Image1.SizeMode = PictureBoxSizeMode.StretchImage
    lstr.Close()
  • #767582
    Hi,
    Please find below code:

    DataTable data = new DataTable();
    byte[] lb = data.Rows[0]["MemberImage"];
    System.IO.MemoryStream lstr = new System.IO.MemoryStream(lb);
    Image1.Image = Image.FromStream(lstr);
    Image1.SizeMode = PictureBoxSizeMode.StretchImage;
    lstr.Close();

  • #767593
    check out below converted C# code

    DataTable data = new DataTable();
    byte[] lb = data.Rows[0]["MemberImage"];
    System.IO.MemoryStream lstr = new System.IO.MemoryStream(lb);
    Image1.Image = Image.FromStream(lstr);
    Image1.SizeMode = PictureBoxSizeMode.StretchImage;
    lstr.Close();

    additionally you can use below links for code conversion
    http://converter.telerik.com/

    Thanks
    Koolprasd2003
    Editor, DotNetSpider MVM
    Microsoft MVP 2014 [ASP.NET/IIS]


Sign In to post your comments