not getting access the db


hi i have the following problem after importing databse in c#.  

i have import a mdf database in C#. but it has exception after pressing `F5` for debugging.


`A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)`


how can i solve this??
Hi  

This is simple. First check whether you are able to connect Sql Server through SSMS or not.If you are able to connect through SSMS, then there may be a problem in connection string. If you are not able to connect through SSMS, then you had some problem with SQL Environment.
If I am not wrong, you are trying to read or loop through the rows from datatable. This error states that the datasource(DataTable) is not having any rows. To avoid this exception use this before you read or loop through datatable:  


```
if(dt.Rows.Count  > 0 ){
     //Do your stuff here.
}
```
  

  

  

--Amit i’m not able to replicate this in a global test.

how long has this subdomain been on cloudflare?

do you have just one dns entry for that subdomain in cloudflare dns?

a 525 happens is there’s an ssl error when connecting to your server. do you see anything in the server logs? (steps 6 and 7 in the… You can provide an optional parameter to the scaffolding command to update only the table you target.



```
Scaffold-DbContext "Server=(localdb)\mssqllocaldb;Database=DatabaseName;Trusted_Connection=True;" Microsoft.EntityFrameworkCore.SqlServer -OutputDir DirectoryNameOfYourModels -Tables employee -f

```

If you are using .net core cli then use.



```
dotnet ef dbcontext scaffold "Server=(localdb)\mssqllocaldb;Database=DatabaseName;Trusted_Connection=True;" Microsoft.EntityFrameworkCore.SqlServer -o DirectoryNameOfYourModels -t employee -f

``` Open SQL Enterprise Manager and expand the Databases tree. Right click on the database name and select All Tasks, then select Detach Database. Move the physical files from the D drive to the H drive. Right click on databases and select All Tasks > Attach Database. Browse to the new location and select the mdf file. Click OK, then OK again (you may need to correct the path to the log file). `out` parameters in SQL Server are fun. You have to repeat yourself *everywhere*.


Specifically, here, you've forgotten to mention it in the parameter list when calling the stored proc. `dbo.InsertPhones @model, @out` should be `dbo.InsertPhones @model, @out out`. There may also be a way to omit the parameter list from this string and instruct SQL Server that you're giving it a stored procedure name, not arbitrary query text, but I'm not sure how you would do that specifically here (with an `SqlCommand` object, it would be via the `CommandType` property).


If you're using an `out` parameter, the `select` at the end of the stored procedure is unnecessary, but I assume that was an attempt at a fix. Dear Jay Nelish


Your Question is incomplete


is the specific system is not on Network? its might be a problem discovered last year, that system ping but not share any data, or cannot access the system


you click on start menu and then click on run  

type serivces.msc  

and run the computer browser service, Remote Procedure call service, Server, and Client service


and your problem will resolved  

but actually this is because of virus change your antivirus program and scan your system wtih updated A/V Here is a link to assist you.


<https://technet.microsoft.com/en-us/library/ms178078(v=sql.105).aspx>


If you had done a web search with the question you entered here, you would have found multiple sites that give you the instructions Hello,

 

 

We would like to inform you that decoding MCE errors is out of the scope of support for us. As a general recommendation based on the wording for the log, please check the memory modules installed and confirm if one of them has failed.
 
 
 
 
 
 
 
 
 

[View solution in original post](/t5/Server-Products/How-to-decode-MCE-errors/m-p/527769#M13599) A couple of notes to get started:



> 
> .apply(literal\_eval)
> 
> 
> 


Wouldn't this be better as `map`?



> 
> I then re-create the Dask DF:
> 
> 
> ddf = dd.from\_pandas(ddf\_out, npartitions=nCores)
> 
> 
> 


`ddf_out` was already a dask dataframe, I don't know why you had to do this.



> 
> The columns in result seem to match those in metadir.
> 
> 
> 


The value of `result.columns` is taken from the meta you provided, no computing happens until you ask for it (dask is lazy in most operations). Does the ValueError exception not provide further information?


Here is a full example



```
x = ({'F9_07_PZ_COMP_DIRECT': '0',
  'F9_07_PZ_DIRTRSTKEY_NAME': 'DEBRA MEALY',
  'F9_07_PZ_COMP_OTHER': '0',
  'F9_07_PZ_COMP_RELATED': '0',
  'F9_07_PZ_TITLE': 'CHAIR PERSON',
  'F9_07_PZ_AVE_HOURS_WEEK': '1.00',
  'F9_07_PC_TRUSTEE_INDIVIDUAL': 'X'},
 {'F9_07_PZ_COMP_DIRECT': '0',
  'F9_07_PZ_DIRTRSTKEY_NAME': 'HELEN GORDON',
  'F9_07_PZ_COMP_OTHER': '0',
  'F9_07_PZ_COMP_RELATED': '0',
  'F9_07_PZ_TITLE': 'VICE CHAIR',
  'F9_07_PZ_AVE_HOURS_WEEK': '1.00',
  'F9_07_PC_TRUSTEE_INDIVIDUAL': 'X'})
df = pd.DataFrame({'a': x})
d = dd.from_pandas(df, 1)
meta = pd.DataFrame(columns=['F9_07_PZ_COMP_DIRECT', 
       'F9_07_PZ_DIRTRSTKEY_NAME',
       'F9_07_PZ_COMP_OTHER', 'F9_07_PZ_COMP_RELATED', 'F9_07_PZ_TITLE',
       'F9_07_PZ_AVE_HOURS_WEEK', 'F9_07_PC_TRUSTEE_INDIVIDUAL'], dtype="O")
d.map_partitions(lambda df: df.a.apply(pd.Series), meta=meta).compute()

```

How did I know what `meta` to use? I applied the function to the pandas dataframe - you might use a small piece of the dataframe to do this.


Some additional notes:


* it is an anti-pattern to load the data with pandas, pass to dask workers and then gather the whole result back to a pandas (in memory) dataframe, you are very unlikely to see a speedup this way and may incur a lot of overhead. You are better off loading with something like `dd.read_csv`, and aggregating or writing with dask functions too. Only `compute()` on something that will be small or not return anything (because it involves writing the output). The official examples do not use from\_pandas.
* string and dict processing are python methods, and so hold the interpreter lock (GIL) of any python function: threads will not actually run in parallel. To get parallelism, you need to run in processes, which is most easily achieved using <https://docs.dask.org/en/latest/setup/single-distributed.html>
* the distributed scheduler also gives you access to the dashboard, which has a lot of useful information to diagnose how your system is running. You can also configure a lot about its behaviour, in case you have firewall rules you need to obey. For anyone having similar problems, I have solved my issue. It was several-fold.


* As Darren suggested and Paul backed up, the Max..Size properties in the configuration needed to be enlarged. The SvcTraceViewer utility helped in determining this, but it still does not always give the most helpful error messages.
* It also appears that when the Service Reference is updated on the client side, the configuration will sometimes not update properly (e.g. Changing config values on the server will not always properly update on the client. I had to go in and change the Max..Size properties multiple times on both the client and server sides in the course of my debugging)
* For a DataTable to be serializable, it needs to be given a name. The default constructor does not give the table a name, so:



```
return new DataTable();

```

will not be serializable, while:



```
return new DataTable("someName");

```

will name the table whatever is passed as the parameter. 


Note that a table can be given a name at any time by assigning a string to the `TableName` property of the DataTable.



```
var table = new DataTable();
table.TableName = "someName";

```


Hopefully that will help someone.