Home > Net >  Winform to upload pictures of confused
Winform to upload pictures of confused

Time:09-22

Upload photos to the database, but found that type shift error, request a great god help sister

CodePudding user response:

Pay attention to the corresponding types, byteImage is byte [], @ Photo is SqlDbType Varchar is a string, two corresponding to the up, what format the SQL Server field, additionally,

CodePudding user response:

@ the SqlDbType of photo is wrong,

CodePudding user response:

Pictures don't stored in the database, can be directly stored in the server or project under the fixed path, then the image path is stored in the database,
  •  Tags:  
  • C#
  • Related