Click here to Skip to main content
16,006,013 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Error C2264 Pin
Waldermort16-Aug-06 7:41
Waldermort16-Aug-06 7:41 
GeneralRe: Error C2264 Pin
alunw16-Aug-06 8:00
alunw16-Aug-06 8:00 
AnswerRe: Error C2264 Pin
Zac Howland16-Aug-06 10:25
Zac Howland16-Aug-06 10:25 
QuestionTrouble linking with particular libs Pin
AceCoolie16-Aug-06 7:20
AceCoolie16-Aug-06 7:20 
AnswerRe: Trouble linking with particular libs Pin
alunw16-Aug-06 8:22
alunw16-Aug-06 8:22 
GeneralRe: Trouble linking with particular libs Pin
AceCoolie16-Aug-06 10:57
AceCoolie16-Aug-06 10:57 
QuestionConvert Convert C# code to C++ 2005 with extended stored procedure Pin
sea200616-Aug-06 7:00
sea200616-Aug-06 7:00 
AnswerRe: Convert Convert C# code to C++ 2005 with extended stored procedure [modified] Pin
sea200616-Aug-06 7:02
sea200616-Aug-06 7:02 
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using System.IO;

namespace SaveImagesToSQLServer
{

class Class1
{

[STAThread]
public static int Main(string[] args)
{
int errorCode = 0;
Class1 oMain = new Class1();
string sConStr = "Data Source=YANG;Initial Catalog=NorthWind;Integrated Security = True";

int iUserID = Convert.ToInt32(args[0]);
string sRequestTime = @args[1];
string sImageType = @args[2];
string sFilePath = @args[3];

FileInfo fi = new FileInfo(sFilePath);

FileStream oImg;
BinaryReader oBinaryReader;
byte[] oImgByteArray;

if (fi.Exists)
{
try
{
oImg = new FileStream(sFilePath, FileMode.Open, FileAccess.Read);
oBinaryReader = new BinaryReader(oImg);
oImgByteArray = oBinaryReader.ReadBytes((int)oImg.Length);
oBinaryReader.Close();
oImg.Close();
oMain.SaveImage(sConStr, iUserID, sRequestTime, sImageType, oImgByteArray);
}
catch (Exception e) { Console.WriteLine(e.Message); }
}
else
{
errorCode = 2;
}
return errorCode;

}


public void SaveImage(string sConnectionString,
int iUserID,
string sRequestTime,
string sImageType,
byte[] oImage)
{

SqlConnection oConn = new SqlConnection();

try
{

oConn.ConnectionString = sConnectionString;
oConn.Open();

SqlCommand oCmd = new SqlCommand("dbo.qp_SaveImage", oConn);

oCmd.CommandType = CommandType.StoredProcedure;

oCmd.Parameters.Add(new SqlParameter("@iUserID", SqlDbType.Int));
oCmd.Parameters.Add(new SqlParameter("@vcRequestTime", SqlDbType.VarChar, 100));
oCmd.Parameters.Add(new SqlParameter("@vcImageType", SqlDbType.VarChar, 50));
oCmd.Parameters.Add(new SqlParameter("@imImageFile", SqlDbType.Image, 2147483647));


oCmd.Parameters["@iUserID"].Value = iUserID;
oCmd.Parameters["@vcRequestTime"].Value = sRequestTime;
oCmd.Parameters["@vcImageType"].Value = sImageType;
oCmd.Parameters["@imImageFile"].Value = oImage;

oCmd.ExecuteNonQuery();

}
catch (Exception e) { Console.WriteLine(e.Message); }
finally { if (oConn.State == ConnectionState.Open) { oConn.Close(); } }
}
}
}




-- modified at 13:02 Wednesday 16th August, 2006
Questionmultiple selection list box Pin
kumar_mk16-Aug-06 6:51
kumar_mk16-Aug-06 6:51 
AnswerRe: multiple selection list box Pin
Chris Losinger16-Aug-06 7:01
professionalChris Losinger16-Aug-06 7:01 
GeneralRe: multiple selection list box Pin
kumar_mk16-Aug-06 7:24
kumar_mk16-Aug-06 7:24 
AnswerRe: multiple selection list box Pin
David Crow16-Aug-06 7:25
David Crow16-Aug-06 7:25 
QuestionOperator Overloading Pin
RichardS16-Aug-06 6:17
RichardS16-Aug-06 6:17 
AnswerRe: Operator Overloading Pin
valikac16-Aug-06 8:03
valikac16-Aug-06 8:03 
AnswerRe: Operator Overloading Pin
Zac Howland16-Aug-06 10:34
Zac Howland16-Aug-06 10:34 
GeneralRe: Operator Overloading Pin
RichardS16-Aug-06 21:00
RichardS16-Aug-06 21:00 
QuestionPaint/Invalidate problem ( HTML browser ) maybe WS_CLIPCHILDREN related ? Pin
Maximilien16-Aug-06 6:01
Maximilien16-Aug-06 6:01 
QuestionTCP socket time out Pin
nahitan16-Aug-06 5:36
nahitan16-Aug-06 5:36 
AnswerRe: TCP socket time out [modified] Pin
S Douglas22-Aug-06 21:11
professionalS Douglas22-Aug-06 21:11 
QuestionSyntax problems Pin
Jay0316-Aug-06 5:19
Jay0316-Aug-06 5:19 
AnswerRe: Syntax problems Pin
Rage16-Aug-06 5:23
professionalRage16-Aug-06 5:23 
GeneralRe: Syntax problems Pin
Jay0316-Aug-06 5:51
Jay0316-Aug-06 5:51 
GeneralRe: Syntax problems Pin
led mike16-Aug-06 5:59
led mike16-Aug-06 5:59 
GeneralRe: Syntax problems Pin
Hamid_RT17-Aug-06 6:20
Hamid_RT17-Aug-06 6:20 
QuestionIssues with HtmlHelp Pin
Shaffiq16-Aug-06 4:19
Shaffiq16-Aug-06 4:19 

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.