|
Sorry, I tried this:
"Data Source=HOLDORF-PC\\SQL_2008_R2;Initial Catalog=EFDataModel; Integrated Security=True"
and it still doesn't work. One point is that this is the connection string that coexists with my Entity Framework model.
|
|
|
|
|
OK. I think you were right on the DB connection string. Now, I'm getting this error:
An error occurred while getting provider information from the database. This can be caused by Entity Framework using an incorrect connection string. Check the inner exceptions for details and ensure that the connection string is correct.
Here is my Entity Framework connection string:
<add name="EFDataModelEntities2" connectionString="metadata=res://*/Model1.csdl|res://*/Model1.ssdl|res://*/Model1.msl;provider=System.Data.SqlClient;provider connection string="data source=HOLDORF-PC\SQL_2008_R2;initial catalog=EFDataModel;integrated security=True;multipleactiveresultsets=True;App=EntityFramework"" providerName="System.Data.EntityClient" />
And here is my Model connections:
<EntityContainer Name="EFDataModelEntities2" annotation:LazyLoadingEnabled="true">
<EntityContainerMapping StorageEntityContainer="EFDataModelModelStoreContainer" CdmEntityContainer="EFDataModelEntities2">
|
|
|
|
|
I don't use EF; I've no idea what it epects beyond a normal SQL-server connection string. According to MSDN[^] your string looks correct.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
lholdorf wrote: Check the inner exceptions for details and ensure that the connection string is correct.
This is a good time to post the inner exceptions.
|
|
|
|
|
Where does your asp.net application run - on the same machine? If not, configure the SQL Server to accept connections from other machines.
And what about the account the IIS is running with? Does that account have sufficient access rights to the database? I suggest SQL Server authentication instead of WIndows authentication - do not forget to configure your SQL Server to allow that.
|
|
|
|
|
lholdorf wrote: HOLDORF-PC\\SQL_2008_R2
Is the double back-slash between the machine name and the instance name a typo in your question, or a mistake in copying the connection string from a C# source file to the web.config file?
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
|
Hello- can you give me any example scenarios/questions for writing a complex SELECT statements? My intention is to improve my SQL skills.
|
|
|
|
|
|
|
Sure, try implementing a Turing Machine in SQL.
You'll never get very far if all you do is follow instructions.
|
|
|
|
|
|
data modeling guy wrote:
Hello- can you give me any example
scenarios/questions for writing a complex SELECT statements? My intention is to
improve my SQL skills.
- Calculate reputation points of a user.
- Fetch the contibutions-section for a user (see the section on your user-page; it contains some statistics)
- Fetch the ten members from the database that answered most questions last month.
- Fetch the voting-percentages for the straw-poll result for all possible answers.
- Fetch any low-repuation member that posts the same message in multiple places, ordered by the amount of similar messages.
- Fetch the data to show the forum-content for page 3 of this forum, in threaded view, with 50 posts per page.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
No no no these suggestions expect him to do the work and write the queries, it sounds like he wants YOU to write the queries and he will study them.
Good luck getting CM to lend out the database and schema
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Thanks Eddy. I Did some more google search and found some more. Cheers!
|
|
|
|
|
|
I tried this
select convert(datetime, 41818) as mydate
result
2014-06-30 00:00:00.000
In Excel, it should be
6/28/2014
It's always 2 days in advance
Please help!
Thanks a lot
|
|
|
|
|
Why do you think it's wrong?
SELECT DATEDIFF ( dd , '1900-01-01' , '2014-06-30' )
SELECT DATEADD ( dd, 41818 , '1900-01-01' )
Miller Nguyen wrote: In Excel, it should be
What do you mean "it should be" ?
You'll never get very far if all you do is follow instructions.
|
|
|
|
|
I don't say it's wrong, that's why I put the QUESTION MARK in the topic.
I just wonder why Excel and SQL are giving different result
|
|
|
|
|
What the f...? You are right, I tested it.
Look at day number 0: with SQL Server, it is Jan 1, 1900; with Excel: Jan 0 , 1900.
The next bug is the leap year: Excel treats 1900 as a leap year (that's wrong!), while SQL Server correctly knows that 1900 is not a leap year.
In sum, those differences account for the 2 days difference in current dates.
|
|
|
|
|
|
Yeah, as I drifted off to sleep last night I recalled that Joel had written about Excel having to support a Lotus 123 issue.
You'll never get very far if all you do is follow instructions.
|
|
|
|
|
I love that story.
They brought a f*** counter to all meetings with BillG.
|
|
|
|
|
See my answer to Bernhard
|
|
|
|
|