Search Results

Search found 21097 results on 844 pages for 'check snmp'.

Page 83/844 | < Previous Page | 79 80 81 82 83 84 85 86 87 88 89 90  | Next Page >

  • How do I check if a SQL Server 2005 TEXT column is not null or empty using LINQ To Entities?

    - by emzero
    Hi there guys I'm new to LINQ and I'm trying to check whether a TEXT column is null or empty (as String.IsNullOrEmpty). from c in ... ... select new { c.Id, HasBio = !String.IsNullOrEmpty(c.bio) } Trying to use the above query produces an SqlException: Argument data type text is invalid for argument 1 of len function. The SQL generated is similar to the following: CASE WHEN ( NOT (([Extent2].[bio] IS NULL) OR (( CAST(LEN([Extent2].[bio]) AS int)) = 0))) THEN cast(1 as bit) WHEN (([Extent2].[bio] IS NULL) OR (( CAST(LEN([Extent2].[bio]) AS int)) = 0)) THEN cast(0 as bit) END AS [C1] LEN is not applicable to TEXT columns. I know DATALENGTH should be used for them... How can I force LINQ to produce such thing? Or any other workaround to test if a text column is null or empty??? Thanks!

    Read the article

  • How to loop through the FormCollection to check if textboxes have values?

    - by Sasha
    Hi there. I have a search page that has 6 textboxes which i pass as FormCollection to the action in the controller. I dont want to search for records if ther is no values in textboxes. Is there a way to loop through all textboxes in FormCollection without to check which ones have values in them? I am a student in the college and this project is part of my summer experience program. I realize that this is a newbie question :) Thank you!

    Read the article

  • Can I un-check a group of RadioBottoms inside a group box?

    - by Claire Huang
    radio bottoms inside a group Box will be treated as a group of bottoms. They are mutual exclusive. How can I clean up their check states?? I have several radio bottoms, one of them are checked. How can I "clean" (uncheck) all radio bottoms?? "setChecked" doesn't work within a group, I tried to do following things but failed. My code is as following, radioButtom is inside a groupBox, and I want to unchecked it. The first setChecked does works, but the second one doesn't, the radioBottom doesn't been unchecked MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { QRadioButton *radioButton; ui->setupUi(this); radioButton->setChecked(true); radioButton->setChecked(false); } Where is the problem in my code?

    Read the article

  • How can I check if a particular jQuery UI function is available and use a different function if it i

    - by Mark B
    I'm writing a jQuery plugin and I would like my code to take advantage of the jQuery UI show(effect, [options], [speed], [callback]) and hide(effect, [options], [speed], [callback]) functions, which allow you to show and hide elements with a nice animation. However, I'd also like my plugin to degrade gracefully if jQuery UI isn't available, switching back to use the basic, non-animating show() and hide() functions present in the standard jQuery API. I'll need to test for the show and hide functions specifically, as even if jQuery UI is available it could potentially be a custom version, without the Effects components included. At first I thought that I might be able to do something like: if(typeof myelement.show('blind', 'slow') == 'undefined') { myelement.show('blind', 'slow'); } else { myelement.show(); } But of course this doesn't work, as even if UI isn't present, show() is still a function, it just has a different signature—so typeof returns object in either case. So, what's the best way for me to check if jQuery UI is available to my plugin? Any help is much appreciated!

    Read the article

  • How to check whether the form has any ShowDialog() forms open?

    - by kornelijepetak
    I have a form MainForm with several properties/methods that are accessed from another thread. At some point I might open a form AuxForm with ShowDialog() and then while that modal form is open, the other thread still modifies the MainForm's properties. This is all desired. In one of the methods accessed from another thread I need to execute some code, but only if the modal AuxForm is not open. Is there any way to check this (by using .NET WF Form properties) or I need to use a flag variable? NOTE: None of these properties/methods modify the controls (so no Invoke is required).

    Read the article

  • How Do I Programmatically Check if a WordPress Plugin Is Already Activated?

    - by Volomike
    I know I can use activate_plugin() from inside a given, active plugin in WordPress, to activate another plugin. But what I want to know is how do I programmatically check if that plugin is already active? For instance, this snippet of code can be temporarily added to an existing plugin's initial file to activate a partner plugin: add_action('wp','activatePlugins'); function activatePlugins() { if( is_single() || is_page() || is_home() || is_archive() || is_category() || is_tag()) { @ activate_plugin('../mypartnerplugin/thepluginsmainfile.php'); } } Then, use a Linux command line tool to spider all your sites that have this code, and it will force a page view. That page view will cause the above code to fire and activate that other plugin. That's how to programmatically activate another plugin from a given plugin as far as I can tell. But the problem is that it gets activated over and over and over again. What would be great is if I had an if/then condition and some function I could call in WordPress to see if that plugin is already activated, and only activate it once if not active.

    Read the article

  • How to check if a form is submited via javascript?

    - by SteD
    I have this conventional submit button which submit a form like this: <form method="post" id="form_submit"> ... <input class="button" type="submit" name="Submit" value="Submit"> </form> And I check if the submit button is clicked using this: if(isset($_POST['Submit'])){ //update DB } Now I have a submit link using jquery: <a href="#" onclick="publish(); return false;">Submit</a> JS code: $("#form_submit").submit(); What is the alternative way here to be used here for if(isset($_POST['Submit'])) since I'm submitting the form using javascript?

    Read the article

  • ADO.NET: Faster way to check if the database server is accessible?

    - by lotana
    At the moment I am using this code to check if the database is accessible: public bool IsDatabaseOnline(string con) { bool isConnected = false; SQLConnection connect = null; try { connect = new SQLConnection(con); connect.Open(); isConnected = true; } catch (Exception e) { isConnected = false; } finally { if (connect != null) connect.Close(); } return isConnected; } While this code works fine, there is a disadvantage. If the server is not online it spends about 4 full seconds trying to open the connection before deciding that it is not available. Is there a way to test the connection without trying to actually opening it and waiting for the timeout? Something like a database-equivalent of ping?

    Read the article

  • In ActionScript, Is there a way to check if an input argument is a valid Vector of any type?

    - by ty
    In the following code: var a:Vector.<int> ... var b:Vector.<String> ... var c:Vector.<uint> ... var c:Vector.<MyOwnClass> ... function verifyArrayLike(arr:*):Boolean { return (arr is Array || arr is Vector) } verifyArrayLike(a); verifyArrayLike(b); ... What I'm looking for is something like _var is Vector.<*> But Vector.<*> is not a valid expression, even Vector. can not be placed at the right side of operators. Is there a way to check if an input argument is a valid Vector of any type?

    Read the article

  • How can I write a "user can only access own profile page" type of security check in Play Framework?

    - by karianneberg
    I have a Play framework application that has a model like this: A Company has one and only one User associated with it. I have URLs like http://www.example.com/companies/1234, http://www.example.com/companies/1234/departments, http://www.example.com/companies/1234/departments/employees and so on. The numbers are the company id's, not the user id's. I want that normal users (not admins) should only be able to access their own profile pages, not other people's profile pages. So a user associated with the company with id 1234 should not be able to access the URL http://www.example.com/companies/6789 I tried to accomplish this by overriding Secure.check() and comparing the request parameter "id" to the ID of the company associated with the logged in user. However, this obviously fails if the parameter is called anything else than "id". Does anyone know how this could be accomplished?

    Read the article

  • how to write extension method to check string value is null or not.

    - by kumar
    Hi all, (LocalVariable)ABC.string(Name)= (Idatareader)datareader.GetString(0); this name value is coming from database.. what happening here is if this name value is null while reading it's throwing an exception? I am manually doing some if condition here. I don't want to write a manual condition to check all my variables.. I am doing something like this now.. string abc = (Idatareader)datareader.GetValue(0); if(abc = null) //assiging null else assiging abc value is there something like can we write extension method for this? thanks

    Read the article

  • Get the selected value from a Select box and check that value against an array in the same form

    - by Rob Allen
    I'm new to JSTL/EL and JSP and can't seem to find a reference which covers the following scenario: I have an array of values in JavaScipt: var Countries = ('US', 'CA'); I then need to check to see if the currently selected value of a standard HTML select box is in that array. This is what I have so far: <select id="shippingCountry"> <option value="AT">Austria</option> <option value="CA">Canada</option> <option value="DE">Germany</option> //... <option value="US">United States</option> </select> <c:choose> <c:when test=" "> // I don't know what to put in the 'test' case <span class="required">*</span> </c:when> </c:choose>

    Read the article

  • How can I check a type's dependents order to drop them and replace/modify the initial type?

    - by pctroll
    I tried to modify a type using the following code and it gave me the error code: 'ORA-02303'. I don't know much about Oracle or PL/SQL but I need to solve this; so I'd appreciate any further help with this. Thanks in advance. The code is just an example. But then again, I need to check its dependents first. create or replace type A as object ( x_ number, y_ varchar2(10), member procedure to_upper ); /

    Read the article

  • How can I check that I didn't break anything when refactoring?

    - by Nathan Fellman
    I'm about to embark on a bout of refactoring of some functions in my code. I have a nice amount of unit tests that will ensure I didn't break anything, but I'm not sure about the coverage they give me. Are there any tools that can analyze the code and see that the functionality remains the same? I plan to refactor some rather isolated code, so I don't need to check the entire program, just the areas that I'm working on. For context, the code I'm working on is in C/C++, and I work in Linux with GCC and VIM.

    Read the article

  • In an Android test, how to check that a View is shown?

    - by Jan Zankowski
    Hello, I'm writing a UI test case (using ActivityUnitTestCase) and would like to check if at a given time a View subclass is visible to the user. I've found the View#isShown() method, which claims to do exactly this - checking the visibility field of this element and all its parents - but somehow it always returns "false" for all the elements. I'll be grateful for some help. If it makes it easier, I can paste some code. Also, I found ViewAsserts#assertOnScreen(View origin, View view) but it doesn't seem to do the right thing either - always returns true. Am I perhaps calling it wrong: assertOnScreen(viewImTesting.getRootView(), viewImTesting)? Thanks, Jan

    Read the article

  • How to check if a DateTime range is within another 3 month DateTime range .NET 3.5 C#

    - by Jamie
    Hi I have a Start Date and End Date per record in a db. I need to check to see where the time period falls in a 2 year period broken into two lots of quarters then display what quarters each record falls into. Quarter 1 includes June 09, Jul 09, Aug 09 Quarter 2 includes Sept 09, Oct 09, Nov 09 Quarter 3 includes Dec 09, Jan 10, Feb 10 Quarter 4 includes Mar 10, Apr 10, May 10 Quaretr 5 includes Jun 10, Jul 10... e.g. 01/10/09 - 01/06/10 would fall into quarters 2, 3, 4 & 5 I am very new to .NET so any examples would be much appreciated.

    Read the article

  • How can I check if an order with a given increment id already exists in magento?

    - by Thomas Vander Stichele
    I am new to Magento. What's the proper way to check if an order with a given increment id already exists ? The obvious way: $order = Mage::getModel('sales/order')->loadByIncrementId($reservedOrderId); if ($order) { Mage::log('already have order with id ' . $reservedOrderId); return $order; } does not work, because I get a new and empty model instance back. What's the correct way in magento to see if I have no such model for that id ?

    Read the article

  • how do i check if multiple folders exist if so delete them on button click?

    - by NightsEVil
    hi i have a few folders created by my application and id like that when they click a button named "clean up" that it would check to see if any of the predetermined folders exist, if they do then delete them, this is what i have tried so far whats wrong with it? string tempFolder = Environment.GerFolderPath(Environment.SpecialFolder.ApplicationData); if (Directory.Exists(tempFolder + "//" + "temp1")) if (Directory.Exists(tempFolder + "//" + "temp2")) if (Directory.Exists(tempFolder + "//" + "temp3")) if (Directory.Exists(tempFolder + "//" + "temp4")) { System.IO.Directory.Delete(tempFolder + "\\" + "temp1", true); System.IO.Directory.Delete(tempFolder + "\\" + "temp2", true); System.IO.Directory.Delete(tempFolder + "\\" + "temp3", true); System.IO.Directory.Delete(tempFolder + "\\" + "temp4", true); } else { MessageBox.Show("No Cleanup Needed"); } so whats wrong? i tested it and it seemed to with 2 folder but not 4 or more

    Read the article

  • Can Google App Engine be used for "check for updated" and download binary file web service?

    - by Tofrizer
    Hi, I'm a Google App Engine newbie and would be grateful for any help. I have an iPhone app which sources data from an sqlite db stored localling on the device. I'd like to set up a Google App Engine web service which my iPhone client will talk to and check if there is a newer version of the sqlite database it needs to download. So iPhone client hits the web service with some kind of version number/timestamp and if there is a newer file, the App Engine will notify the client and the client will then request the new database to download which the App Engine will serve. Is it possible to set up a web service in Google App Engine to do this? Could anyone point me to any sample code / tutorials please? Many Thanks

    Read the article

  • When calling CRUD check if "parent" exists with read or join?

    - by Trick
    All my entities can not be deleted - only deactivated, so they don't appear in any read methods (SELECT ... WHERE active=TRUE). Now I have some 1:M tables on this entities on which all CRUD operations can be executed. What is more efficient or has better performance? My first solution: To add to all CRUD operations: UPDATE ... JOIN entity e ... WHERE e.active=TRUE My second solution: Before all CRUD operations check if entity is active: if (getEntity(someId) != null) { //do some CRUD } In getEntity there's just SELECT * FROM entity WHERE id=? AND active=TRUE. Or any other solution, recommendation,...?

    Read the article

  • .classpath and .project - check into version control or not?

    - by amarillion
    I'm running an open source java project that consists of multiple modules in a tree of dependencies. All those modules are subdirectories in a subversion repository. For newcomers to our project, it's a lot of work to set all that up manually in eclipse. Not all our developers use eclipse. Nevertheless, we're considering to just check in the .classpath and .project files to help newcomers to get started. Is this a good idea? Or would that lead to constant conflicts in those files? Is there an alternative way to make the project easy to set up on eclipse?

    Read the article

  • How to resolve error "Run-Time Check Failure #3"?

    - by karikari
    I am working on MS Visual Studio. I keep on getting this error: "Run-Time Check Failure #3 - The variable 'test' is being used without being initialized." I don't have any idea how to solve this. Here is the code that I'm currently tries to modify: STDMETHODIMP CButtonDemoBHO::Exec(const GUID*, DWORD nCmdID, DWORD d, VARIANTARG*, VARIANTARG* pvaOut) { CRebarHandler *test; switch (nCmdID){ case BUTTON_PRESSED: MessageBox(m_hWnd, L"You have pressed the button", L"Button Pressed", MB_OK); test->findButton(m_hWnd); test->setmenu(); break; case MENU_ITEM_SELECT: MessageBox(m_hWnd, L"You have simulated a button press with the menu ", L"Menu Pressed", MB_OK); break; } return S_OK; }

    Read the article

  • C++: Why don't I need to check if references are invalid/null?

    - by jbu
    Hi all, Reading http://www.cprogramming.com/tutorial/references.html, it says: In general, references should always be valid because you must always initialize a reference. This means that barring some bizarre circumstances (see below), you can be certain that using a reference is just like using a plain old non-reference variable. You don't need to check to make sure that a reference isn't pointing to NULL, and you won't get bitten by an uninitialized reference that you forgot to allocate memory for. My question is how do I know that the object's memory hasn't been freed/deleted AFTER you've initialized the reference. What it comes down to is that I can't take this advice on faith and I need a better explanation. Can anyone shed some light? Thanks, jbu

    Read the article

  • Making bash script to check connectivity and change connection if necessary. Help me improve it?

    - by cypherpunks
    My connection is flaky, however I have a backup one. I made some bash script to check for connectivity and change connection if the present one is dead. Please help me improve them. The scripts almost works, except for not waiting long enough to receive an IP (it cycles to next step in the until loop too quick). Here goes: #!/bin/bash # Invoke this script with paths to your connection specific scripts, for example # ./gotnet.sh ./connection.sh ./connection2.sh until [ -z "$1" ] # Try different connections until we are online... do if eval "ping -c 1 google.com" then echo "we are online!" && break else $1 # Runs (next) connection-script. echo fi shift done echo # Extra line feed. exit 0 And here is an example of the slave scripts: #!/bin/bash ifconfig wlan0 down ifconfig wlan0 up iwconfig wlan0 key 1234567890 iwconfig wlan0 essid example sleep 1 dhclient -1 -nw wlan0 sleep 3 exit 0

    Read the article

< Previous Page | 79 80 81 82 83 84 85 86 87 88 89 90  | Next Page >