• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# QueryInfo类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中QueryInfo的典型用法代码示例。如果您正苦于以下问题:C# QueryInfo类的具体用法?C# QueryInfo怎么用?C# QueryInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



QueryInfo类属于命名空间,在下文中一共展示了QueryInfo类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: ExecuteQuerySimple

		/// <summary>
		/// The execute query simple.
		/// </summary>
		/// <param name="query">The query.</param>
		/// <param name="parameterValues">The parameter values.</param>
		/// <param name="version">The version.</param>
		/// <param name="progress">The progress.</param>
		/// <param name="groups">The groups.</param>
		/// <returns>
		/// The <see cref="QueryInstanceResultInfo" />.
		/// </returns>
		public QueryInstanceResultInfo ExecuteQuerySimple(
			QueryInfo                query,
			QueryExecutionParams     parameters,
			InstanceVersion          version,
			ProgressItem             progress,
			params GroupDefinition[] groups
		)
		{
			// Log.InfoFormat("73:query:'{0}'",
			// 	query
			// );

			QueryInstanceResultInfo result = new QueryInstanceResultInfo(this.Instance);
			QueryItemInfo queryItem        = query.Items.GetQueryItemForVersion(version);

			this.PrepareProgress(progress, groups);

			this.ExecuteQuery(
				query,
				parameters,
				progress,
				groups,
				result,
				queryItem
			);

			return result;
		}
开发者ID:saycale,项目名称:MSSQLServerAuditor,代码行数:39,代码来源:BaseQueryExecutor.cs


示例2: GetStatementTest

        public void GetStatementTest()
        {
            var inf = new QueryInfo();
            var input1 = "select * from A";
            (inf.AsDynamic().GetStatement(input1) as string[]).IsStructuralEqual(new[] { "select * from A" });

            var input2 = "select * from A;";
            (inf.AsDynamic().GetStatement(input2) as string[]).IsStructuralEqual(new[] { "select * from A" });

            var input3 = "select * from A; select * from B";
            (inf.AsDynamic().GetStatement(input3) as string[]).IsStructuralEqual(new[] { "select * from A", "select * from B" });

            var input4 = @"" + Environment.NewLine +
                      @" create trigger set_foo_primary for foo" + Environment.NewLine +
                      @"before insert" + Environment.NewLine +
                      @"" + Environment.NewLine +
                      @"as begin" + Environment.NewLine +
                      @"" + Environment.NewLine +
                      @"new.a = gen_id(gen_foo, 1);" + Environment.NewLine +
                      @"end" + Environment.NewLine +
                      @";" + Environment.NewLine +
                      @"  select* from A;" + Environment.NewLine +
                      @" create table V(a integer, b nvarchar(5))";
            (inf.AsDynamic().GetStatement(input4) as string[]).IsStructuralEqual(new[] {
                  @"create trigger set_foo_primary for foo" + Environment.NewLine +
                      @"before insert" + Environment.NewLine +
                      @"" + Environment.NewLine +
                      @"as begin" + Environment.NewLine +
                      @"" + Environment.NewLine +
                      @"new.a = gen_id(gen_foo, 1);" + Environment.NewLine +
                      @"end" ,
                "select* from A", "create table V(a integer, b nvarchar(5))" });
        }
开发者ID:degarashi0913,项目名称:FAManagementStudio,代码行数:33,代码来源:QueryInfoTests.cs


示例3: Load

        /// <summary>
        /// Load the artist search.
        /// </summary>
        public override void Load(XmlDocument doc, QueryInfo query)
        {
            last_query = query;

            foreach (Widget widget in album_box.Children)
                album_box.Remove (widget);

            XmlNodeList list = doc.GetElementsByTagName ("getArtistResponse");
            if (list.Count == 0)
                return;

            string artist = null;
            XmlNodeList albums_node = null;

            //look for artist name
            foreach (XmlNode node in list[0].ChildNodes)
            {
                if (node.Name == "artist")
                {
                    artist = node.InnerText;
                    search_title.Markup = "<b><big><big>" + Utils.ParseMarkup (artist) + "</big></big></b>\n";
                }
                else if (node.Name == "albums")
                    albums_node = node.ChildNodes;
            }

            if (albums_node == null || albums_node.Count == 0)
                return;

            string name = null;
            string year = null;

            album_box.PackStart (new HSeparator (), false, false, 2);

            foreach (XmlNode node in albums_node)
            {
                switch (node.Name)
                {
                    case "album":
                        name = node.InnerText;
                        break;

                    case "year":
                        if (node.InnerText != "0")
                            year = node.InnerText;
                        break;

                    case "songs":
                        Album album = new Album (artist, name, year, node.ChildNodes);

                        album_box.PackStart (new AlbumBox (album, main), false ,false, 0);
                        album_box.PackStart (new HSeparator (), false, false, 2);

                        name = null;
                        year = null;
                        break;
                }
            }
        }
