HOW TO CHECK THE CHECKBOX VALUE WITH SQLCE DATABASE

Hai All,
   Good Day! I am using VB in Visual Studio 2008. I have a form with check boxes and one button control. If i selected the check box and then click the button, check the database table field and check box text are equal. if both are equal then
how to check?
 I have tried it. The code is:
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim conn As New SqlCeConnection
Dim cmd As New SqlCeCommand
conn.ConnectionString = "DataSource = E:\Vbprojectex\WindowsApplication3\WindowsApplication3\Database1.sdf"
Try
cmd.Connection = conn
conn.Open()
If CheckBox1.CheckState = 1 Then
cmd.CommandText = "SELECT Aerator FROM ttabpagelist where Aerator = CheckBox1.Text"
TextBox1.Text = 1
End If
cmd.ExecuteNonQuery()
Finally
conn.Close()
End Try
End Sub
End Class
Thanks & Regards Sasi ................. Go Green

probably something like (ofc below will never give result since Aerator can't have 2 values, you will have to adjust the second check box column obviously)
Try
cmd.Connection = conn
conn.Open()
dim strsql as string = "= "SELECT Aerator FROM ttabpagelist "
Dim whereConcatenator As String = " WHERE "
Dim Wherestatement As String = String.Empty
If checkbox1.checked = True Then
Wherestatement += whereConcatenator
Wherestatement += "Aerator = " & checkbox1.Text
whereConcatenator = " AND "
End If
If checkbox2.checked = True Then
Wherestatement += whereConcatenator
Wherestatement += "Aerator = " & checkbox2.Text
End If
cmd.commandtext = strsql & wherestatement
TextBox1.Text = 1
End If
cmd.ExecuteNonQuery()
Finally
conn.Close()
End Try

Similar Messages

  • How to check the integer value with Date Column

    Hi Friends,
    I have a filter called 'Days'. I need to show the data based on the Days filter (Example : 2 Days).
    Example Query:
    Select * from Tb1
    Where EndDate(Value as '03/05/2013' > Days ( value as 2)
    How to handle the above scenario.
    Thanks in Advance....
    Regards,
    LuckyAbdul

    what meanings does it make. how can you compare a date to day count. Or is the inetger value an offset ie say 2 days from today etc?
    If yes you can use like below illlustration
    DECLARE @DayOffset int
    SET @DayOffset = 2
    SELECT *
    FROM TAble
    WHERE ENdDate >= DATEADD(dd,DATEDIFF(dd,0,GETDATE()),@DayOffset+1)
    refer
    http://visakhm.blogspot.in/2010/01/some-quick-tips-for-date-formating.html
    Please clarify with an example what you're expecting if its different from the above.
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • How to get the checkbox value

    Hi,
    i am working in Oracle APEX. Can anyone tell me how to get the checkbox value Thru Pl/sql Procedure.
    Ex:
    if i have three users like 1) super admin 2) HR 3) user i am giving different grants to all. there s a check box i used if HR selected three grants i have to get the checked value from my procedure and put into a table in a single column.
    grants :
    1)user creation
    2)salary details
    3)Attendance details
    4)Allowance
    5)contacts
    if its checked i am returning 1 not checked i hav to return 0
    in my table i ahv to store 10111 like that......
    Edited by: user12356342 on Dec 16, 2009 3:33 AM

    Hi,
    As a starting point, look at: [http://download-uk.oracle.com/docs/cd/B31036_01/doc/appdev.22/b28839/check_box.htm#CHDCGIFA] as this explains how to use checkboxes on forms and reports
    Andy

  • How to Check the total value of a field

    Hi,
    I want to check the total value of a field (this total is obtain by using property of that field thru personalization).
    that means , in a table 3 columns are there (col 1, col2 & col3). I personalized the total property as true for col3.
    now i'm getting the total for that field.
    I want to check that total whether it crossed 100 or not.
    How to do this?
    Thanks in advance,
    SAN

    Hi San,
    You can achieve by using OATotalRowBean, search for OATotalRowBean in this forum you should be able to get some sample code.
    public class OATotalRowBean
    extends TotalRowBean
    implements OAWebBean, OAWebBeanConstants
    A special row rendered at the bottom of a table which lets users see totals for columns which are designated for summing.
    Note The total is calculated and displayed only for visible rows.
    When you indicate that you want to total one or more columns, the OA Framework creates an OATotalRowBean and designates it as the columnFooter named child of the OATableBean. If the OATableBean is also configured to insert rows (so it has an "Add Another Row" button), then the total bean becomes an indexed child of the add table row bean (see OAAddTableRowBean), which the OA Framework in turn designates as the table's columnFooter object.
    If you need to access the table's column footer object for any reason, call the OATableBean's getColumnFooter() method. If row insertions are enabled, this method returns an OAAddTableRowBean; otherwise it returns an OATableRowBean.
    For detailed information about creating and working with tables, see OA Framework Developer Guide: Tables.
    With regards,
    Kali.
    OSSi.

  • How to compare the date value with the date datatype column?

    Hi,
    I am executed a query to get output for the particular date in two different database.
    I got output in one db environment, but in the another environment i didnt get the output.
    APP_DECISION_DATE column contains date datatype
    ex:
    SQL> select DECISIONED_STAGE_ID,DECISIONED_STAGE_USER_ID from naap10_application where APP_DECISION_DATE = TO_DATE('23-JAN-07',
    'DD-MON-YY'); 2
    DECISIONED_STAGE_ID DECISIONED_STAG
    2006060106 SYSTEM
    DATABASE - II
    SQL> select DECISIONED_STAGE_ID,DECISIONED_STAGE_USER_ID from naap10_application where APP_DECISION_DATE=
    TO_DATE('31-JAN-2007','DD-MON-RRRR') and application_id=2007010028552;
    no rows selected
    in the same db i got the output while i used the TO_DATE(APP_DECISION_DATE)
    SQL> select DECISIONED_STAGE_ID,DECISIONED_STAGE_USER_ID from naap10_application where TO_DATE(APP_DECISION_DATE)=
    TO_DATE('31-JAN-2007','DD-MON-YYYY') and application_id=2007010028552; 2
    DECISIONED_STAGE_ID DECISIONED_STAG
    2006060113 SYSTEM
    is it necessary to use TO_DATE function while i am using the data datatype column in the WHERE CLAUSE?
    Thanks in advance.
    siva

    Sorry & thanks sathish,
    Now i got the result.
    SQL> select DECISIONED_STAGE_ID,DECISIONED_STAGE_USER_ID from naap10_application where APP_DECISION_DATE BETWEEN TO_DATE ('31.01.2007 00:00:00', 'DD.MM.YYYY HH24:MI:SS') AND TO_DATE ('31.01.2007 23:59:59', 'DD.MM.YYYY HH24:MI:SS')
    2 and application_id=2007010028552;
    DECISIONED_STAGE_ID DECISIONED_STAG
    2006060113 SYSTEM
    ================================
    But one doubt,
    When i created the column with the date datatype how it gets the time value,
    And in one environment db i got the result but in another environment i dont get,
    Shall i want to change any session status of date?

  • How to check the numerica value

    Dear Experts,
    Would you please show me the code how to check a character value is numeric or not, include negative sign '-'.
    For example the character value (01.-10) should not be a good numeric value use in later.  the (-1.00) should be a good numeric value.
    Thanks,
    Helen

    Hello,
    Use the FM <b>NUMERIC_CHECK</b>
    Regards,
    Vasanth

  • How to check the checkbox of Adobe Installer with the Aplescript??

    Hi All,
    am trying to Install Adobe Flash Player thru stand alone Installer, I want to check the check box and need to click on Install button,
    Whem am trying to get the entire contents of window thru UIElementInspector, am unable to get the contents of checkbox and Install buttons..
    I just tried myself with the below script to click the checkbox, but did not succeed, error saying unable to get the checkbox.. Pls suggest how to check..
    tell application "System Events"
        tell process "Adobe Flash Player Install Manager"
            set frontmost to true
            click the checkbox "I have read and agree to the terms of the Flash Player License Agreement" of window "Adobe Flash Player 11.5 Installer."
        end tell
    end tell
    Pls check the below link to view the image of the Adobe Flash Player Installer.
    https://docs.google.com/document/d/1yzyBTrvi94QxjlEAlcbudOBpXiTGPEI2LA3D1iEo8Gw/ edit

    I'm working on a similar script, but when I execute the script, I run into this error:
    error "System Events got an error: Can’t make {563, 234} into type list." number -1700 from {563, 234} to list
    Any ideas? Here's the background: I'm trying to click the search box on this page: http://www.alexa.com/siteinfo/payeasenet.com
    Here's my UI Inspector results of said element:
    <AXGroup>
         <AXScrollArea: “”>
          <AXWebArea: “”>
           <AXGroup: “”>
            <AXGroup: “”>
             <AXTextField: “Enter a search query”>
    Attributes:
       AXRole:  “AXTextField”
       AXSubrole:  “AXSearchField”
       AXRoleDescription:  “search text field”
       AXChildren:  “<array of size 0>”
       AXHelp:  “”
       AXParent:  “<AXGroup: “”>”
       AXPosition:  “x=550 y=212”
       AXSize:  “w=214 h=30”
       AXTitle:  “Enter a search query”
       AXDescription:  “”
       AXValue (W):  “”
       AXFocused (W):  “1”
       AXEnabled:  “1”
       AXWindow:  “<AXWindow: “Payeasenet.com Site Info”>”
       AXSelectedTextMarkerRange (W):  “(null)”
       AXStartTextMarker:  “<AXTextMarker 0x60800024af80 [0x7fff758b4eb0]>{length = 24, bytes = 0xbd040000000000006024c514010000000000000001000000}”
       AXEndTextMarker:  “<AXTextMarker 0x600000248a30 [0x7fff758b4eb0]>{length = 24, bytes = 0xbf0400000000000040420c17010000000100000001000000}”
       AXVisited:  “0”
       AXLinkedUIElements:  “(null)”
       AXSelected:  “0”
       AXBlockQuoteLevel:  “0”
       AXTopLevelUIElement:  “<AXWindow: “Payeasenet.com Site Info”>”
       AXNumberOfCharacters:  “0”
       AXSelectedText (W):  “”
       AXSelectedTextRange (W):  “pos=0 len=0”
       AXVisibleCharacterRange (W):  “pos=0 len=0”
       AXInsertionPointLineNumber:  “0”
       AXTitleUIElement:  “(null)”
       AXAccessKey:  “(null)”
       AXRequired:  “0”
       AXInvalid:  “false”
       AXPlaceholderValue:  “”
       AXARIABusy:  “0”
    Actions:
       AXPress - press
       AXShowMenu - show menu
       AXScrollToVisible - AXScrollToVisible

  • How to check the checkboxes that are dynamically displayed in the browser

    Hi
    Here the requirement is ,I am dynamically diaplaying the text boxes based on the data captured from the database.Here depending upon the number characters in Database,related that much of checkboxes will display.How can i provide Javascript client event handling in this without knowing the checkbox ID'.
    Needs urgent reply,
    Regards
    Usman

    code to check all check boxes in a page.
    <body>
    <SCRIPT language=JavaScript>
    function doCheckAll()
      with (document.dam) {
        for (var i=0; i < elements.length; i++) {
            if (elements<i>.type == 'checkbox' )
               elements<i>.checked = true;
    </SCRIPT>
    <FORM  name=dam>
    <INPUT  type=checkbox value=1>
    <INPUT  type=checkbox value=2>
    <INPUT  type=checkbox value=3> <br>
    <INPUT  type=checkbox value=4>
    <INPUT  type=checkbox value=5>
    <INPUT  type=checkbox value=6> <br>
    <INPUT  type=checkbox value=7>
    <INPUT  type=checkbox value=8>
    <INPUT  type=checkbox value=9> <br>
    <INPUT onclick=doCheckAll() type=button value="Check all">
    <INPUT type=reset value="Reset">
    </FORM >
    </body>
    How you are generating check boxes? if you are generating checkboxes then you would also be generating ids for them. why cant you use them?
    Regards
    Raja

  • How to check the whole values of a set of map exist in the vector of map?

    Hi Friends!
    I have a set of map; map<int, set<int>>myset;
    and a vector of map; map<int,vector<int>>myvec;
    myset contains;
    1=>11  16  30
    3=>2  11
    6=>2
    7=>9  12  16
    8=>9  13  16
    myvec contains;
    1=>11  15  21
    2=>16
    3=>11  16
    4=>2  13
    5=>11  16  30
    6=>9  5  10
    First, the first value of myset(11  16  30) will be checked with all the values of myvec, if the whole value(11  16  30) available at certain value in the myset, then it gives the key of myvec. So, the output for the first value is 5.
    Next, if you consider the value (2  11) in the myset, there are no matching values that contains whole 2  11 in the particular value in myvec. Therefore, what we do is, delete the last value of the current set, that is 11, and now consider 2 as
    the value and find the matching value from myvec. That is (2  13) and the key is 4.
    Like wise when we find the first possible match, then we print the key of myset immediately, there may be some other possible values available in the values of myset.
    I have written two functions that check the particular whole values of the myset matched with a particular values in myvec.
    bool IsValueInVec(int value, const IntVec& v2)
    IntVec::const_iterator itv=find (v2.begin(), v2.end(), value);
    if (itv!=v2.end())
    return true;
    return false;
    bool AreAllValuesInVec(const IntSet& s1, const IntVec& v2)
    for(set<int>::const_iterator sit=s1.begin();sit!=s1.end();++sit)
    if (!IsValueInVec((*sit), v2))
    return false;
    return true;
    Could anyone help me to solve this?

    You have neither a set of map nor a vector of map.  You have two maps.  Each contains keys of type int.  The mapped values of one are of type set<int>.  The mapped values of the other are of type vector<int>.  If
    you don't understand the types of the objects you are using, you will never be able to use them properly.
    Help you solve what?  Do the two functions you wrote perform as desired?  If not, provide a complete description of how what they do differs from what you want.
    Somewhere in code you have not shown, you need to call AreAllValuesInVec for a particular set and vector.  If this function returns false and if the set contains more than one element, you need to delete the last element of the set and try again. 
    If the set contains only a single element, you need to perform some "failure" processing that you have not described.  When the function returns true, you need to print the key of the map element which contains the vector.  What are you
    having trouble with?

  • How to store the checkbox value in the database?

    i want to store the value of the checkbox iwhich i tick in the database. how do i do it?
    Plz help.

    hi try this
    <input type="checkbox" name="check" value="1">
    <input type="checkbox" name="check" value="2">
    <input type="checkbox" name="check" value="3">
    at the back end form(jsp/servlet)
    String check[]=request.getParametersValues("check");
    u should iterate that array,then insert into table ........
    only selected check box values will be taken.....

  • How to check the current time with a Stored  time in string format

    Hi All
    I would like to compare the system time with an existing time values which is allready there in String format..
    i mean i would like to check if the SysTime is inbetween 6:30 and 14:00
    I accomplished this in Oracle ..
    Select 'Y' from dual where to_date(to_char(sysdate,'HH24:MI '),'HH24:MI') between to_date('06:30','HH24:MI') and to_date('14:00','HH24:MI')
    But instead of checking the DB each and every time , the perfomance would be better if we can do this in our java code..
    Could some one provide me with a code to accomplish the above scenario..
    Thanks in advance..,.,

    import java.util.Calendar;
    Calendar rightNow = Calendar.getInstance();  // gets the current date and time to millisec
    Calendar earlyTime = Calendar.getInstance().set(Calendar.HOUR_OF_DAY, 6).set(Calendar.MINUTE, 30);
    Calendar lateTime = Calendar.getInstance().set(Calendar.HOUR_OF_DAY, 8).set(Calendar.MINUTE, 0);
    if (rightNow.compareTo(earlyTime)> 0 && rightNow.compareTo(lateTime) < 0){
    // do something
    }Try this.

  • How to check the source value is in between a string range in mapping

    Hi Consultants,
    I am working on IDOC to File scenario. I need to implement a specific requirement of our client. i.e. something like below;
    Vendor number can be any thing like 1AA000000 / 1AA000001/1AB000000/... ect till 1ZZ999999.
    if the vendor number is in between 1AA000000 -1ZZ999999 then the target value should assign as 'Internal' else should assing as 'External'.
    How to compare  that the value of vendor is in between IAA000000 to 1ZZ999999 in mapping?
    Appreciate your help.
    Thanks in advance.
    Regards,
    Nausheen

    You can try creating an UDF and using the varName.substring(); method. Then you can compare in separated pieces the string. For example
    String var = "1AA000000";
    if (var.substring(3).compareTo("000000") < 0 && var.substring(3).compareTo("999999") > 0)
      //compare now the "AA" and "ZZ" with the same logic;
    http://download.oracle.com/javase/1.4.2/docs/api/java/lang/String.html#substring(int, int)
    http://download.oracle.com/javase/1.4.2/docs/api/java/lang/String.html#compareTo(java.lang.Object)
    EDIT: Moreover, those functions are available in the Mapping program creation, but this should give a clue on the order it should be done.
    Edited by: Lucas Santos on Mar 29, 2011 7:38 PM
    Edited by: Lucas Santos on Mar 29, 2011 7:53 PM

  • How to check the maximum Value and Last value in Reports CP column

    Hi all
    First of all i am sory that iam posting this question in forms instead of Reports....i had posted it in reports but no one reply and i need uirgent solution so I post here....
    My problem is that in Report I have calculated some values in CP column......Like
    :CP_Total := :Frieght * Rate ...etc
    Know i want to ask that how can I get the last value that will be return the by this column????and also the maximum value that it will return
    Thanks in advance
    Shayan
    [email protected]

    You mast build Summary column out of the query and select maximum to your maximum value of CP in Report level (or last for last value).

  • How to set the default value of a database column to NULL

    Hello,
    I want to set the default value of a column (VARCHAR2(20) to NULL, nut I cannot figure out to do this. I tried the following editing the offline table with JDeveloper:
    Default Value : <empty> -> On database NULL
    Default Value: '' -> On database ''
    When I create a new column, there is no default value on the database side and when I open the tabe properties in the database navigator I can see that the default value is (null). This is what I want to see in the other column as well. I don't know why sometimes a default value is visible on the database side (when generating form offline tables to database tables) and sometimes not.
    Perhaps sombody can bring some light in this issue.
    Thanks Thomas

    Hello Shay,
    I have the impression that you don't understand my problem. So here step by step:
    1. Create a offline Table TEST with one column TEST: VARCHAR2(20). nullable=true, no default value.
    2. Generate the table to the database
    3. When you look at the table properties (columns) with the database navigator the following information is displayed (sorry for the formatting):
    Column Name | Data Type | Nullable | Data Default | COLUMN ID| Primary Key | COMMENTS
    TEST | VARCHAR2(20 BYTE | Yes | (null) | 1 | (null) | (null)
    4. Now set the default value for the column TEST in the offline table for example to 'Test'
    5. Generate the table to the database.
    6. When you have a look at the database table, the default value is now 'Test' (as expected)
    7. Now remove the default value of the column TEST in the offline table
    8. Generate the table to the database
    9. When you have a look at the database table, the default value is now NULL (in uppercase letters without parenthesis)
    And this is where the problem starts!
    When you generate the table again with the options "Alter/Manual Reconcile" the default value of the column test is considered to be different! But in fact it should'nt be different because nothing has been changed.
    Best regards Thomas
    Edited by: thmayr on May 28, 2009 9:05 AM
    Edited by: thmayr on May 28, 2009 9:31 AM

  • HOW TO CHECK THE SUM VALUE AS NAGETIVE OR POSITIVE

    Hi All,
      I  have a requirement where i got a flat file where in the footer i got sum which may be positive or negative..(most of the time it is wrong)
    So, in the mapping i calculate the sum and then send this to ouput, but the sign feild is not comming right.
    If the incoming flat file is contains a negative( sum is also wrong) amount then i got a nagative sign in the output( but the sum is right )
    For example ::
    If the file contains a sum of      <b> 100.00-</b> in the footor.
    Xi takes the file calculate the right amount( <b>Suppose 50.00</b> ) but in the output file it is showing us as <b>50.00-</b>
    I have a sign feild in the mapping in both inboud and outbound message type. I just want to show the right amount (which it is showing after calculating) with the right sign(which it is not showing.)
    I will be glad for suggestion.\
    Thanks.

    Thanks guys,
    it's solved...

Maybe you are looking for

  • Nokia 5230 T-Mobile

    I am so frustrated with this phone, I can't get to my text messaging menu.  I click on the menu icon and it takes me to my inbox with no other options.  How do I get from there to the text messaging menu.  I try clicking the options button and it doe

  • When I try to open a PDF form from a site, my screen goes black.

    When I try to open a fillable PDF form from any web site my screen goes black and nothing further happens. I can use IE with success, but would prefer Firefox.

  • Permanent deltion of Production Order

    Dear friends, My requirement is like this, they created one material without batch managed check in WS view, now for the same material tried to mark the batch management indicator. system is giving the error. As my understand bach managed material ca

  • 2504 WLC on edge network for guest wifi

    I have a 2504 WLC with a 1042 AP and I have it placed on my edge Cisco 3750 switch. I have the management interface of the WLC set on my WAN IP 71.x.x.x subnet range, and I have the WLC doing DHCP duties with a DHCP scope of 192.168.X.0. I have my DN

  • Import media from card vs. Finder

    Is it a bad idea to Import MOVs straight from the Finder to FCPx as opposed to Importing from the original card structure? The only difference I see it the "Camera Name" and "Reel" columns are blank, but maybe there is something else I am missing.  L