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
chandresh kalsariya
NA
57
1.3k
store all data in index0. split string and store into array.
Jan 5 2018 6:24 AM
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
public partial class User_Basket : System.Web.UI.Page
{
string s;
string t;
string[] a = new string[4];
protected void Page_Load(object sender, EventArgs e)
{
DataTable dt = new DataTable();
dt.Columns.AddRange( new DataColumn[4]{new DataColumn("Product_name"), new DataColumn("Product_qty"), new DataColumn("Product_price"), new DataColumn("Category")});
if (Request.Cookies["ck"] != null)
{
s = Convert.ToString(Request.Cookies["ck"].Values);
string[] strarr = s.Split('|');
for (int i = 0; i < strarr.Length; i++)
{
t = Convert.ToString(strarr[i].ToString());
string[] strarr1 = t.Split(',');
for (int j = 0; j < strarr1.Length; j++)
{
a[j] = strarr1[j].ToString();
}
dt.Rows.Add(a[0].ToString(), a[1].ToString(), a[2].ToString(), a[3].ToString());
// stroe all string in index 0 .
//how to fix this?
}
}
d1.DataSource = dt;
d1.DataBind();
}
}
Reply
Answers (
2
)
How can i get difference between two dates?
Help with Array question