<span id="mktg5"></span>

<i id="mktg5"><meter id="mktg5"></meter></i>

        <label id="mktg5"><meter id="mktg5"></meter></label>
        最新文章專(zhuān)題視頻專(zhuān)題問(wèn)答1問(wèn)答10問(wèn)答100問(wèn)答1000問(wèn)答2000關(guān)鍵字專(zhuān)題1關(guān)鍵字專(zhuān)題50關(guān)鍵字專(zhuān)題500關(guān)鍵字專(zhuān)題1500TAG最新視頻文章推薦1 推薦3 推薦5 推薦7 推薦9 推薦11 推薦13 推薦15 推薦17 推薦19 推薦21 推薦23 推薦25 推薦27 推薦29 推薦31 推薦33 推薦35 推薦37視頻文章20視頻文章30視頻文章40視頻文章50視頻文章60 視頻文章70視頻文章80視頻文章90視頻文章100視頻文章120視頻文章140 視頻2關(guān)鍵字專(zhuān)題關(guān)鍵字專(zhuān)題tag2tag3文章專(zhuān)題文章專(zhuān)題2文章索引1文章索引2文章索引3文章索引4文章索引5123456789101112131415文章專(zhuān)題3
        問(wèn)答文章1 問(wèn)答文章501 問(wèn)答文章1001 問(wèn)答文章1501 問(wèn)答文章2001 問(wèn)答文章2501 問(wèn)答文章3001 問(wèn)答文章3501 問(wèn)答文章4001 問(wèn)答文章4501 問(wèn)答文章5001 問(wèn)答文章5501 問(wèn)答文章6001 問(wèn)答文章6501 問(wèn)答文章7001 問(wèn)答文章7501 問(wèn)答文章8001 問(wèn)答文章8501 問(wèn)答文章9001 問(wèn)答文章9501
        當(dāng)前位置: 首頁(yè) - 科技 - 知識(shí)百科 - 正文

        DataView.RowFilter的使用(包括in,like等SQL中的操作符)

        來(lái)源:懂視網(wǎng) 責(zé)編:小采 時(shí)間:2020-11-27 22:42:51
        文檔

        DataView.RowFilter的使用(包括in,like等SQL中的操作符)

        DataView.RowFilter的使用(包括in,like等SQL中的操作符):DataView RowFilter Syntax [C#] This example describes syntax of DataView.RowFil ter expression. It shows how to correctly build expression string (without „SQL injection) using methods to escape values. Column names If a column name
        推薦度:
        導(dǎo)讀DataView.RowFilter的使用(包括in,like等SQL中的操作符):DataView RowFilter Syntax [C#] This example describes syntax of DataView.RowFil ter expression. It shows how to correctly build expression string (without „SQL injection) using methods to escape values. Column names If a column name

        DataView RowFilter Syntax [C#]
        This example describes syntax of DataView.RowFil ter expression. It shows how to correctly build expression string (without „SQL injection“) using methods to escape values.

        Column names
        If a column name contains any of these special characters ~ ( ) # / / = > < + - * % & | ^ ' " [ ], you must enclose the column name within square brackets [ ]. If a column name contains right bracket ] or backslash /, escape it with backslash (/] or //).

        [C#]

        dataView.RowFilter = "id = 10"; // no special character in column name "id" dataView.RowFilter = "$id = 10"; // no special character in column name "$id" dataView.RowFilter = "[#id] = 10"; // special character "#" in column name "#id" dataView.RowFilter = "[[id/]] = 10"; // special characters in column name "[id]"
        Literals
        String values are enclosed within single quotes ' '. If the string contains single quote ', the quote must be doubled.

        [C#]

        dataView.RowFilter = "Name = 'John'" // string value dataView.RowFilter = "Name = 'John ''A'''" // string with single quotes "John 'A'" dataView.RowFilter = String.Format("Name = '{0}'", "John 'A'".Replace("'", "''"));
        Number values are not enclosed within any characters. The values should be the same as is the result of int.ToString() or float.ToString() method for invariant or English culture.

        [C#]

        dataView.RowFilter = "Year = 2008" // integer value dataView.RowFilter = "Price = 1199.9" // float value dataView.RowFilter = String.Format(CultureInfo.InvariantCulture.NumberFormat, "Price = {0}", 1199.9f);
        Date values are enclosed within sharp characters # #. The date format is the same as is the result of DateTime.ToString() method for invariant or English culture.

        [C#]

        dataView.RowFilter = "Date = #12/31/2008#" // date value (time is 00:00:00) dataView.RowFilter = "Date = #2008-12-31#" // also this format is supported dataView.RowFilter = "Date = #12/31/2008 16:44:58#" // date and time value dataView.RowFilter = String.Format(CultureInfo.InvariantCulture.DateTimeFormat, "Date = #{0}#", new DateTime(2008, 12, 31, 16, 44, 58));
        Alternatively you can enclose all values within single quotes ' '. It means you can use string values for numbers or date time values. In this case the current culture is used to convert the string to the specific value.

        [C#]

        dataView.RowFilter = "Date = '12/31/2008 16:44:58'" // if current culture is English dataView.RowFilter = "Date = '31.12.2008 16:44:58'" // if current culture is German dataView.RowFilter = "Price = '1199.90'" // if current culture is English dataView.RowFilter = "Price = '1199,90'" // if current culture is German
        Comparison operators
        Equal, not equal, less, greater operators are used to include only values that suit to a comparison expression. You can use these operators = <> < <= > >=.

        Note: String comparison is culture-sensitive, it uses CultureInfo from DataTable.Locale property of related table (dataView.Table.Locale). If the property is not explicitly set, its default value is DataSet.Locale (and its default value is current system culture Thread.Curren tThread.Curren tCulture).

        [C#]

        dataView.RowFilter = "Num = 10" // number is equal to 10 dataView.RowFilter = "Date < #1/1/2008#" // date is less than 1/1/2008 dataView.RowFilter = "Name <> 'John'" // string is not equal to 'John' dataView.RowFilter = "Name >= 'Jo'" // string comparison
        Operator IN is used to include only values from the list. You can use the operator for all data types, such as numbers or strings.

        [C#]

        dataView.RowFilter = "Id IN (1, 2, 3)" // integer values dataView.RowFilter = "Price IN (1.0, 9.9, 11.5)" // float values dataView.RowFilter = "Name IN ('John', 'Jim', 'Tom')" // string values dataView.RowFilter = "Date IN (#12/31/2008#, #1/1/2009#)" // date time values dataView.RowFilter = "Id NOT IN (1, 2, 3)" // values not from the list
        Operator LIKE is used to include only values that match a pattern with wildcards. Wildcard character is * or %, it can be at the beginning of a pattern '*value', at the end 'value*', or at both '*value*'. Wildcard in the middle of a patern 'va*lue' is not allowed.

        [C#]

        dataView.RowFilter = "Name LIKE 'j*'" // values that start with 'j' dataView.RowFilter = "Name LIKE '%jo%'" // values that contain 'jo' dataView.RowFilter = "Name NOT LIKE 'j*'" // values that don't start with 'j'
        If a pattern in a LIKE clause contains any of these special characters * %

        聲明:本網(wǎng)頁(yè)內(nèi)容旨在傳播知識(shí),若有侵權(quán)等問(wèn)題請(qǐng)及時(shí)與本網(wǎng)聯(lián)系,我們將在第一時(shí)間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com

        文檔

        DataView.RowFilter的使用(包括in,like等SQL中的操作符)

        DataView.RowFilter的使用(包括in,like等SQL中的操作符):DataView RowFilter Syntax [C#] This example describes syntax of DataView.RowFil ter expression. It shows how to correctly build expression string (without „SQL injection) using methods to escape values. Column names If a column name
        推薦度:
        • 熱門(mén)焦點(diǎn)

        最新推薦

        猜你喜歡

        熱門(mén)推薦

        專(zhuān)題
        Top
        主站蜘蛛池模板: 久久久久亚洲AV无码专区首JN| 国产成人综合亚洲AV第一页| 最近高清国语中文在线观看免费| 国产jizzjizz免费视频| 人人狠狠综合久久亚洲婷婷| 久久亚洲国产成人影院| a毛片免费播放全部完整| 在线免费观看一区二区三区| 亚洲成av人片在线观看无码不卡| 91av免费在线视频| 国产高清在线免费视频| 亚洲精品人成在线观看| 一级毛片a免费播放王色电影 | 国产极品粉嫩泬免费观看| 亚洲JLZZJLZZ少妇| 2021在线观看视频精品免费| 亚洲精品卡2卡3卡4卡5卡区| 国产成人综合亚洲绿色| 国产精品1024永久免费视频| 亚洲国产精品无码中文字| 久久免费观看国产精品88av| 亚洲午夜国产精品无码老牛影视| 亚洲日韩在线中文字幕综合| 免费观看激色视频网站bd | 麻豆最新国产剧情AV原创免费| 亚洲精品无码久久千人斩| 久久免费线看线看| 亚洲乱码中文字幕综合| 十八禁无码免费网站| 亚洲国产成人一区二区三区| 最近2019中文字幕免费直播| 久久丫精品国产亚洲av不卡 | 黄页网站在线免费观看| 日韩视频在线免费| 亚洲综合无码无在线观看| 一二三四免费观看在线电影| 亚洲女人初试黑人巨高清| 日本h在线精品免费观看| 日韩色视频一区二区三区亚洲| 国产精品亚洲аv无码播放| 成年女人18级毛片毛片免费观看|