Click here to Skip to main content
15,796,179 members
Home / Discussions / C#
   

C#

 
AnswerRe: Best way to do this? Pin
Ron Beyer16-Nov-13 10:05
professionalRon Beyer16-Nov-13 10:05 
AnswerRe: Best way to do this? Pin
Mycroft Holmes16-Nov-13 18:10
professionalMycroft Holmes16-Nov-13 18:10 
AnswerRe: Best way to do this? Pin
WuRunZhe17-Nov-13 22:26
WuRunZhe17-Nov-13 22:26 
Questionajax script manager Pin
MichaelCheong8916-Nov-13 2:48
MichaelCheong8916-Nov-13 2:48 
SuggestionRe: ajax script manager Pin
Richard MacCutchan16-Nov-13 4:34
mveRichard MacCutchan16-Nov-13 4:34 
GeneralRe: ajax script manager Pin
MichaelCheong8916-Nov-13 5:04
MichaelCheong8916-Nov-13 5:04 
QuestionRe: ajax script manager Pin
Richard MacCutchan16-Nov-13 5:47
mveRichard MacCutchan16-Nov-13 5:47 
Questionretrieve image from database help Pin
MichaelCheong8916-Nov-13 1:27
MichaelCheong8916-Nov-13 1:27 
inside my database have binary data. what is this problem mean

Exception Details: System.IndexOutOfRangeException: ProductImage

Source Error:

Line 70: byte[] bytes = (byte[])sqlDataReader1["ProductImage"];
SqlConnection conn1 = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString);
conn1.Open();
String sqlTitle1 = "SELECT * FROM ProductImage WHERE ProductID =@ID";
SqlCommand comm1 = new SqlCommand(sqlTitle1, conn1);
comm1.Parameters.AddWithValue("@ID", Id);
SqlDataReader sqlDataReader1 = comm1.ExecuteReader();

while (sqlDataReader1.Read())
{
byte[] bytes = (byte[])sqlDataReader1["ProductImage"];
string Imageitem = Convert.ToBase64String(bytes, 0, bytes.Length);
Image1.ImageUrl = "data:image/png;base64," + Imageitem;
//Image1.Visible = true;
}
conn1.Close();

my product image table
ProductID datatype nvarchar(50) primarykey
ProductColorType nvarchar(50) primarykey
ProductImg varbinary(MAX)

thx for helping Smile | :)
AnswerRe: retrieve image from database help Pin
Richard MacCutchan16-Nov-13 1:53
mveRichard MacCutchan16-Nov-13 1:53 
GeneralRe: retrieve image from database help Pin
MichaelCheong8916-Nov-13 1:56
MichaelCheong8916-Nov-13 1:56 
SuggestionRe: retrieve image from database help Pin
Richard MacCutchan16-Nov-13 2:00
mveRichard MacCutchan16-Nov-13 2:00 
GeneralRe: retrieve image from database help Pin
MichaelCheong8916-Nov-13 2:47
MichaelCheong8916-Nov-13 2:47 
QuestionHow to execute c# statment in a string?(Compiling and Running code at runtime) Pin
jojoba201116-Nov-13 0:25
jojoba201116-Nov-13 0:25 
AnswerRe: How to execute c# statment in a string?(Compiling and Running code at runtime) Pin
Eddy Vluggen16-Nov-13 2:09
professionalEddy Vluggen16-Nov-13 2:09 
QuestionRe: How to execute c# statment in a string?(Compiling and Running code at runtime) Pin
jojoba201116-Nov-13 4:12
jojoba201116-Nov-13 4:12 
AnswerRe: How to execute c# statment in a string?(Compiling and Running code at runtime) Pin
Eddy Vluggen16-Nov-13 5:06
professionalEddy Vluggen16-Nov-13 5:06 
GeneralRe: How to execute c# statment in a string?(Compiling and Running code at runtime) Pin
BillWoodruff16-Nov-13 5:14
professionalBillWoodruff16-Nov-13 5:14 
QuestionRe: How to execute c# statment in a string?(Compiling and Running code at runtime) Pin
jojoba201116-Nov-13 7:41
jojoba201116-Nov-13 7:41 
AnswerRe: How to execute c# statment in a string?(Compiling and Running code at runtime) Pin
Eddy Vluggen16-Nov-13 10:35
professionalEddy Vluggen16-Nov-13 10:35 
AnswerRe: How to execute c# statment in a string?(Compiling and Running code at runtime) Pin
turbosupramk316-Nov-13 2:30
turbosupramk316-Nov-13 2:30 
SuggestionRe: How to execute c# statment in a string?(Compiling and Running code at runtime) Pin
CHill6016-Nov-13 9:06
mveCHill6016-Nov-13 9:06 
AnswerSolved! Pin
Member 94738092-Dec-13 1:10
Member 94738092-Dec-13 1:10 
QuestionHow to query Scom 2012 through c sharp? Pin
turbosupramk315-Nov-13 11:48
turbosupramk315-Nov-13 11:48 
AnswerRe: How to query Scom 2012 through c sharp? Pin
Eddy Vluggen16-Nov-13 2:10
professionalEddy Vluggen16-Nov-13 2:10 
GeneralRe: How to query Scom 2012 through c sharp? Pin
turbosupramk316-Nov-13 2:26
turbosupramk316-Nov-13 2:26 

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.