开发者ID:gsterjov,项目名称:fusemc,代码行数:62,代码来源:SearchArtist.cs


示例4: GetModel

 public static Word GetModel(QueryInfo queryInfo)
 {
     List<Word> list = GetList(queryInfo);
     if (list == null || list.Count == 0)
         return null;
     else
         return list[0];
 }
开发者ID:BJTAWJ,项目名称:webmis,代码行数:8,代码来源:WordsBase.gen.cs


示例5: GetModel

 public static SmallClass GetModel(QueryInfo queryInfo)
 {
     List<SmallClass> list = GetList(queryInfo);
     if (list == null || list.Count == 0)
         return null;
     else
         return list[0];
 }
开发者ID:BJTAWJ,项目名称:webmis,代码行数:8,代码来源:SmallClasssBase.gen.cs


示例6: GetModel

 public static ItemInCustomSmallType GetModel(QueryInfo queryInfo)
 {
     List<ItemInCustomSmallType> list = GetList(queryInfo);
     if (list == null || list.Count == 0)
         return null;
     else
         return list[0];
 }
开发者ID:BJTAWJ,项目名称:webmis,代码行数:8,代码来源:ItemInCustomSmallTypesBase.gen.cs


示例7: GetQuery

        /// <summary>
        /// The query to execute.
        /// </summary>
        public override string GetQuery(QueryInfo query)
        {
            if (query.Equals (last_query, QueryField.Username))
                return null;

            string url = "http://ws.audioscrobbler.com/1.0/user/{0}/topartists.xml";
            return ParseQuery (url, query.Username);
        }
开发者ID:gsterjov,项目名称:fusemc,代码行数:11,代码来源:TopArtists.cs


示例8: GetQuery

        /// <summary>
        /// The query to execute.
        /// </summary>
        public override string GetQuery(QueryInfo query)
        {
            if (query.Equals (last_query, QueryField.Artist, QueryField.Title))
                return null;

            string url = "http://lyricwiki.org/api.php?artist={0}&song={1}&fmt=xml";
            return ParseQuery (url, query.Artist, query.Title);
        }
开发者ID:gsterjov,项目名称:fusemc,代码行数:11,代码来源:SongLyrics.cs


示例9: GetQuery

        /// <summary>
        /// The query to execute.
        /// </summary>
        public override string GetQuery(QueryInfo query)
        {
            if (query.Equals (last_query, QueryField.Artist, QueryField.Album))
                return null;

            string url = "http://ws.audioscrobbler.com/1.0/album/{0}/{1}/info.xml";
            return ParseQuery (url, query.Artist, query.Album);
        }
开发者ID:gsterjov,项目名称:fusemc,代码行数:11,代码来源:AlbumDetails.cs


示例10: GetQuery

        /// <summary>
        /// The query to execute.
        /// </summary>
        public override string GetQuery(QueryInfo query)
        {
            if (query.Equals (last_query, QueryField.Artist))
                return null;

            string url = "http://ws.audioscrobbler.com/1.0/artist/{0}/toptracks.xml";
            return ParseQuery (url, query.Artist);
        }
开发者ID:gsterjov,项目名称:fusemc,代码行数:11,代码来源:TopTracks.cs


示例11: GetModel

 public static CustomBigType GetModel(QueryInfo queryInfo)
 {
     List<CustomBigType> list = GetList(queryInfo);
     if (list == null || list.Count == 0)
         return null;
     else
         return list[0];
 }
开发者ID:BJTAWJ,项目名称:webmis,代码行数:8,代码来源:CustomBigTypesBase.gen.cs


示例12: GetQueryForGroups

        /// <inheritdoc />
        protected override QueryItemInfo GetQueryForGroups(QueryInfo query, InstanceVersion version)
        {
            if (query.GroupSelect != null && query.GroupSelect.Count > 0)
            {
                return query.GroupSelect.GetQueryItemForVersion(version);
            }

            return query.DatabaseSelect.GetQueryItemForVersion(version);
        }
开发者ID:saycale,项目名称:MSSQLServerAuditor,代码行数:10,代码来源:DatabaseGroupsResolver.cs


