Hi All
I have text files having queries like below.
[code=sql]
INSERT INTO tblJobScrap ([logoimage],[lea],[Region],[jobtitle],[ClosingDate],[PayScale],[Contract],[institutionName],[JobDesc],[extlink]) VALUES ('http://www.aberdeencit y.gov.uk/webapps/images/genericicons/acc-logo.gif','Aber deen','Scotland ','School Crossing Patroller','No fixed closing date','£6.0100 p.h.','£6.37-£6.65 p.h.','Permanen t','','http://www.aberdeencit y.gov.uk/webapps/jobs/jobDetails.asp? id=5591')[/code]
[code=sql]
INSERT INTO tblJobScrap ([logoimage],[lea],[Region],[jobtitle],[ClosingDate],[PayScale],[Contract],[institutionName],[JobDesc],[extlink]) VALUES ('http://www.aberdeencit y.gov.uk/webapps/images/genericicons/acc-logo.gif','Aber deen','Scotland ','Aquatics Teacher','No fixed closing date','£12.8900 p.h.','£11.03-£12.60 p.h.','R','','h ttp://www.aberdeencit y.gov.uk/webapps/jobs/jobDetails.asp? id=5595')
[/code]
I read into the file using asp.net code
This code read the text file successfully and insert queries are successfully executed but the £ signs are converted to ? marks. When I print the text using response.write I get the below text. On the browser the £(? mark) sign show like a box.
[code=sql]
INSERT INTO tblJobScrap ([logoimage],[lea],[Region],[jobtitle],[ClosingDate],[PayScale],[Contract],[institutionName],[JobDesc],[extlink]) VALUES ('http://www.aberdeencit y.gov.uk/webapps/images/genericicons/acc-logo.gif','Aber deen','Scotland ','School Crossing Patroller','No fixed closing date','?6.0100 p.h.','?6.37-?6.65 p.h.','Permanen t','','http://www.aberdeencit y.gov.uk/webapps/jobs/jobDetails.asp? id=5591')
[/code]
[code=sql]
INSERT INTO tblJobScrap ([logoimage],[lea],[Region],[jobtitle],[ClosingDate],[PayScale],[Contract],[institutionName],[JobDesc],[extlink]) VALUES ('http://www.aberdeencit y.gov.uk/webapps/images/genericicons/acc-logo.gif','Aber deen','Scotland ','Aquatics Teacher','No fixed closing date','?12.8900 p.h.','?11.03-?12.60 p.h.','R','','h ttp://www.aberdeencit y.gov.uk/webapps/jobs/jobDetails.asp? id=5595')
[/code]
I don't know why £ sign are converted to ? marks.
Waiting for quick response. Thanks in advance
I have text files having queries like below.
[code=sql]
INSERT INTO tblJobScrap ([logoimage],[lea],[Region],[jobtitle],[ClosingDate],[PayScale],[Contract],[institutionName],[JobDesc],[extlink]) VALUES ('http://www.aberdeencit y.gov.uk/webapps/images/genericicons/acc-logo.gif','Aber deen','Scotland ','School Crossing Patroller','No fixed closing date','£6.0100 p.h.','£6.37-£6.65 p.h.','Permanen t','','http://www.aberdeencit y.gov.uk/webapps/jobs/jobDetails.asp? id=5591')[/code]
[code=sql]
INSERT INTO tblJobScrap ([logoimage],[lea],[Region],[jobtitle],[ClosingDate],[PayScale],[Contract],[institutionName],[JobDesc],[extlink]) VALUES ('http://www.aberdeencit y.gov.uk/webapps/images/genericicons/acc-logo.gif','Aber deen','Scotland ','Aquatics Teacher','No fixed closing date','£12.8900 p.h.','£11.03-£12.60 p.h.','R','','h ttp://www.aberdeencit y.gov.uk/webapps/jobs/jobDetails.asp? id=5595')
[/code]
I read into the file using asp.net code
Code:
<%
Dim df As DirectoryInfo = New DirectoryInfo(Server.MapPath("~/ScrapJobs"))
path = Server.MapPath("~/ScrapJobs/test.txt")
fp = File.OpenText(path)
sql = fp.ReadToEnd()
'response.write(sql)
sql1 = Split(sql, "INSERT")
fp.Close()
fp = Nothing
For j = 1 To UBound(sql1) 'loop through all the insert queries.
On Error Resume Next
ExecuteNonQry("INSERT " & sql1(j))
Next
%>
[code=sql]
INSERT INTO tblJobScrap ([logoimage],[lea],[Region],[jobtitle],[ClosingDate],[PayScale],[Contract],[institutionName],[JobDesc],[extlink]) VALUES ('http://www.aberdeencit y.gov.uk/webapps/images/genericicons/acc-logo.gif','Aber deen','Scotland ','School Crossing Patroller','No fixed closing date','?6.0100 p.h.','?6.37-?6.65 p.h.','Permanen t','','http://www.aberdeencit y.gov.uk/webapps/jobs/jobDetails.asp? id=5591')
[/code]
[code=sql]
INSERT INTO tblJobScrap ([logoimage],[lea],[Region],[jobtitle],[ClosingDate],[PayScale],[Contract],[institutionName],[JobDesc],[extlink]) VALUES ('http://www.aberdeencit y.gov.uk/webapps/images/genericicons/acc-logo.gif','Aber deen','Scotland ','Aquatics Teacher','No fixed closing date','?12.8900 p.h.','?11.03-?12.60 p.h.','R','','h ttp://www.aberdeencit y.gov.uk/webapps/jobs/jobDetails.asp? id=5595')
[/code]
I don't know why £ sign are converted to ? marks.
Waiting for quick response. Thanks in advance
Comment