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
Printable View
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
I have no idea what a dataset is:D 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:D
ok i attached a doc file MrPolite pls help me.
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:D
you'd get more hits in that forum
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
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;