Click here to Skip to main content
15,896,118 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
openFileDialog1.ShowDialog();
textBox1.Text = openFileDialog1.FileName;
string fname = openFileDialog1.FileName;
TextReader trs = new StreamReader(@fname);
String s=trs.ReadLine();
s=s.ToString();
while (s != null)
{
  String x = "";

  for (int i = 0; i < s.Length; i++)
  {
    if(s[i]!='.')//add the required special characters along with it
      x += s[i];
  }
  s = x;
  s = trs.ReadLine();
  conn.Open();
  SqlCommand cmd = new SqlCommand("insert into C_word (Words,Category) values('" + s +"','" + comboBox1.SelectedText + "')",conn);
  cmd.ExecuteNonQuery();
  conn.Close();


i got this erroe that String or binary data would be truncated.
The statement has been terminated.
in execute non query ..
Posted
Updated 25-Oct-10 1:52am
v2

Please check the size of column of Words.
maximize it.
 
Share this answer
 
Clarify ????
1. where the while Loop is ends???

2. why you are again reading the
s = trs.ReadLine();
after for loop?

3. what is scope of variable of "x"???
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900