Click here to Skip to main content
15,921,463 members
Home / Discussions / C#
   

C#

 
GeneralRe: band object problem Pin
elraton18-Mar-06 17:41
elraton18-Mar-06 17:41 
QuestionSending WebService request from different port Pin
C#lueless17-Mar-06 9:34
C#lueless17-Mar-06 9:34 
QuestionNeed C# algorithm... Pin
KORCARI17-Mar-06 9:28
KORCARI17-Mar-06 9:28 
AnswerRe: Need C# algorithm... Pin
Christian Graus17-Mar-06 9:35
protectorChristian Graus17-Mar-06 9:35 
QuestionCrystal Reports.NET, Push method, Login failed Pin
Glenn E. Lanier II17-Mar-06 9:23
Glenn E. Lanier II17-Mar-06 9:23 
QuestionuxTheme. Where are the taskbar buttons? Pin
elraton17-Mar-06 7:33
elraton17-Mar-06 7:33 
AnswerRe: uxTheme. Where are the taskbar buttons? Pin
Thomas Stockwell18-Mar-06 13:53
professionalThomas Stockwell18-Mar-06 13:53 
QuestionC# mysql problem Pin
babamara17-Mar-06 7:07
babamara17-Mar-06 7:07 
hi all i want to save images to database. I use this code

private int SaveToDB(string imgName, byte[] imgbin, string imgcontenttype)
{
//use the web.config to store the connection string
MySqlConnection connection = new MySqlConnection(ConfigurationSettings.AppSettings["DSN"]);
MySqlCommand command = new MySqlCommand( "INSERT INTO Image (img_name,img_data,img_contenttype) VALUES ( @img_name, @img_data,@img_contenttype )", connection );

MySqlParameter param0 = new MySqlParameter( "@img_name", MySqlDbType.VarChar,50 );
param0.Value = imgName;
command.Parameters.Add( param0 );

MySqlParameter param1 = new MySqlParameter( "@img_data", MySqlDbType.LongBlob );
param1.Value = imgbin;
command.Parameters.Add( param1 );

MySqlParameter param2 = new MySqlParameter( "@img_contenttype", MySqlDbType.VarChar,50 );
param2.Value = imgcontenttype;
command.Parameters.Add( param2 );

connection.Open();
int numRowsAffected = command.ExecuteNonQuery();
connection.Close();

return numRowsAffected;
}

I have no errors it tells me that the image is save but when i go to my database there is only new row with no data. Where i am wrong


P.S. I use MySql connector
-- modified at 13:09 Friday 17th March, 2006
Questiondynamic function call Pin
vatzcar17-Mar-06 5:50
vatzcar17-Mar-06 5:50 
GeneralRe: dynamic function call Pin
Guffa17-Mar-06 6:09
Guffa17-Mar-06 6:09 
GeneralRe: dynamic function call Pin
vatzcar17-Mar-06 16:46
vatzcar17-Mar-06 16:46 
AnswerRe: dynamic function call Pin
Guffa19-Mar-06 9:49
Guffa19-Mar-06 9:49 
GeneralRe: dynamic function call Pin
vatzcar20-Mar-06 5:07
vatzcar20-Mar-06 5:07 
AnswerRe: dynamic function call Pin
engsrini17-Mar-06 7:20
engsrini17-Mar-06 7:20 
GeneralRe: dynamic function call Pin
vatzcar17-Mar-06 19:47
vatzcar17-Mar-06 19:47 
QuestionCut/Copy/Paste for TreeView Pin
zaboboa17-Mar-06 5:08
zaboboa17-Mar-06 5:08 
AnswerRe: Cut/Copy/Paste for TreeView Pin
Ed.Poore17-Mar-06 12:52
Ed.Poore17-Mar-06 12:52 
QuestionHow to get the Enum item names using Reflection Pin
engsrini17-Mar-06 3:07
engsrini17-Mar-06 3:07 
AnswerRe: How to get the Enum item names using Reflection Pin
mcljava17-Mar-06 4:22
mcljava17-Mar-06 4:22 
QuestionRe: How to get the Enum item names using Reflection Pin
engsrini17-Mar-06 5:53
engsrini17-Mar-06 5:53 
AnswerRe: How to get the Enum item names using Reflection Pin
Guffa17-Mar-06 6:16
Guffa17-Mar-06 6:16 
QuestionRe: How to get the Enum item names using Reflection Pin
engsrini17-Mar-06 7:08
engsrini17-Mar-06 7:08 
AnswerRe: How to get the Enum item names using Reflection Pin
Guffa17-Mar-06 7:32
Guffa17-Mar-06 7:32 
GeneralRe: How to get the Enum item names using Reflection Pin
engsrini17-Mar-06 8:32
engsrini17-Mar-06 8:32 
GeneralRe: How to get the Enum item names using Reflection Pin
Guffa17-Mar-06 8:34
Guffa17-Mar-06 8:34 

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.