|
-
Jul 29th, 2021, 09:36 PM
#1
Thread Starter
Member
Treeview Save and Retrieve Data
I need help on saving contents of my Treeview control to MSSQL 2008 Database and also retrieve it back and display on the TreeView.
I have been searching online since 2 days now and cant really get help on this for VB6.
Please help.
-
Jul 29th, 2021, 10:24 PM
#2
Re: Treeview Save and Retrieve Data
What part are you having trouble with? Basically you just read the data from the treeview and write it to the db and do the reverse to load it back to the tree view.
What OS are you using? MS SQL 2008 is a bit long in the tooth and I am pretty sure it doesn't work under Windows 10.
-
Jul 29th, 2021, 11:37 PM
#3
Thread Starter
Member
Re: Treeview Save and Retrieve Data
 Originally Posted by DataMiser
What part are you having trouble with? Basically you just read the data from the treeview and write it to the db and do the reverse to load it back to the tree view.
What OS are you using? MS SQL 2008 is a bit long in the tooth and I am pretty sure it doesn't work under Windows 10.
I need the complete code snippet. I have low knowledge about Treeview. I had to use it on a new project and am able to Parse a Json string to my Treeview and it shows up well. Now i want to be able to save in in MSSQL 2008 Database and be able to retrieve it again in the future.
I am using Windows 7.
Thanks much.
-
Jul 30th, 2021, 12:29 AM
#4
Re: Treeview Save and Retrieve Data
you can save treeview to json,and:
Load Json data to Treeview by ScriptControl Activex With vb6-VBForums
https://www.vbforums.com/showthread....vb6&highlight=
-
Jul 30th, 2021, 01:03 AM
#5
Thread Starter
Member
Re: Treeview Save and Retrieve Data
 Originally Posted by xiaoyao
Thanks. I have been able to do this. I can save my Treeview contents to Json and load from Json too. Done this. What i need is how to save contents of Treeview to MSSQL Database and able to load from the database again at any time. When data is loaded from Json and displayed on Treeview, i want to be able to save that content in the MSSQL database, so the user can always bring out the information from the database anytime, instead of having to call the URL all over again.
-
Jul 30th, 2021, 04:25 AM
#6
Re: Treeview Save and Retrieve Data
that's the second question,not json.
it's like ,how to save and read field from sql server
you can use ado or adodc ocx control
Last edited by xiaoyao; Jul 30th, 2021 at 04:35 AM.
-
Jul 30th, 2021, 01:34 PM
#7
Thread Starter
Member
Re: Treeview Save and Retrieve Data
 Originally Posted by xiaoyao
that's the second question,not json.
it's like ,how to save and read field from sql server
you can use ado or adodc ocx control
Been reading this and i think i get what you mean. Since i can show my Json on Treeview, i should focus on saving my Json file to the database. Kindly help with code to save a Json file like the one below to the database and also to retrieve it back from database.
Thanks.
Code:
{
"status": true,
"detail": "Verification Successful",
"data": {
"Number": "000001900019",
"Batchnumber": "677899 444404",
"Linked": "9",
"FullName": "Tuoyo Dante",
"Gender": "Male",
"LinkedEmail": null,
"PerformanceSummary": [
{
"BALANCE": "0",
"AMOUNT": "EUR 0",
"OVERDUE_AMOUNT": "0"
},
{
"BALANCE": "0",
"AMOUNT": "EUR 2,000",
"OVERDUE_AMOUNT": "0"
},
{
"BALANCE": "8,256",
"AMOUNT": "EUR 6,350,020",
"OVERDUE_AMOUNT": "0"
}
]
}
}
-
Jul 30th, 2021, 01:58 PM
#8
Re: Treeview Save and Retrieve Data
Use built-in functions (SQL Server) to validate, query, and change JSON data
2020/06/03
Applies to: Yes SQL Server 2016 (13.x) and later versions
Validate, Query, and Change JSON Data with Built-in Functions - SQL Server | Microsoft Docs
https://docs.microsoft.com/en-us/sql...l-server-ver15
SELECT JSON_VALUE(f.doc, '$.id') AS Name,
JSON_VALUE(f.doc, '$.address.city') AS City,
JSON_VALUE(f.doc, '$.address.county') AS County
FROM Families f
WHERE JSON_VALUE(f.doc, '$.id') = N'AndersenFamily'
ORDER BY JSON_VALUE(f.doc, '$.address.city') DESC, JSON_VALUE(f.doc, '$.address.state') ASC
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|