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.
Printable View
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.
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.
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=
Attachment 181946
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.
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"
}
]
}
}
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