Today, when oledbdataadapter is used, the following error occurs: "sqlncli.1 provider is not registered on the local computer." Baidu, Google, and I checked related solutions on the Internet. The solution described in many articles on the internet is that the SQL native client component is not installed when SQL Server is installed, so you can install it separately. However, after confirming the installation list, I found that I have installed this component. That is to say, there must be a problem with the related configuration. The reason is that I have used a later version of SQL.
Server opens a database file created with a lower version. After careful troubleshooting, it is not surprising. The selectcommand ---> connection ---> connectionstr field is incorrectly configured on the interface. Because sql2008 uses sqlncli10, its field value should be
Provider = sqlncli10; Data Source = (local); Pwd = password; persist Security info = true; user id = sa; initial catalog = Local Database Name
Test passed!