Ejemplo n.º 1
0
        private static void Test_Command_QuoteIdentifier()
        {
            string query = "select id,name from t";
            OleDbDataAdapter dataAdapter = new OleDbDataAdapter(query, conn);

            OleDbCommandBuilder commandBuilder = new OleDbCommandBuilder(dataAdapter);

            string sql_quote_conn = commandBuilder.QuoteIdentifier("select id,name from t", conn);
            Assert.AreEqual(sql_quote_conn, "\"select id,name from t\"");

            string sql_unquote_conn = commandBuilder.UnquoteIdentifier("\"select id,name from t\"", conn);
            Assert.AreEqual(sql_unquote_conn, "select id,name from t");
        }