Search Results

Search found 62 results on 3 pages for 'flueras bogdan'.

Page 3/3 | < Previous Page | 1 2 3 

  • Linq generic Expression in query on "element" or on IQueryable (multiple use)

    - by Bogdan Maxim
    Hi, I have the following expression public static Expression<Func<T, bool>> JoinByDateCheck<T>(T entity, DateTime dateToCheck) where T : IDateInterval { return (entityToJoin) => entityToJoin.FromDate.Date <= dateToCheck.Date && (entityToJoin.ToDate == null || entityToJoin.ToDate.Value.Date >= dateToCheck.Date); } IDateInterval interface is defined like this: interface IDateInterval { DateTime FromDate {get;} DateTime? ToDate {get;} } and i need to apply it in a few ways: (1) Query on Linq2Sql Table: var q1 = from e in intervalTable where FunctionThatCallsJoinByDateCheck(e, constantDateTime) select e; or something like this: intervalTable.Where(FunctionThatCallsJoinByDateCheck(e, constantDateTime)) (2) I need to use it in some table joins (as linq2sql doesn't provide comparative join): var q2 = from e1 in t1 join e2 in t2 on e1.FK == e2.PK where OtherFunctionThatCallsJoinByDateCheck(e2, e1.FromDate) or var q2 = from e1 in t1 from e2 in t2 where e1.FK == e2.PK && OtherFunctionThatCallsJoinByDateCheck(e2, e1.FromDate) (3) I need to use it in some queries like this: var q3 = from e in intervalTable.FilterFunctionThatCallsJoinByDateCheck(constantDate); Dynamic linq is not something that I can use, so I have to stick to plain linq. Thank you Clarification: Initially I had just the last method (FilterFunctionThatCallsJoinByDateCheck(this IQueryable<IDateInterval> entities, DateTime dateConstant) ) that contained the code from the expression. The problem is that I get a SQL Translate exception if I write the code in a method and call it like that. All I want is to extend the use of this function to the where clause (see the second query in point 2)

    Read the article

  • [Reloaded] Error while sorting filtered data from a GridView

    - by Bogdan M
    Hello guys, I have an error I cannot solve, on a ASP.NET website. One of its pages - Countries.aspx, has the following controls: a CheckBox called "CheckBoxNAME": < asp:CheckBox ID="CheckBoxNAME" runat="server" Text="Name" /> a TextBox called "TextBoxName": < asp:TextBox ID="TextBoxNAME" runat="server" Width="100%" Wrap="False"> < /asp:TextBox> a SQLDataSource called "SqlDataSourceCOUNTRIES", that selects all records from a Table with 3 columns - ID (Number, PK), NAME (Varchar2(1000)), and POPULATION (Number) called COUNTRIES < asp:SqlDataSource ID="SqlDataSourceCOUNTRIES" runat="server" ConnectionString="< %$ ConnectionStrings:myDB %> " ProviderName="< %$ ConnectionStrings:myDB.ProviderName %> " SelectCommand="SELECT COUNTRIES.ID, COUNTRIES.NAME, COUNTRIES.POPULATION FROM COUNTRIES ORDER BY COUNTRIES.NAME, COUNTRIES.ID"> < /asp:SqlDataSource> a GridView called GridViewCOUNTRIES: < asp:GridView ID="GridViewCOUNTRIES" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" DataSourceID="SqlDataSourceCOUNTRIES" DataKeyNames="ID" DataMember="DefaultView"> < Columns> < asp:CommandField ShowSelectButton="True" /> < asp:BoundField DataField="ID" HeaderText="Id" SortExpression="ID" /> < asp:BoundField DataField="NAME" HeaderText="Name" SortExpression="NAME" /> < asp:BoundField DataField="POPULATION" HeaderText="Population" SortExpression="POPULATION" /> < /Columns> < /asp:GridView> a Button called ButtonFilter: < asp:Button ID="ButtonFilter" runat="server" Text="Filter" onclick="ButtonFilter_Click"/> This is the onclick event: protected void ButtonFilter_Click(object sender, EventArgs e) { Response.Redirect("Countries.aspx?" + (this.CheckBoxNAME.Checked ? string.Format("NAME={0}", this.TextBoxNAME.Text) : string.Empty)); } Also, this is the main onload event of the page: protected void Page_Load(object sender, EventArgs e) { if (Page.IsPostBack == false) { if (Request.QueryString.Count != 0) { Dictionary parameters = new Dictionary(); string commandTextFormat = string.Empty; if (Request.QueryString["NAME"] != null) { if (commandTextFormat != string.Empty && commandTextFormat.EndsWith("AND") == false) { commandTextFormat += "AND"; } commandTextFormat += " (UPPER(COUNTRIES.NAME) LIKE '%' || :NAME || '%') "; parameters.Add("NAME", Request.QueryString["NAME"].ToString()); } this.SqlDataSourceCOUNTRIES.SelectCommand = string.Format("SELECT COUNTRIES.ID, COUNTRIES.NAME, COUNTRIES.POPULATION FROM COUNTRIES WHERE {0} ORDER BY COUNTRIES.NAME, COUNTRIES.ID", commandTextFormat); foreach (KeyValuePair parameter in parameters) { this.SqlDataSourceCOUNTRIES.SelectParameters.Add(parameter.Key, parameter.Value.ToUpper()); } } } } Basicly, the page displays in the GridViewCOUNTRIES all the records of table COUNTRIES. The scenario is the following: - the user checks the CheckBox; - the user types a value in the TextBox (let's say "ch"); - the user presses the Button; - the page loads displaying only the records that match the filter criteria (in this case, all the countries that have names containing "Ch"); - the user clicks on the header of the column called "Name" in order to sort the data in the GridView Then, I get the following error: ORA-01036: illegal variable name/number. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Data.OracleClient.OracleException: ORA-01036: illegal variable name/number Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. Any help is greatly appreciated, tnks. PS: I'm using ASP.NET 3.5, under Visual Studio 2008, with an OracleXE database.

    Read the article

  • Need help configuring IIS 5.1 on XP

    - by S Bogdan
    Hello everybody. Fist of all I want to say IIS to me is like a vending machine to a monkey. So I have Windows XP SP2 with IIS 5.1 on it and an ASP.NET Web Forms project. I just want my website to be accessed by someone else from the internet or from my local network. How do I configure IIS so that is possible? I tried a lot of user guides, but I don't know what I did wrong cause all I got was Page not foud and Service Unavailable. Thanks in advance for all your guidance and answers.

    Read the article

  • copy child collection to another object

    - by Bogdan
    Hi everyone, I have a one-to-many relationship between Part and Params (a "Part" has many "Params). I'm trying to do something naive like this: Part sourcePart = em.find(Part.class, partIdSource); Part destPart = em.find(Part.class, partIdDest); Collection<Param> paramListSource = sourcePart.getParamList(); destPart.setParamList(paramListSource); Basically I want to copy all the parameters from sourcePart to destPart. Hopefully the persistence provider will automatically set the right foreign keys in the Param table/entity. The above code will obviously not work. Is there any easy way of doing this, or do I have to do create a new collection, then add each Param (creating new Param, setting attributes, etc) ?

    Read the article

  • mysql LAST_INSERT_ID() used with multiple records INSERT statement

    - by bogdan
    Hello, If i insert multiple records with a loop that executes a single record insert, the last insert id returned is, as expected, the last one... but if i do a multiple records insert statement: INSERT INTO people (name,age) VALUES('William',25),('Bart',15),('Mary',12); let's say the three above are the first records inserted in the table...after the insert statement i expected last insert id to return 3, but it returned 1...the first insert id for the statement in question... So can someone please confirm if this is the normal behavior of LAST_INSERT_ID() in the context of multiple records INSERT statements...so i can base my code on it thanks :)

    Read the article

  • Constructor/Destructor involving a class and a struct

    - by Bogdan Maier
    I am working on a program and need to make an array of objects, specifically I have a 31x1 array where each position is an object, (each object is basically built out of 6 ints). Here is what I have but something is wrong and i could use some help thank you. 31x1 struct header" const int days=31; struct Arr{ int days; int *M; }; typedef Arr* Array; 31x1 matrix constructor: void constr(){ int *M; M = new Expe[31]; // Expe is the class class header: class Expe { private: //0-HouseKeeping, 1-Food, 2-Transport, 3-Clothing, 4-TelNet, 5-others int *obj; } Class object constructor: Expe::Expe() { this->obj=new int[6]; } help please... because i`m pretty lost.

    Read the article

  • JPA and aggregate functions. How do I use the result of the query?

    - by Bogdan
    Hey guys, I'm new to ORM stuff and I need some help understanding something. Let's assume I have the following standard SQL query: SELECT *, COUNT(test.testId) AS noTests FROM inspection LEFT JOIN test ON inspection.inspId = test.inspId GROUP BY inspection.inspId which I want to use in JPA. I have an Inspection entity with a one-to-many relationship to a Test entity. (an inspection has many tests) I tried writing this in JPQL: Query query = em.createQuery("SELECT insp, COUNT(???what???) FROM Inspection insp LEFT JOIN insp.testList " + "GROUP BY insp.inspId"); 1) How do I write the COUNT clause? I'd have to apply count to elements from the test table but testList is a collection, so I can't do smth like COUNT(insp.testList.testId) 2) Assuming 1 is resolved, what type of object will be returned. It will definitely not be an Inspection object... How do I use the result?

    Read the article

  • Why would someone use WHERE 1=1 AND <conditions> in a SQL clause?

    - by Bogdan Maxim
    Why would someone use WHERE 1=1 AND <conditions> in a SQL clause (Either SQL obtained through concatenated strings, either view definition) I've seen somewhere that this would be used to protect against SQL Injection, but it seems very weird. If there is injection WHERE 1 = 1 AND injected OR 1=1 would have the same result as injected OR 1=1. Later edit: What about the usage in a view definition?

    Read the article

  • Syntax error. Help with one small JS snippet :(

    - by Bogdan
    Hey guys. I don't know much JS, but I wanted to do some quick work with jQuery. But I've been staring at this for about an hour and I don't understand what I missed: <script type="text/javascript"> $('#qty_6035').change(function () { var substractedQty, stockQty, remQty; substractedQty = (int) $('#qty_6035').val(); // missing ; before statement stockQty = (int) $('#orig_qty_6035').val(); $('#rem_qty_6035').html(stockQty-substractedQty); }); </script> jQuery library is included at the beggining of the document. Thanks.

    Read the article

  • Data Mining Resources

    - by Dejan Sarka
    There are many different types of analyses, each one with its own pros and cons. Relational reports have a predefined structure, and end users cannot change it. They are simple to use for end users. Reports can use real-time data and snapshots of data to show the state of a report at specific points in time. One of the drawbacks is that report authoring is limited to IT pros and advanced users. Any kind of dynamic restructuring is very limited. If real-time data is used for a report, the report has a negative impact on the performance of the source system. Processing of the reports might be slow because the data comes from relational database management systems, which are not optimized for reporting only. If you create a semantic model of your data, your end users can create ad-hoc report structures. However, the development is more complex because a developer is needed to create these semantic models. For OLAP, you typically use specialized database management systems. You get lightning speed of analyses. End users can use rich and thin clients to interactively change the structure of the report. Typically, they do it graphically. However, the development of an OLAP system is many times quite complex. It involves the preparation and maintenance of an enterprise data warehouse and OLAP cubes. In order to exploit the possibility of real-time restructuring of reports, the users must be both active and educated. The data is usually stale, as it is loaded into data warehouses and OLAP cubes with a scheduled process. With data mining, a structure is not selected in advance; it searches for the structure. As a result, data mining can give you the most valuable results because you can discover patterns you did not expect. A data mining model structure is limited only by the attributes that you use to train the model. One of the drawbacks is that a lot of knowledge is needed for a successful data mining project. End users have to understand the results. Subject matter experts and IT professionals need to understand business problem thoroughly. The development might be sometimes even more complex than the development of OLAP cubes. Each type of analysis has its own place in an enterprise system. SQL Server has tools for all kinds of analyses. However, data mining is the most advanced way of analyzing the data; this is the “I” in BI. In order to get the most out of it, you need to learn quite a lot. In this blog post, I am gathering together resources for learning, including forthcoming events. Books Multiple authors: SQL Server MVP Deep Dives – I wrote an introductory data mining chapter there. Erik Veerman, Teo Lachev and Dejan Sarka: MCTS Self-Paced Training Kit (Exam 70-448): Microsoft SQL Server 2008 - Business Intelligence Development and Maintenance – you can find a good overview of a complete BI solution, including data mining, in this book. Jamie MacLennan, ZhaoHui Tang, and Bogdan Crivat: Data Mining with Microsoft SQL Server 2008 – can’t miss this book if you want to mine your data with SQL Server tools. Michael Berry, Gordon Linoff: Mastering Data Mining: The Art and Science of Customer Relationship Management – data mining from both, business and technical perspective. Dorian Pyle: Data Preparation for Data Mining – an in-depth book about data preparation. Thomas and Ronald Wonnacott: Introductory Statistics – if you thought that you could get away without statistics, then you are not serious about data mining. Jiawei Han and Micheline Kamber: Data Mining Concepts and Techniques – in-depth explanation of the most popular data mining algorithms. Michael Berry and Gordon Linoff: Data Mining Techniques – another book that explains data mining algorithms, more fro a business perspective. Paolo Guidici: Applied Data Mining – very mathematical book, only if you enjoy statistics and mathematics in general. Forthcoming presentations I am presenting two data mining related sessions during the PASS Summit in Charlotte, NC: Wednesday, October 16th, 2013 - Fraud Detection: Notes from the Field – I am showing how to use data mining for a specific business problem. The presentation is based on real-life projects. Friday, October 18th: Excel 2013 Advanced Analytics – I am focusing on Excel Data Mining Add-ins, and how to use them together with Power Pivot and other add-ins. This is the most you can get out of Excel. Sinergija 2013, Belgrade, Serbia Tuesday, October 22nd: Excel 2013 Analytics to the Max – another presentation focusing on the most advanced analytics you can get in Excel. SQL Rally Amsterdam, Netherlands Thursday, November 7th: Advanced Analytics in Excel 2013 – and again I am presenting about data mining in Excel. Why three different titles for the same presentation? I don’t know, I guess I forgot the name I proposed every time right after I sent the proposal. Courses Data Mining with SQL Server 2012 – I wrote a 3-day course for SolidQ. If you are interested in this course, which I could also deliver in a shorter seminar way, you can contact your closes SolidQ subsidiary, or, of course, me directly on addresses [email protected] or [email protected]. This course could also complement the existing courseware portfolio of training providers, which are welcome to contact me as well. OK, now you know: no more excuses, start learning data mining, get the most out of your data

    Read the article

< Previous Page | 1 2 3