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
Karthik K
1k
738
192.3k
How to read String Array to Load DataTable in C# ?
Nov 21 2019 11:53 PM
Hi All ,
In My Current Application i would have to read the string array to DataTable in asp.net. Whole structure of string array screen shot in Attatchment. Find the Att..If anyone knows any solution suggest me with sample code.
private
void
AddOrders()
{
var val =
"{\"operator\":1, "
+
" \"table_no\": 1,"
+
" \"Pax\": 0,"
+
" \" order_items\":["
+ OrderItem() +
"] }"
;
Session[
"Order_Items"
] = val;
Arrlist =
new
string
[] { val };
//Response.Write("aw");
// ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alert", "alert('" + Arrlist.ToString() + "');", true);
}
Var val Will
return
the Following Result . This below Data Need to Read and Loaded
in
Datatable ..
{
"operator"
:1,
"table_no"
: 1,
"Pax"
: 0, "
order_items":
[{
"product_id"
: 5,
"product_barcode"
: 88823065,
"product_price"
:12.20,
"quantity"
:1,
"remarks"
:
[{
"remarkName"
:
"Vegetarian+ 0.00 "
},
{
"remarkName"
:
"Meat+ 0.00 "
},
{
"remarkName"
:
"Shirataki Zero C.NDL +2.00"
},
{
"remarkName"
:
"Cauliflower Rice +1.00"
},
{
"remarkName"
:
"SPRITE+ 0.00 "
},
{
"remarkName"
:
"TUNA TATAKI +1.00"
},
{
"remarkName"
:
"Brown Rice+ 0.00 "
}
],
"is_set_meal"
:0,
"manualRemark"
:
""
},
{
"product_id"
: 10,
"product_barcode"
: 8888075005920,
"product_price"
:12.20,
"quantity"
:1,
"remarks"
:[{
"remarkName"
:
"Vegetarian+ 0.00 "
},
{
"remarkName"
:
"Meat+ 0.00 "
},
{
"remarkName"
:
"Cauliflower Rice +1.00"
},
{
"remarkName"
:
"Tendon +3.00"
},
{
"remarkName"
:
"SODA+ 0.00 "
},
{
"remarkName"
:
"SPICY TUNA +2.00"
},
{
"remarkName"
:
"SALMON MENTAI +2.00"
},
{
"remarkName"
:
"SPICY SHIRATAKI NOODLES +2.00"
},
{
"remarkName"
:
"SESAME DRESSING+ 0.00 "
}
],
"is_set_meal"
:0,
"manualRemark"
:
""
}
] }
Thanks in advance
Karthik K
Reply
Answers (
1
)
Mappint 2 or more entities into 1 model (Not AutoMapper)
How to change return of function from string to generic list