Project development notes

Source: Internet
Author: User

1. An error occurs when reading data. [system. Data. sqlserverce. sqlceexception] = {"cannot generate a keyset cursor for the query because there is an explicit or implicit group by operator.
Because the explicit or implicit group by operator exists, the key set cursor for query cannot be generated. Is it because the group by operator cannot be used in SQL compact queries? The reason for sqlceresultset is found later. If the sqlceresultset type is returned during execution, an error may occur. It may be that command. executeresultset does not support group by. In short, if it is changed to the datatable type, no error will occur.
2. Tab tabcontrol:
Tabcontrolquery. selectedindex the first value is equal to 0, the second value is equal to 1, and so on...
3. about transferring values
The first method is to implement global variables by defining static variables, but it is best not to use static variables if the variable value needs to be changed frequently.
The second is to pass values by defining constructors and attributes,

// Form1
Form2 m_form =   New Form2 ( " Type " );
M_form.m_freceiver = " Freceiver " ;

// Form2
Public   String FTYPE {Get;Set;}
Public   String M_freceiver {Get;Set;}
Public Form2 ( String P_strtype)
{
Initializecomponent ();
FTYPE=P_strtype;
}

The third method is to pass this. dialogresult = dialogresult. OK to determine the value.

// Form2
Public   String M_userid { Get ; Set ;}
M_userid = " User "
This . Dialogresult = Dialogresult. OK;

// Form1
Public   String M_freceiver { Get ; Set ;}
Form2 m_form =   New Form2 ();
If (Form2.showdialog () = Dialogresult. OK)
{
M_freceiver = Form2.m _ userid;
Userquery. Dispose ();
}

The second and third types of projects are used in most cases, and the delegate is rarely used.
4. Data insertion: when data is inserted, an exception occurs when ntext fields are inserted when the data size is large, however, it was found that the data could be saved during data synchronization. At last, my colleague helped solve the problem by adding the parameter and specifying the type,

Sqlce. Parameters. Add ( " @ Fcontent " , P_strdetialinfo );
Sqlce. Parameters [ " Fcontent " ]. Sqldbtype = Sqldbtype. ntext;

The type must be specified after the parameter is added. Otherwise, an error occurs.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.