Click here to Skip to main content
16,004,924 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
GeneralRe: Framework64 Questions Pin
martin_hughes5-Sep-07 6:18
martin_hughes5-Sep-07 6:18 
QuestionServer Explorer: Data source not found Pin
xxrono2-Sep-07 11:09
xxrono2-Sep-07 11:09 
AnswerRe: Server Explorer: Data source not found Pin
rihdus3-Sep-07 2:47
rihdus3-Sep-07 2:47 
GeneralRe: Server Explorer: Data source not found Pin
xxrono3-Sep-07 3:41
xxrono3-Sep-07 3:41 
AnswerRe: Server Explorer: Data source not found Pin
Christian Graus3-Sep-07 4:59
protectorChristian Graus3-Sep-07 4:59 
AnswerRe: Server Explorer: Data source not found Pin
rohitsrivastava9-Sep-07 21:20
rohitsrivastava9-Sep-07 21:20 
QuestionRe: Server Explorer: Data source not found Pin
xxrono10-Sep-07 3:39
xxrono10-Sep-07 3:39 
Questionimage inside gridview Pin
aditi0001-Sep-07 18:53
aditi0001-Sep-07 18:53 
Hello,
I am using C# ,APS.NET,MYSQL
In my database I have got 4 field PictureFilefile_id type int, PictureFilePictfile_name type varchar, PictureFilefile_size int , file MEDIUMBLOB
I have the following code to fetch the details from database

========================================================================
MySql.Data.MySqlClient.MySqlConnection conn = new MySql.Data.MySqlClient.MySqlConnection();
MySql.Data.MySqlClient.MySqlCommand cmd = new MySql.Data.MySqlClient.MySqlCommand();
MySql.Data.MySqlClient.MySqlDataReader myData ;

string SQL;
UInt32 FileSize;
byte[] rawData;
FileStream fs;
conn.ConnectionString = CreateConnStr ("127.0.0.1", "dbourwebsite", "root", "root", "3306");
//SQL = "SELECT file_name, file_size, file FROM file";
SQL = "SELECT PictureFilefile_id, PictureFilePictfile_name, PictureFilefile_size, file FROM tblpicturefile where PictureFilefile_id=1";


try
{
conn.Open();

cmd.Connection = conn;
cmd.CommandText = SQL;

myData = cmd.ExecuteReader();
DataTable dtPictureTable = new DataTable();
dtPictureTable.Load(myData);
GridView1.DataSource = dtPictureTable;
GridView1.DataBind();

if (!myData.HasRows)
throw new Exception("There are no BLOBs to fetch");
=======================================================================
In the DESING VIEW
===================
<asp:gridview id="GridView1" runat="server" backcolor="LightGoldenrodYellow" bordercolor="Tan"
="" borderwidth="1px" cellpadding="2" forecolor="Black" gridlines="None" visible="False" autogeneratecolumns="False" width="532px">
<footerstyle backcolor="Tan">
<columns>
<asp:boundfield datafield="PictureFilefile_id" headertext="Image ID">
<headerstyle horizontalalign="Left">

<asp:boundfield datafield="PictureFilePictfile_name" headertext="Name">
<headerstyle horizontalalign="Left">

<asp:imagefield dataalternatetextfield="file" headertext="Piture Image" dataimageurlfield="file">
<headerstyle horizontalalign="Left">


<selectedrowstyle backcolor="DarkSlateBlue" forecolor="GhostWhite">
<pagerstyle backcolor="PaleGoldenrod" forecolor="DarkSlateBlue" horizontalalign="Center">
<headerstyle backcolor="Tan" font-bold="True">
<alternatingrowstyle backcolor="PaleGoldenrod">

================================================================================================
it fetch the details vorrect from database but insetad of image it says Sysytem.Byte[].

can you suggest me ways or tell me where I am wrong Cry | :((

regards

Aditi
AnswerRe: image inside gridview Pin
rihdus3-Sep-07 3:06
rihdus3-Sep-07 3:06 
AnswerRe: image inside gridview Pin
rohitsrivastava9-Sep-07 21:28
rohitsrivastava9-Sep-07 21:28 
QuestionInternetworking question !!! Pin
Mohy_Heidari1-Sep-07 8:31
Mohy_Heidari1-Sep-07 8:31 
AnswerRe: Internetworking question !!! Pin
brucedkyle9-Sep-07 10:00
brucedkyle9-Sep-07 10:00 
QuestionHow can find interfaces which are directly inherited by a type Pin
MReza J31-Aug-07 23:16
MReza J31-Aug-07 23:16 
AnswerRe: How can find interfaces which are directly inherited by a type Pin
Urs Enzler3-Sep-07 22:19
Urs Enzler3-Sep-07 22:19 
AnswerRe: How can find interfaces which are directly inherited by a type Pin
originSH3-Sep-07 22:39
originSH3-Sep-07 22:39 
QuestionHow to do something during vista sidebar closed?? Pin
Alpha Liu30-Aug-07 17:24
Alpha Liu30-Aug-07 17:24 
AnswerRe: How to do something during vista sidebar closed?? Pin
Scott Dorman2-Sep-07 3:13
professionalScott Dorman2-Sep-07 3:13 
QuestionGetting IErrorInfo part of com error in .NET Pin
MReza J30-Aug-07 6:41
MReza J30-Aug-07 6:41 
QuestionUnicode character increment Pin
priyank_ldce30-Aug-07 1:42
priyank_ldce30-Aug-07 1:42 
AnswerRe: Unicode character increment Pin
lmoelleb10-Sep-07 1:35
lmoelleb10-Sep-07 1:35 
QuestionUrgent Please Help me Pin
Cape Town Developer29-Aug-07 22:43
Cape Town Developer29-Aug-07 22:43 
AnswerRe: Urgent Please Help me Pin
Paul Conrad2-Sep-07 5:30
professionalPaul Conrad2-Sep-07 5:30 
QuestionPrintPreviewControl Pin
RJKMinotaur29-Aug-07 12:10
RJKMinotaur29-Aug-07 12:10 
AnswerRe: PrintPreviewControl Pin
Pete O'Hanlon30-Aug-07 2:44
mvePete O'Hanlon30-Aug-07 2:44 
GeneralRe: PrintPreviewControl Pin
RJKMinotaur30-Aug-07 3:59
RJKMinotaur30-Aug-07 3:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.