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

C#

 
QuestionIP Lookup Pin
quocbao7-Feb-06 21:52
quocbao7-Feb-06 21:52 
AnswerRe: IP Lookup Pin
Mridang Agarwalla7-Feb-06 23:39
Mridang Agarwalla7-Feb-06 23:39 
AnswerRe: IP Lookup Pin
WetRivrRat8-Feb-06 2:39
WetRivrRat8-Feb-06 2:39 
Questionmsde2000 backup Pin
JacquesDP7-Feb-06 21:52
JacquesDP7-Feb-06 21:52 
QuestionGDI Graphics Z-Order Pin
Dowfen7-Feb-06 21:49
Dowfen7-Feb-06 21:49 
AnswerRe: GDI Graphics Z-Order Pin
Ingo7-Feb-06 22:49
Ingo7-Feb-06 22:49 
GeneralRe: GDI Graphics Z-Order Pin
Dowfen8-Feb-06 6:38
Dowfen8-Feb-06 6:38 
QuestionConvert Ink Data Pin
realmontanakid7-Feb-06 21:42
realmontanakid7-Feb-06 21:42 
Hi

I work on a ASP.net Webapplication where a user can interact with the Microsoft.Ink.

I push a Windows.Forms.Control on the client. In this control i implement some methods. On the client i can use them by using javascript.

I got the following problem.

This is the Method in the UserControl that gives me a Base64String..

<br />
		protected String SerializeInkData()<br />
		{<br />
			if(inko.Ink.Strokes.Count > 0) <br />
			{<br />
				byte[] inkDataBytes = inko.Ink.Save(PersistenceFormat.Gif);<br />
				return Convert.ToBase64String(inkDataBytes);<br />
			}<br />
<br />
			return String.Empty;<br />
		}<br />


And then give it back..

<br />
		public string InkData <br />
		{<br />
			get <br />
			{<br />
				if (inko.Enabled) <br />
				{<br />
					return SerializeInkData();<br />
				}<br />
				else<br />
				{<br />
					return String.Empty;<br />
				}<br />
			}<br />
		} <br />


Ok.. on the client I call the InkData Method by using javascript and save the Data into a hidden field. The client app is a asp.net site.

While the site is post back to the server i read the content of the hidden field and try to save it in a database.

The Column is from datatype IMAGE.

But it don't work. I think that i have to convert the string of the hidden field into an byte[] Array.. But how?

<br />
						SqlConnection conn = new SqlConnection(connStr);<br />
<br />
						conn.Open();<br />
						<br />
						string img		= this.BodyInkData.Value;<br />
						//string tmp		= this.byteLen.Value.ToString();<br />
<br />
						string insert = "INSERT INTO TestTable (Image) VALUES ('" + img + "')"; <br />
						SqlCommand cmd = new SqlCommand(insert,conn);<br />
<br />
						cmd.ExecuteNonQuery();<br />
<br />
						conn.Close();<br />


How can I convert the string to a byte[] and save as BLOB into the Database?

Greeting from Germany

-- modified at 3:43 Wednesday 8th February, 2006
QuestionApplication Update Pin
JacquesDP7-Feb-06 21:22
JacquesDP7-Feb-06 21:22 
AnswerRe: Application Update Pin
Ingo7-Feb-06 23:00
Ingo7-Feb-06 23:00 
QuestionTextbox zooming Pin
NewbieDude7-Feb-06 21:22
NewbieDude7-Feb-06 21:22 
AnswerRe: Textbox zooming Pin
Stanciu Vlad7-Feb-06 21:41
Stanciu Vlad7-Feb-06 21:41 
GeneralRe: Textbox zooming Pin
NewbieDude7-Feb-06 21:43
NewbieDude7-Feb-06 21:43 
GeneralRe: Textbox zooming Pin
Ingo7-Feb-06 23:06
Ingo7-Feb-06 23:06 
QuestionAutomated windows logon Pin
Esmo20007-Feb-06 20:59
Esmo20007-Feb-06 20:59 
AnswerRe: Automated windows logon Pin
Sean Michael Murphy8-Feb-06 7:07
Sean Michael Murphy8-Feb-06 7:07 
QuestionSuggestions and ideas wanted Pin
RobinCox7-Feb-06 19:51
RobinCox7-Feb-06 19:51 
AnswerRe: Suggestions and ideas wanted Pin
Ingo7-Feb-06 23:09
Ingo7-Feb-06 23:09 
GeneralRe: Suggestions and ideas wanted Pin
RobinCox8-Feb-06 7:16
RobinCox8-Feb-06 7:16 
QuestionString Escapes Pin
Expert Coming7-Feb-06 19:28
Expert Coming7-Feb-06 19:28 
AnswerRe: String Escapes Pin
DigitalKing7-Feb-06 20:32
DigitalKing7-Feb-06 20:32 
QuestionToolTips for custom tabs Pin
Libor Tinka7-Feb-06 13:45
Libor Tinka7-Feb-06 13:45 
AnswerRe: ToolTips for custom tabs Pin
Ingo7-Feb-06 23:14
Ingo7-Feb-06 23:14 
GeneralRe: ToolTips for custom tabs Pin
Libor Tinka7-Feb-06 23:37
Libor Tinka7-Feb-06 23:37 
GeneralRe: ToolTips for custom tabs Pin
Ingo8-Feb-06 0:24
Ingo8-Feb-06 0:24 

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.