C # common error Solutions,

Source: Internet
Author: User

C # common error Solutions,
1. Can I provide the Visual Studio development kit? Solution:

Visual Studio 2017 development environment:

Https://www.visualstudio.com/zh-hans/downloads/

 

Visual Studio 2015 and earlier development environments:

Https://www.visualstudio.com/zh-hans/vs/older-downloads/

2. Can I provide the SQL Server database installation file? Solution:

For: https://pan.baidu.com/s/1dE5zVtZ

3. Solution to the Problem of the input symbol in the code

C # All letters, numbers, Parentheses, and punctuation marks in the Code are half-width characters in the English input method, rather than full-width characters in the Chinese input method or English input method, the specific input method status and corresponding sample code.

 

4. When you run the program, the system prompts a solution error similar to "Crystal. *****".

This is a problem with the crystal report.

VS 2010 and later versions do not contain Crystal Reports. To use these reports, you must download and install the Crystal Reports separately:

Https://wiki.scn.sap.com/wiki/display/BOBJ/Crystal+Reports%2C+Developer+for+Visual+Studio+Downloads

After the installation is complete, open the crystal report file (. rpt) in VS, select "database Field" in "field resource manager", right-click, and select the second item "set data source location ",

In the displayed dialog box, expand "properties" to modify the "Data Source", for example:

 

5. database connection failure Error

Solution:

First, check whether the database is attached. Then, modify the Data Source or Server in the database connection string in the code to your own SQL Server name, change uid and pwd to the user name and password used to log on to the SQL Server respectively.

In addition, if your SQL Server authentication method is used, modify the database connection string:

Data Source = server name; Database = Database name; Integrated Security = SSPI;

6. array out-of-bounds exception

Solution:

The index of the main array starts from 0. Therefore, when the index is traversed, the index length minus 1.

7. namespace missing Error

If an error similar to the following occurs during code running

 

Solution:

When an error similar to the above occurs, it indicates that the namespace of the corresponding class is missing and can be in the https://msdn.microsoft.com/zh-cn/library/ms229335 (v = vs.80 ). search for this class in the aspx help, check which namespace it is located in, and then use using to add this namespace.

8. Access database connection Error

 

Solution:

Download the "Microsoft. ACE. OLEDB.12.0" Driver Installation Package and install it. For details, see www.microsoft.com/zh-cn/download/details.aspx? Id=23734. after the download is complete, an accessdatabaseengine.exe file is generated. Double-click the file and install it as prompted.

9. You have not set the object reference to the instance of the object.

 

 

Solution:

This error is the most common type of errors in C # programs. This error is usually caused by the absence of Object Instantiation. Therefore, if you encounter a similar error prompt during program development, you only need to check whether the object has been instantiated and instantiate the object through code.

10. Word reference error in Enterprise Personnel Management System

 

Solution:

Please refer to the post http://www.mingrisoft.com/postview/25866.html.

11. How to Solve Baidu search and controls:

Search Baidu directly, find the website with the words msdn.microsoft.com, and open it.

 

12. common debugging methods for code errors:

Right-click the wrong code, insert the breakpoint, and run the program. After the program is executed, it stops at the breakpoint, press F10, and execute step by step, move the mouse over the variable to be monitored, check whether the value is correct, and debug the program, especially some code that executes the SQL statement. In this way, obtain the SQL statement, run the command in the SQL Server Manager to check whether the error is correct, so that you can locate the cause of the error more quickly.

13. Common Code comparison tools:

Beyond compare

Http://www.scootersoftware.com/download.php

14. How to display the description text of the column chart vertically:

Specify the following parameter in the DrawString method:

New StringFormat (StringFormatFlags. DirectionVertical)

 

From the author of "0 basics C #", please indicate the source for reprinting !!!

Related Article

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.