Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Convert Ink Data

Convert Ink Data

Scheduled Pinned Locked Moved C#
questioncsharpjavascriptasp-netdatabase
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    realmontanakid
    wrote on last edited by
    #1

    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.. protected String SerializeInkData() { if(inko.Ink.Strokes.Count > 0) { byte[] inkDataBytes = inko.Ink.Save(PersistenceFormat.Gif); return Convert.ToBase64String(inkDataBytes); } return String.Empty; } And then give it back.. public string InkData { get { if (inko.Enabled) { return SerializeInkData(); } else { return String.Empty; } } } 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? SqlConnection conn = new SqlConnection(connStr); conn.Open(); string img = this.BodyInkData.Value; //string tmp = this.byteLen.Value.ToString(); string insert = "INSERT INTO TestTable (Image) VALUES ('" + img + "')"; SqlCommand cmd = new SqlCommand(insert,conn); cmd.ExecuteNonQuery(); conn.Close(); 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

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups