using System.Collections.Generic;
List<string> allLines = new List<string>();
allLines.Clear();
string[] ldf = { "#$#" }; //put the character "#$#" instead of space..
string[] lines = File.ReadAllLines("D:\stringfile.txt");
string curLine = String.Empty;
for (int j = 0; j < lines.Length; j++)
{
curLine = Insert(lines[j].Split(ldf, StringSplitOptions.None)[0].Replace("'", "''"), lines[j].Split(ldf, StringSplitOptions.None)[1].Replace("'", "''"), 5);
allLines.Add(curLine);
}
string[] _allLines = allLines.ToArray();
File.WriteAllLines("Querrymerged.txt", _allLines);
//Function making the querry using string
private string Insert(string text1, string text2, string no)
{
return "Insert into table (no,feild1,feild2) values (" + no+ ",'" + text1 + "','" + text2 + "')";
}
Tuesday, October 27, 2009
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment