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
Nirmal KumarC
1.4k
327
79.1k
how to type 'System.String' to type'System.Data.DataTable'
Sep 12 2014 4:00 AM
I want This problem solved:
Unable to cast object of type 'System.String' to type 'System.Data.DataTable'.
View state value Get source code Here:
string message = TxtMsg.Text;
MatchCollection mc = Regex.Matches(message, @"\*");
int limit = Math.Min(mc.Count, replacements.Length) - 1;
for (int i = limit; i >= 0; i--)
{
message = message.Remove(mc[i].Index, 1).Insert(mc[i].Index, replacements[i]);
}
TxtMsg.Text = message.ToString();
ViewState["Message"] = message.ToString();-
-> here i am get Viewsate data
My source code:
This source how to convert viewstate value convert System.String' to type 'System.Data.DataTable'.
if (ViewState["Message"] != null)
{
DataTable objDt = new DataTable();
objDt = (DataTable)ViewState["Message"];
for (int i = 0; i < objDt.Rows.Count; i++)
{
}
Thanks
Reply
Answers (
1
)
C# Multiple Queries with Microsoft SQL Server
save image in application folder in c# windows applic