Replace function
...
Bing
...
ASP.NET
...
0
/1363
...
2 years 3 months ago
Today I was thinking about adding some new functions to my Blog. The fist function I thought about was adding the ""Recent Comments"" to my Blog.I opened the Access ,and tested the query string in Access.All of these samed to beperfect. However ,I was nearly driven to be crazy for the query didn't work in ADO.NET.The codesare like these: In Access:
SELECT name, Replace(email,'@','haha') AS newEmail, qq FROM Message;
In C#:
oleDbConnection _connection = new oleDbConnection();
_connection.ConnectionString = ""Provider=Microsoft.Jet.oleDb.4.0;Data Source=Message.mdb"";
_connection.Open();
oleDbCommand _command = new oleDbCommand();
_command.Connection = _connection;
_command.CommandType = CommandType.StoredProcedure;
_command.CommandText = ""pro1"";
oleDbDataReader _reader = _command.ExecuteReader();
Then it threw out an oleDbExceptionError: undefined ""Replace"" function(未定义的""Replace""函数)
So I tried to get the answer from Google and Baidu.After trying about 10 websites who had met the same question,I gave up,for all of them cann'tfiguer out a good way to sovle this problem.Can anybody give me an answer,thanks a lot!
"