|
-
Sep 7th, 2005, 01:14 AM
#1
Thread Starter
Fanatic Member
[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
-
Sep 7th, 2005, 01:20 AM
#2
-
Sep 7th, 2005, 03:51 AM
#3
Thread Starter
Fanatic Member
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.
-
Sep 7th, 2005, 01:06 PM
#4
-
Sep 8th, 2005, 02:53 AM
#5
Hyperactive Member
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
-
Sep 8th, 2005, 03:43 AM
#6
Thread Starter
Fanatic Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|