Search Results

Search found 6988 results on 280 pages for 'if else statement'.

Page 21/280 | < Previous Page | 17 18 19 20 21 22 23 24 25 26 27 28  | Next Page >

  • Convert this SQL statement to LINQ-to-SQL

    - by goforebroke
    I have struggled converting this SQL statement to LINQ to SQL VB.Net 9.0. I have used Linqer but no success. Any help would be appreciated select t.TeeId, t.DescriptionId, t.[Description], t.Rating, t.Slope, case when d.TotalHoles <> h.TotalHoles then 0 else 1 end [Status] from dbo.CourseDescription d inner join dbo.CourseTees t on t.DescriptionId = d.DescriptionId inner join (select TeeId, count(*) as TotalHoles from dbo.CourseHoles group by TeeId) h on h.TeeId = t.TeeId where d.CourseId = 1

    Read the article

  • Python: for statement behavior

    - by BandGap
    Hi all. My question concerns the output of this statement: for x in range(4), y in range(4): print x print y Results in: [0, 1, 2, 3] 2 True 2 It seems there is a comparison involved, I just can't figure out why the output is structured like this.

    Read the article

  • jquery validatie if statement

    - by Mariana Hernandez
    i have this validate function: var validator =$('#form1').validate( { ignore: "", rules: { usu_login: { required: true }, usu_email: { required: true }, usu_nombre1: { required: true }, usu_apellido1: { required: true }, usu_fecha_nac: { required: true }, usu_cedula: { required: true }, usu_telefono1: { required: true }, usu_password: { required: function() { return focusout == true; } }, usu_password2: { required: function() { return focusout == true; } }, usu_password3: { required: function() { return focusout == true; }, equalTo: "#usu_password2" } i need to apply the same if statement in the "equalTo" fuction so this can work as i want to, but i dont know how to do that. Dows anyone knows? Thanks

    Read the article

  • I want to do a sql update loop statement, by using the do--while in php

    - by Jean
    Hello, I want to loop the update statement, but it only loops once. Here is the code I am using: do { mysql_select_db($database_ll, $ll); $query_query= "update table set ex='$71[1]' where field='val'"; $query = mysql_query($query_query, $ll) or die(mysql_error()); $row_domain_all = mysql_fetch_assoc($query); } while ($row_query = mysql_fetch_assoc($query)); Thanks Jean

    Read the article

  • C# empty statement

    - by dotnetdev
    In C#, I can write something like: using (new MyDisposableClass().MethodA()); The semicolon causes a compiler warning to be shown which states possible mistaken empty statement. I haven't run the above code but won't the method still be called? What uses is there of this type of coding convention? I saw another thread on here about this but I ask in case there areny differences now/therefore different replies. Thanks

    Read the article

  • Nhibernate generate plain sql query instead of execution statement

    - by Wei Ma
    Using SQL profiler, I was able to find the query generated from Nhibernate was executed in the EXEC sp_executesql N'select ...' fashion. I am wondering if there is any way to force Nhibernate to generate the plain Select ... statement instead. The reason I want this is because apparently SQL Server generated different execution plans for them, and in my scenario, the plain "select ..." runs MUCH faster.

    Read the article

  • Refactoring nested foreach statement

    - by dotnetdev
    Hi, I have a method with a nested foreach collection (iterate a set of objects and then look inside each object). I saw in a book a good pattern to make this much more elegant but cannot remember/find the code example. How else could I make this more tidy? The code is just a typical nested foreach statement so I have not provided a code sample. Thanks

    Read the article

  • meaning of import statement in java file

    - by Rozer
    Can any one clear me exactly what happend when we do import statement in java files. does it inscrease the size of file if we add more and more java classes. why we dont use classloader for the same and what are the restrictin for importing.

    Read the article

  • Python style: if statements vs. boolean evaluation

    - by mkscrg
    One of the ideas of Python's design philosophy is "There should be one ... obvious way to do it." (PEP 20), but that can't always be true. I'm specifically referring to (simple) if statements versus boolean evaluation. Consider the following: if words: self.words = words else: self.words = {} versus self.words = words or {} With such a simple situation, which is preferable, stylistically speaking? With more complicated situations one would choose the if statement for readability, right?

    Read the article

  • yield returns within lock statement

    - by DayOne
    Hi eveybody, if i have a yield return in a lock statement does the lock get taken out on each yield (5 times in the example below) or only once for all the items in the list? Thanks private List<string> _data = new List<string>(){"1","2","3","4","5"}; private object _locker =new object(); public IEnumerable<string> GetData() { lock (_locker) { foreach (string s in _data) { yield return s; } } }

    Read the article

  • what is the required code method of making a sticker app?

    - by zeropt7
    I am new to photo apps, recently I am interested in making a sticker app like those can be seen in the appstore, I know I would need to use uiimagepickercontroller, uiscrollview and uigesturerecognizer. However I wonder which code method should I use for the app to load multiple stickers? Should it be called programmatically? Is that I would need to use the if-statement, say if one sticker is loaded, the app will auto generate a new sticker on top of it?

    Read the article

  • Translate LINQ to sql statement

    - by zielu1
    Hi, I want to translate LINQ expression tree to SQL statement and I don't want to write my own code for this. Example: var query = from c in Customers where c.Country == "UK" && c.City == "London" select c); To SELECT ... FROM Customers AS c WHERE c.Country = "UK" AND c.City = "London" I know DataContext.Log, but I want to use: query.ToSqlStatementString() Thanks

    Read the article

  • What's the error in my MySQL statement?

    - by Jim
    The following SQL statement has a syntax error according to phpMyAdmin, but I can't spot what it is. Any ideas? CREATE TABLE allocations( `student_uid` INT unsigned NOT NULL DEFAULT 0, `active` INT unsigned NOT NULL DEFAULT 1, `name` VARCHAR( 255 ) NOT NULL DEFAULT '', `internal_id` VARCHAR( 255 ) DEFAULT '', `tutor_uid` INT NOT NULL DEFAULT 0, `allocater_uid` INT unsigned NOT NULL DEFAULT 0, `time_created` INT NOT NULL DEFAULT 0, `remote_time` FLOAT NOT NULL DEFAULT 0, `next_lesson` VARCHAR NOT NULL DEFAULT -1, PRIMARY KEY ( student_uid ) );

    Read the article

  • SQL - Stored Procedure with Select Statement using IN (@Variable_CommaDelimitedListOfIDS)

    - by GigaPr
    Hi I am creating a stored procedure to which i want to pass as variable a comma delimited list of Ids I want to use the Ids into a select statement something like Create Procedure up_TEST @Ids VARCHAR(MAX) AS SELECT * FROM ATable a WHERE a.Id IN(@Ids) Obviously i get the error that @Ids is a varchar and not an INT but how can i convert the comma delimited list I am using SQL Server 2008 Thanks

    Read the article

  • Can IF be used to start a MySQL query?

    - by Littledot
    Hi there, I have a query that looks like this: mysql_query("IF EXISTS(SELECT * FROM predict WHERE uid=$i AND bid=$j) THEN UPDATE predict SET predict_tfidf=$predict_tfidf WHERE uid=$i AND bid=$j ELSE INSERT INTO predict (uid, bid, predict_tfidf) VALUES('$i','$j','$predict_tfidf') END IF")or die(mysql_error()); But it dies and mysql tells me to check the syntax near IF EXISTS(....) Can we not use an IF statement to start a mysql query? Thank you in advance.

    Read the article

  • Detect months with 31 days

    - by daddycardona
    Is there an analogous form of the following code: if(month == 4,6,9,11) { do something; } Or must it be: if(month == 4 || month == 6 etc...) { do something; } I am trying to write an if statement that checks if this month has more than 31 days.

    Read the article

  • How to skip a statement in Eclipse during debugging

    - by frankfwl
    Is it possible to skip a statement in Eclipse while debugging? Suppose the process stopped at breakpoint and I want to skip the breakpoint line ( or maybe a few lines below), can I do it? On the debug tab, it only has "Step into", "Step over" and "Step return" buttons. I did google around but couldn't find anything, hopefully I can find an answer here.

    Read the article

< Previous Page | 17 18 19 20 21 22 23 24 25 26 27 28  | Next Page >