Click here to Skip to main content
15,891,033 members
Home / Discussions / C#
   

C#

 
AnswerRe: External sorting Pin
Simon P Stevens13-Oct-08 22:51
Simon P Stevens13-Oct-08 22:51 
GeneralRe: External sorting Pin
Diamonddrake14-Oct-08 10:08
Diamonddrake14-Oct-08 10:08 
GeneralRe: External sorting Pin
Simon P Stevens14-Oct-08 11:15
Simon P Stevens14-Oct-08 11:15 
GeneralRe: External sorting Pin
Diamonddrake14-Oct-08 14:37
Diamonddrake14-Oct-08 14:37 
GeneralRe: External sorting Pin
Simon P Stevens14-Oct-08 21:32
Simon P Stevens14-Oct-08 21:32 
Questioncrystal report viewer - treelist Pin
nelsonpaixao13-Oct-08 12:32
nelsonpaixao13-Oct-08 12:32 
QuestionCRYSTAL REPORTS - load image Pin
nelsonpaixao13-Oct-08 12:12
nelsonpaixao13-Oct-08 12:12 
AnswerRe: CRYSTAL REPORTS - load image Pin
teddddddddddd13-Oct-08 19:20
teddddddddddd13-Oct-08 19:20 
You do not have the correct format recorded images in a database

You can use this code

private void Button3_Click(object sender, System.EventArgs e)
{
Stream imgStream = UploadFile.PostedFile.InputStream;
int imgLen = UploadFile.PostedFile.ContentLength;
string imgContentType = UploadFile.PostedFile.ContentType;
byte[] imgBinaryData = new byte[imgLen];
int n = imgStream.Read(imgBinaryData,0,imgLen);
String idis = Request.QueryString["id"];
int busid = System.Convert.ToInt32(idis);
int RowsAffected = SaveToDB( imgBinaryData,imgContentType, busid);
}

private int SaveToDB(byte[] imgbin, string imgcontenttype, int busid)
{
SqlConnection sqlConnection1 = new SqlConnection(ConfigurationSettings.AppSettings["povezava"]);
if (sqlConnection1.State==ConnectionState.Closed)
{
sqlConnection1.Open();
}
SqlCommand command = new SqlCommand( "update posta1 set signature = @imgData " +
" where id = @ID", sqlConnection1 );
SqlParameter param1 = new SqlParameter( "@imgData", SqlDbType.Image );
param1.Value = imgbin;
command.Parameters.Add( param1 );
SqlParameter param4 = new SqlParameter( "@ID", SqlDbType.VarChar,10);
param4.Value = dfPosta.Text;
command.Parameters.Add( param4 );

int numRowsAffected = command.ExecuteNonQuery();
sqlConnection1.Close();
return numRowsAffected;
}
GeneralRe: CRYSTAL REPORTS - load image Pin
nelsonpaixao14-Oct-08 12:31
nelsonpaixao14-Oct-08 12:31 
GeneralRe: CRYSTAL REPORTS - load image Pin
nelsonpaixao15-Oct-08 13:21
nelsonpaixao15-Oct-08 13:21 
GeneralRe: CRYSTAL REPORTS - load image Pin
teddddddddddd15-Oct-08 19:41
teddddddddddd15-Oct-08 19:41 
QuestionWrite to Ms word document ??? Pin
TALHAKOSEN13-Oct-08 10:01
TALHAKOSEN13-Oct-08 10:01 
GeneralRe: Write to Ms word document ??? Pin
led mike13-Oct-08 10:10
led mike13-Oct-08 10:10 
AnswerRe: Write to Ms word document ??? Pin
#realJSOP13-Oct-08 10:53
mve#realJSOP13-Oct-08 10:53 
GeneralRe: Write to Ms word document ??? Pin
Pete O'Hanlon13-Oct-08 11:15
mvePete O'Hanlon13-Oct-08 11:15 
JokeRe: Write to Ms word document ??? Pin
Paul Conrad13-Oct-08 12:02
professionalPaul Conrad13-Oct-08 12:02 
AnswerRe: Write to Ms word document ??? Pin
Priya Prk13-Oct-08 12:11
Priya Prk13-Oct-08 12:11 
GeneralRe: Write to Ms word document ??? Pin
TALHAKOSEN13-Oct-08 20:16
TALHAKOSEN13-Oct-08 20:16 
GeneralSolution Pin
TALHAKOSEN14-Oct-08 0:51
TALHAKOSEN14-Oct-08 0:51 
GeneralRe: Solution Pin
nadinechemali19-Dec-10 21:52
nadinechemali19-Dec-10 21:52 
QuestionCOM Send Receive Pin
mehrdadc4813-Oct-08 8:54
mehrdadc4813-Oct-08 8:54 
AnswerRe: COM Send Receive Pin
Giorgi Dalakishvili13-Oct-08 9:21
mentorGiorgi Dalakishvili13-Oct-08 9:21 
QuestionData transfer between two computer over the internet Pin
Majid_grok13-Oct-08 8:36
Majid_grok13-Oct-08 8:36 
AnswerRe: Data transfer between two computer over the internet Pin
Wes Aday13-Oct-08 8:40
professionalWes Aday13-Oct-08 8:40 
GeneralRe: Data transfer between two computer over the internet Pin
Jammer13-Oct-08 8:55
Jammer13-Oct-08 8:55 

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.