示例13: GetGroups

		/// <summary>
		/// The get groups.
		/// </summary>
		/// <param name="query">
		/// The query information.
		/// </param>
		/// <param name="parameterValues">
		/// The parameter values.
		/// </param>
		/// <param name="version">
		/// The version.
		/// </param>
		/// <returns>
		/// The <see cref="Dictionary{TKey,TValue}"/>.
		/// </returns>
		public virtual ICollection<GroupDefinition> GetGroups(
			QueryInfo                   query,
			IEnumerable<ParameterValue> parameterValues,
			InstanceVersion             version
		)
		{
			var groups = new List<GroupDefinition>();

			// TODO: Create GroupDefinition with childrens
			QueryItemInfo selectGroupsSql = this.GetQueryForGroups(query, version);

			if (selectGroupsSql != null)
			{
				try
				{
					var paramsArray = parameterValues as ParameterValue[] ?? parameterValues.ToArray();

					DataTable[] groupsTabels = this.ExecuteSqlFunction(
						this.Instance,
						selectGroupsSql,
						null,
						query.Parameters,
						paramsArray,
						null,
						true
					);

					foreach (DataTable groupTable in groupsTabels)
					{
						this.AddGroupsFromTable(groupTable, groups);
					}

					if (selectGroupsSql.ChildGroups.IsNullOrEmpty())
					{
						return groups;
					}

					foreach (GroupDefinition groupDefinition in groups)
					{
						this.GetChildGroupsDefinitions(selectGroupsSql, groupDefinition, paramsArray, version);
					}
				}
				catch (OperationCanceledException ex)
				{
					log.Error(ex);
					throw;
				}
				catch (Exception ex)
				{
					log.Error("instance=" + this.Instance.Name + " query=" + query, ex);
				}
			}

			return groups;
		}
开发者ID:saycale,项目名称:MSSQLServerAuditor,代码行数:70,代码来源:BaseGroupResolver.cs


示例14: ExecuteQueryTest

        public void ExecuteQueryTest()
        {
            SetupTestDbFb2();
            var inf = new QueryInfo();
            inf.ExecuteQuery(GetFb2ConnectionString(), "select * from test").ToList()[0].View.Rows.Count.Is(0);

            var result = inf.ExecuteQuery(GetFb2ConnectionString(), "insert into test(int_test, char_test) values (1, 'aaaaaaaaaa');update test set varchar_test = 'testtesttesttest' where int_test = 1;select * from test").ToList();
            result[0].View.Rows[0].Is(x => ((string)x[0]).Contains("実行しました。"));
            result[1].View.Rows[0].Is(x => ((string)x[0]).Contains("更新しました。"));
            result[2].View.Rows.Count.Is(1);
        }
开发者ID:degarashi0913,项目名称:FAManagementStudio,代码行数:11,代码来源:ConnectionTestFb2.cs


示例15: ExecuteQueryTestFb3

        public void ExecuteQueryTestFb3()
        {
            SetupTestDbFb3();
            var inf = new QueryInfo();
            var conStr = GetFb3ConnectionString();
            inf.ExecuteQuery(conStr, "select * from test").ToList()[0].View.Rows.Count.Is(0);

            var result = inf.ExecuteQuery(conStr, "insert into test values (1, 123456789000, null, '12asd', '2016-07-24', 50000, 2.5, 2.5555, 4500, 10, '10:00:00', current_timestamp, 'asdfghjk', true);update test set varchar_test = 'testtesttesttest' where int_test = 1;select * from test").ToList();
            result[0].View.Rows[0].Is(x => ((string)x[0]).Contains("実行しました。"));
            result[1].View.Rows[0].Is(x => ((string)x[0]).Contains("更新しました。"));
            result[2].View.Rows.Count.Is(1);
        }
开发者ID:degarashi0913,项目名称:FAManagementStudio,代码行数:12,代码来源:ConnectionTestFb3.cs


示例16: GetGroups

 /// <inheritdoc />
 public override ICollection<GroupDefinition> GetGroups(QueryInfo query, IEnumerable<ParameterValue> values, InstanceVersion i)
 {
     return new List<GroupDefinition>()
                {
                    new GroupDefinition(this.Instance, string.Empty, string.Empty)
                        {
                            GroupType
                                =
                                QueryScope
                                .Instance
                        }
                };
 }
开发者ID:saycale,项目名称:MSSQLServerAuditor,代码行数:14,代码来源:EmptyGroupsResolver.cs


