TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Prem Rathore
NA
4
11.2k
json file convert in to dataset using vb.net
Jun 20 2019 1:51 AM
Dear sir
how can convert gstr1 json file in to dataset using vb.net with different tables
my code is below
Private Sub Button10_Click(sender As Object, e As EventArgs) Handles Button10.Click
'Read Json Data From Text File
Dim Json As String = File.ReadAllText("C:\Users\Genuis\Downloads\BP\GSTR1-Jan2017\jan20173.json")
' Dim Json As String = File.ReadAllText("C:\Users\Genuis\Downloads\BP\GSTR1-Jan2017\jan2017.Json")
Dim jsonParts As String() = Json.Replace("[", "").Replace("]", "").Split("},{")
'Convert JSON Data to DataTable
'DataSet myDataTable = JsonConvert.DeserializeObject<DataTable>(Json);
'Convert JSON Data to DataSet
Dim myDataSet As DataSet = JsonConvert.DeserializeObject(Of DataSet)(Json)
'Check Table Count in DataSet
If (myDataSet.Tables.Count > 0) Then
If (myDataSet.Tables(0).Rows.Count > 0) Then
'Bind Table[0] into grdOrderDetails GridView
DataGridView1.DataSource = myDataSet.Tables(0)
' grdOrderDetails.DataBind()
End If
If (myDataSet.Tables(1).Rows.Count > 0) Then
'Bind Table[1] into grdCompanyDetails GridView
DataGridView1.DataSource = myDataSet.Tables(1)
End If
End If
End Sub
Attachment:
Jan2017.rar
Reply
Answers (
1
)
Entity Framework error whilepopulate the TextBox in the form
Count number of times company in database is selected