This month (2003-02) C # version of the FAQ

Source: Internet
Author: User
Tags datetime
Q: How to easily and quickly convert character arrays to strings? <br>
Answer: char[] ar;<br>
String s = new String (AR);<br>
<br>
Q: What do I do if I want to traverse a control (such as DateTimePicker) in a form? <br>
A: foreach (Control C. Controls) <br>
{<br>
if (c is DateTimePicker) <br>
{<br>
Your code <br>
MessageBox.Show (((DateTimePicker) c). Name);<br>
}<br>
}<br>
<br>
Q: I want to learn C #, do you have a good book to recommend? <br>
Answer: (a) C # advanced Programming <br>
(b) Look at the. NET SDK, which is better than any book!<br>
<br>
Q: How to determine in C # that the string does not contain full-width characters <br>
A: Determine if ASCII is greater than 255 if greater is the full-width character <br>
<br>
Q: Must the DataSource of the DataGrid be a dataset? You can manipulate the DataGrid yourself rather than through data binding <br>
Answer: Assignment <br>
dgexample[rownum, Colnum] = "AAAA";<br>
Take value <br>
String cellvalue = dgexample[rownum, Colnum]. ToString () <br>
Actually manipulating the DataGrid is the datatable<br> that operates its corresponding data source.
You build a DataTable yourself, then you can manipulate column and row, and finally bind to Datagird <br>
<br>
Q: How do I get the total number of rows in the DataTable that are not equal to delete DataRowState? <br>
Answer:mytable.dataview.rowstatefilter=dataviewrowstate.deleted;<br>
int undeleterowcount=mytable.rows.count-mytable.dataview.count<br>
<br>
Q: How does C # Create irregular forms <br>
A: You can use the form.region to achieve <br>
Http://www.codeproject.com/csharp/shapedform.asp<br>
<br>
Q: How can I tell if today is the first day of the week? <br>
Answer: DateTime.Now.DayOfWeek.GetHashCode () <br>
or int intdayofweek= (int) datetime.now.dayofweek;<br>
<br>
Q: How do I get the ASCII code for a character in a string? <br>
A: int a= ' a '; can get the ASCII code of a <br>
<br>
Q: How to screen WinForm drag-and-drop function <br>
A: Change the FormBorderStyle for fixedsingle<br>
<br>
< The answer is wrong please point out >

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.