Quote:
'code to check if it is a shapefile
Two options:
1) Basic - just check the extension.
Path.GetExtension Method (System.IO) | Microsoft Docs[
^] will return ".SHP" or ".TXT" as appropriate. But ... why do you allow non ".SHP" files if you only want those?
2) Advanced: read the file and check it as a valid shapefile. Complicated, but this may help:
GIS – How to Check a Shapefile’s Data in C# – Insights into Software Development[
^], yes, it's in C#. Provided it's in a separate assembly, thatisn;t a problem, your VB code can use it.
Quote:
'code to save shapefile in database
Read the file as binary data into a Byte array.
Create an INSERT command connected to your DB, and pass the Byte array directly as a parameter.
Execute the command to SQL.