Results 1 to 6 of 6

Thread: [RESOLVED] Dataset class to prview image

  1. #1

    Thread Starter
    Fanatic Member popskie's Avatar
    Join Date
    Jul 2005
    Location
    In my chair
    Posts
    666

    Resolved [RESOLVED] Dataset class to prview image

    hi,
    I have an windows application. then I have a dataset class then add the element. My problem is I want to add image element but i dont knew if is string or what variable is? Anyone can help.

    Popskie

  2. #2
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428

    Re: Dataset class to prview image

    I have no idea what a dataset is but if you have an object and you want to check the type of it, you can use the is operator....
    for example

    if (myObject is Bitmap)
    // mObject variable is a bitmap


    if thats what you want, then you might want to see this thread also http://www.vbforums.com/showthread.php?t=359084
    if not, then my apologies for not understanding the question
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  3. #3

    Thread Starter
    Fanatic Member popskie's Avatar
    Join Date
    Jul 2005
    Location
    In my chair
    Posts
    666

    Re: Dataset class to prview image

    ok i attached a doc file MrPolite pls help me.
    Last edited by popskie; Mar 22nd, 2007 at 02:21 AM.

  4. #4
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428

    Re: Dataset class to prview image

    oh hmm I dont know I thought this is at runtime
    Try posting the same thing in the VB.NET forum, they can help you there and if it's something that needs to be converted from VB to C# maybe I could help

    you'd get more hits in that forum
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  5. #5
    Hyperactive Member Sgt-Peppa's Avatar
    Join Date
    Mar 2003
    Location
    Munich - Germany
    Posts
    476

    Re: Dataset class to prview image

    Are you just asking what Datatype to use for Pictures? In SQL Server you can use varbinary as Datatype to store Images and all other sorts of Data. Try to find an equivalent in your list! I think there is an base64Binary DataType. Use that! Just make sure you Base64 encode your Data befor adding it.

    HTH,

    Stephan
    Keep Smiling - even if its hard
    Frankie Says Relax, wossname Says Yeah!
    wossname:--Currently I'm wearing a gimp suit and a parachute.
    C# - Base64 Blog

  6. #6

    Thread Starter
    Fanatic Member popskie's Avatar
    Join Date
    Jul 2005
    Location
    In my chair
    Posts
    666

    Re: Dataset class to prview image

    pls try to find out wat is the problem of code. It does view the image in crystal report.
    Code:
    stsqcon.OpenSqlConnectionST();
    SqlDataReader dreader;
    dreader = SelectTable.GetAttachPict();
    dreader.Read();
    CrystalReport2 report=new CrystalReport2();
    DataSet ds=new DataSet("table1");
    DataTable table=new DataTable("table1");
    table.Columns.Add("test1",typeof(System.String));
    table.Columns.Add("test2",typeof(System.String));
    table.Columns.Add("test3",typeof(System.String)); 
    table.Columns.Add("test4",typeof(Byte[])); 
    for (int i =0;i< 10;i++){
    DataRow row=table.NewRow();
    row["test1"]="Mathew"; // string
    row["test2"]="Hayden"; //string
    row["test3"]="5000$"; // string
    row["test4"]= (Byte[])dreader["logo"]; // base64binary 
    table.Rows.Add(row);
    }
    ds.Tables.Add(table);
    report.SetDataSource(ds);
    crystalReportViewer1.ReportSource =report;

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width