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
Cenk Isik
NA
44
30.5k
Please help me for changing data table row value from dictionary
Jul 30 2012 3:45 AM
I have a dictionary I want to read this as for that my data table row value. I'm reading dictionary and data table row value but i cant change row value that coming dictionary value
exception is =Input string was not in a correct format.Couldn't store <Eskisehir> in IL Column. Expected type is Int16.
I fill data table from database and IL column type smallint i dont want to change column type nvarchar or anything else . How i can solve this problem .
My Code Here;
public DataTable getData(string komut)
{
DataTable dt = new DataTable();
cnn = connect.GetConnection();
sorgu = komut;
cmd = new SqlCommand(sorgu, cnn);
adap = new SqlDataAdapter(cmd);
adap.Fill(dt);
for (int i = 0; i < dt.Rows.Count; i++)
{
if (dt.Columns["IL"].ColumnName == "IL")
{
string tmpSehir;
iller.TryGetValue(dt.Rows[i]["IL"].ToString(), out tmpSehir);
dt.Rows[i]["IL"] = tmpSehir;
}
}
return dt;
}
Reply
Answers (
11
)
how to set styles in selected menu item.
Problem for "System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it 127.0.0.1:64855"