示例17: Load

        /// <summary>
        /// Load the top tracks.
        /// </summary>
        public override void Load(XmlDocument doc, QueryInfo query)
        {
            last_query = query;
            top_tracks.Clear ();

            XmlNodeList list = doc.GetElementsByTagName ("mostknowntracks");
            if (list.Count == 0)
                return;

            foreach (XmlNode node in list[0].ChildNodes)
                if (node.LocalName == "track")
                    top_tracks.Add (new TopTrack (node.ChildNodes));

            page_navigator.UpdatePageNumber ();
            ShowPage ();
        }
开发者ID:gsterjov,项目名称:fusemc,代码行数:19,代码来源:TopTracks.cs


示例18: Load

        /// <summary>
        /// Load the artist list.
        /// </summary>
        public override void Load(XmlDocument doc, QueryInfo query)
        {
            last_query = query;
            list.Clear ();

            XmlNodeList node_list = doc.GetElementsByTagName ("topartists");
            if (node_list.Count == 0)
                return;

            foreach (XmlNode node in node_list[0].ChildNodes)
                if (node.LocalName == "artist")
                    list.Add (new TopArtist (node));

            page_navigator.UpdatePageNumber ();
            ShowPage ();
        }
开发者ID:gsterjov,项目名称:fusemc,代码行数:19,代码来源:TopArtists.cs


示例19: Page_Load

 protected void Page_Load(object sender, EventArgs e)
 {
     string searchWords = Request.QueryString["SearchWords"];
     string indexNames = Request.QueryString["IndexNames"];
     //Response.Write(searchWords);
     string hostname = ConfigurationManager.AppSettings["HostName"];
     int port = int.Parse(ConfigurationManager.AppSettings["PortNum"]);
     TcpClient client;
     NetworkStream ns;
     BinaryFormatter formater;
     DateTime now = DateTime.Now;
     try
     {
         client = new TcpClient(hostname, port);
         ns = client.GetStream();
         formater = new BinaryFormatter();
         SearchInfo sinfo = new SearchInfo();
         QueryInfo info = new QueryInfo();
         info.IndexNames = "";
         info.SearchWords = searchWords;
         info.IndexNames = indexNames;
         sinfo.Query = info;
         sinfo.PageSize = 10;
         formater.Serialize(ns, sinfo);
         SearchResult sr = (SearchResult)formater.Deserialize(ns);
         //WriteLog(Server.MapPath(".") + "searchutils.log", searchWords, indexNames, sr.Records.Count, sr);
         XmlSerializer xmlSerializer = new XmlSerializer(typeof(SearchResult));
         StringBuilder builder = new StringBuilder();
         StringWriter writer = new StringWriter(builder);
         xmlSerializer.Serialize(writer, sr);
         XmlDocument doc = new XmlDocument();
         doc.LoadXml(builder.ToString());
         writer.Close();
         ns.Close();
         Response.Write(doc.DocumentElement.OuterXml);
         //FileStream fs = new FileStream(@"result.xml", FileMode.Truncate);
         //xmlSerializer.Serialize(writer, fs);
         //fs.Close();
     }
     catch (Exception se)
     {
         Response.Write(se.StackTrace.ToString());
         return;
     }
 }
开发者ID:vikasraz,项目名称:indexsearchutils,代码行数:45,代码来源:searchutils.aspx.cs


示例20: GetStatementTest2

        public void GetStatementTest2()
        {
            var inf = new QueryInfo();
            var input1 =
            @"--comment1
            create trigger set_foo_primary for foo
            before insert
            as begin
            new.a = gen_id(gen_foo, 1);
            end;

            --comment2
            select *
            from test
            where a = 1;

            --comment3
            create trigger set_foo_primary for foo2
            before insert
            as begin
            new.a = gen_id(gen_foo, 1);
            end;

            select * from fuga where hoho = 'eeee'
            --comment4";

            (inf.AsDynamic().GetStatement(input1) as string[]).IsStructuralEqual(new[] {
            @"create trigger set_foo_primary for foo
            before insert
            as begin
            new.a = gen_id(gen_foo, 1);
            end",
            @"select *
            from test
            where a = 1",
            @"create trigger set_foo_primary for foo2
            before insert
            as begin
            new.a = gen_id(gen_foo, 1);
            end",
            @"select * from fuga where hoho = 'eeee'"
            });
        }
开发者ID:degarashi0913,项目名称:FAManagementStudio,代码行数:43,代码来源:QueryInfoTests.cs



注:本文中的QueryInfo类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# QueryJoinClause类代码示例发布时间:2022-05-24
下一篇:
C# QueryHelper类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap