Click here to Skip to main content
15,559,459 members
Home / Discussions / C#
   

C#

 
GeneralRe: Owner drawn menus Pin
Heath Stewart15-Jan-04 5:48
protectorHeath Stewart15-Jan-04 5:48 
GeneralRe: Owner drawn menus Pin
UB16-Jan-04 6:39
UB16-Jan-04 6:39 
GeneralScrolled object positioning Pin
Jinwah14-Jan-04 23:08
Jinwah14-Jan-04 23:08 
GeneralRe: Scrolled object positioning Pin
Heath Stewart15-Jan-04 5:38
protectorHeath Stewart15-Jan-04 5:38 
GeneralPlease give me an idea. Pin
god4k14-Jan-04 22:31
god4k14-Jan-04 22:31 
GeneralRe: Please give me an idea. Pin
Jinwah15-Jan-04 0:47
Jinwah15-Jan-04 0:47 
GeneralRe: Please give me an idea. Pin
Heath Stewart15-Jan-04 5:29
protectorHeath Stewart15-Jan-04 5:29 
GeneralInserting and Updating BLOBS Pin
Guinness4Strength14-Jan-04 19:28
Guinness4Strength14-Jan-04 19:28 
I have the following code:
<br />
<br />
try<br />
{<br />
	string ConnString;<br />
	ConnString="Provider=SQLOLEDB;";<br />
	ConnString+="data source=127.0.0.1;";<br />
	ConnString+="initial catalog=AutoConvert;";<br />
	ConnString+="password=password;";<br />
	ConnString+="persist security info=False;";<br />
	ConnString+="user id=sa;";<br />
	OleDbConnection dbConn = new OleDbConnection(ConnString);<br />
	dbConn.Open();<br />
	<br />
	FileStream fs = File.Open("c:\\temp\\output.dat",FileMode.Open);<br />
	BinaryReader BR = new BinaryReader(fs);<br />
	byte [] BLOB=BR.ReadBytes(Convert.ToInt32(fs.Length));<br />
	DataBase.InsertBLOB(dbConn,"Documents","BatchName","1234567",true,"Document",BLOB);<br />
	dbConn.Close();<br />
<br />
}<br />
catch(Exception Err)<br />
{<br />
	Console.WriteLine(Err.Message);<br />
}<br />
<br />
<br />
<br />
<br />
static public void InsertBLOB(OleDbConnection db,string Table,string LookUpField,string LookUpData,bool IsLookUpString,string BLOBField,byte [] BLOB)<br />
{<br />
	try<br />
	{<br />
		string Command;<br />
		if(IsLookUpString)<br />
			Command= String.Format("UPDATE {0} SET {1}=@{1} WHERE({2}='{3}')",<br />
						Table,BLOBField,LookUpField,LookUpData);<br />
		else<br />
			Command= String.Format("UPDATE {0} SET {1}=@{1} WHERE({2}={3})",<br />
						Table,BLOBField,LookUpField,LookUpData);<br />
		OleDbCommand addEmp = new OleDbCommand(Command, db); <br />
		addEmp.Parameters.Add("@"+BLOBField,BLOB);<br />
		addEmp.ExecuteNonQuery();<br />
	}<br />
	catch(Exception Err)<br />
	{<br />
		throw new Exception(Err.Message);<br />
	}<br />
}<br />


addEmp.ExecuteNonQuery throws an exception witht he message:
"You must define @Document"
I copied the code almost directly from MSDN, but I can't get it to work...Any ideas ?
Oh and in my AutoConvert Catalog I have the table Documents with an image field of length 16 called Document.
GeneralRe: Inserting and Updating BLOBS Pin
Heath Stewart15-Jan-04 5:24
protectorHeath Stewart15-Jan-04 5:24 
GeneralRe: Inserting and Updating BLOBS Pin
Guinness4Strength15-Jan-04 5:44
Guinness4Strength15-Jan-04 5:44 
GeneralRe: Inserting and Updating BLOBS Pin
Heath Stewart15-Jan-04 7:54
protectorHeath Stewart15-Jan-04 7:54 
GeneralRe: Inserting and Updating BLOBS Pin
Guinness4Strength15-Jan-04 9:20
Guinness4Strength15-Jan-04 9:20 
QuestionBest way of tracking remoting clients? Pin
Alex Korchemniy14-Jan-04 19:21
Alex Korchemniy14-Jan-04 19:21 
AnswerRe: Best way of tracking remoting clients? Pin
occcy14-Jan-04 22:22
occcy14-Jan-04 22:22 
GeneralRe: Best way of tracking remoting clients? Pin
Heath Stewart15-Jan-04 4:57
protectorHeath Stewart15-Jan-04 4:57 
AnswerRe: Best way of tracking remoting clients? Pin
Heath Stewart15-Jan-04 5:03
protectorHeath Stewart15-Jan-04 5:03 
GeneralRe: Best way of tracking remoting clients? Pin
Alex Korchemniy15-Jan-04 5:37
Alex Korchemniy15-Jan-04 5:37 
GeneralRe: Best way of tracking remoting clients? Pin
Heath Stewart15-Jan-04 10:41
protectorHeath Stewart15-Jan-04 10:41 
GeneralCustom Attributes Pin
pnolan14-Jan-04 14:53
pnolan14-Jan-04 14:53 
GeneralRe: Custom Attributes Pin
Heath Stewart15-Jan-04 4:55
protectorHeath Stewart15-Jan-04 4:55 
GeneralI still didn't found what I was looking for - C# Service installation Pin
Pinho14-Jan-04 13:53
Pinho14-Jan-04 13:53 
GeneralRe: I still didn't found what I was looking for - C# Service installation Pin
Heath Stewart15-Jan-04 4:50
protectorHeath Stewart15-Jan-04 4:50 
GeneralNeed several listviews to all sort at same time...or a listview that can have subitems that each have their own icon Pin
FocusedWolf14-Jan-04 13:45
FocusedWolf14-Jan-04 13:45 
GeneralRe: Need several listviews to all sort at same time...or a listview that can have subitems that each have their own icon Pin
FocusedWolf14-Jan-04 13:50
FocusedWolf14-Jan-04 13:50 
GeneralNeed several listviews to all sort at same time...or a listview that can have subitems that each have their own icon Pin
FocusedWolf14-Jan-04 13:45
FocusedWolf14-Jan-04 13:45 

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.