0

I'm working with Topaz signature capture system,SigPlusNet. The SDK has a method for storing the captured signature into a long ASCII string.

 'Method 1--storing as an ASCII string value
           strSig = SigPlusNET1.GetSigString()

I've taken the stored value and put it into my database successfully as dbtype(text)

DoData.InsertData("insert into images(imagename, image) values ('DansFirst','" & strSig & "')")

I can't seem to find a way to make it back into an image.

Dale K
  • 25,246
  • 15
  • 42
  • 71
dashley
  • 66
  • 6
  • 1
    Aside... the `image`, `text` and `ntext` data types have been deprecated since at least SQL Server 2005. Their replacements are `varbinary(max)`, `varchar(max)` and `nvarchar(max)` respectively. – AlwaysLearning Feb 27 '23 at 00:05
  • 4
    Why don't you skip the hassle, and have Topaz generate an actual file, put that file on the file system, and just store the path/URL in the database? SQL Server must be the most expensive basic image processor in the world - think about the cost of licensing and that super-fast storage you want your database to be on, and you're going to waste all that changing text to an image and back? I need to blog about this again... – Aaron Bertrand Feb 27 '23 at 00:53
  • 1
    @AaronBertrand's point is very valid .... but to answer your question simply, doesn't a combination of SetSigString(), followed by GetSigImage() not get you an image object from the previously saved text string? – Craig Feb 27 '23 at 01:11
  • 4
    Also, I don't really think it's worth tagging either "sql" or "sql-server" for this question - it really has nothing to do with either. (Yes, you are are saving your string of text to a SQL Server database, but you could have just as easily been writing the text string to a file - the fact of where you're saving the text string is not any part of the issue that you are trying to overcome) – Craig Feb 27 '23 at 01:13
  • @AaronBertrand: I'd use MS SQL's [FileTable](https://learn.microsoft.com/en-us/sql/relational-databases/blob/filetables-sql-server?view=sql-server-ver16) for this. Which is basically what you suggested but w/o the need to track the references yourself. – Hel O'Ween Feb 27 '23 at 10:28
  • @HelO'Ween That's a valid option for on-prem, but some flavors will make that a no-op. [No FileTable in Azure](https://learn.microsoft.com/en-us/azure/azure-sql/database/transact-sql-tsql-differences-sql-server?view=azuresql#t-sql-syntax-statements-with-partial-differences), for example. And if you're developing locally or in staging environments with Containers or Azure SQL Edge, both of which I do, or k8s, which I don't, that also makes it a tough sell. The workaround in Azure is to use blob storage, which kind of defeats the only benefit to having the image in the database: tx consistency. – Aaron Bertrand Feb 27 '23 at 14:30
  • -Craig, It's my first shot at this system and I wasn't aware of the "SetSigString" method. Is that where I store the retrieved image string from the database.? Sure sounds like it. -I haven't settled where I want to store the image in absolute as of yet. This is a desktop app on 3 machines that are networked and two home applications. So it's either in house or up at Godaddy so all can share the same info. Still working on the logistics. This is a work in pogress still. More to come – dashley Mar 02 '23 at 17:48

0 Answers0