<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
        主站蜘蛛池模板: 学生妹亚洲一区二区| 666精品国产精品亚洲| 国产成人亚洲综合无| 成人免费777777| 亚洲欧洲av综合色无码| 在线免费视频一区| 亚洲av日韩综合一区久热| 国产成人免费a在线资源| 18pao国产成视频永久免费| 亚洲无线电影官网| h视频在线观看免费完整版| 亚洲另类视频在线观看| 妞干网免费视频在线观看| 亚洲aⅴ无码专区在线观看春色 | 一级全免费视频播放| 久久久久久A亚洲欧洲AV冫| 成人无码WWW免费视频| 日本人护士免费xxxx视频| 色网站在线免费观看| 国产精品亚洲mnbav网站| 久久精品电影免费动漫| 亚洲国产成AV人天堂无码| 日本免费一区尤物| 久久一区二区免费播放| 亚洲一本综合久久| 在线免费观看一区二区三区| 看免费毛片天天看| 亚洲av无码乱码国产精品fc2| 麻豆成人久久精品二区三区免费| 中文字幕亚洲男人的天堂网络| 国产精品酒店视频免费看| 在线免费视频你懂的| 亚洲免费电影网站| 亚洲av无码国产精品色在线看不卡| 两个人看的www免费高清| 精品久久久久久亚洲精品| 亚洲国产婷婷香蕉久久久久久| 久久免费国产视频| 免费一级全黄少妇性色生活片| 亚洲综合精品一二三区在线| 免费国产成人高清在线观看麻豆 |