|
Salam Eid Mabrook,
But the same thing is working in Enterprise Library, why only the Entity Framework giving the problems. But I don't have control on the SQL Server completely.
Just in case I am asking for the debugging reason, what could be the reason if we SQL Server and my machine is on the same domain. Because when I am logging in to the SQL Server I am logging without using any domain. May be its on the same domain. But Enterprise library is able to connect it without using any domain name.
If I am in the same domain what could cause the entity framework to get the database name in the context objects connection.
Thanks in advance.
Thanks & Regards,
Abdul Aleem Mohammad
St Louis MO - USA
|
|
|
|
|
Alikom AlSalam, Eid Mubarak
Can you post the connection strings used in both cases? Does the DB admin allow public users on the database?
|
|
|
|
|
Hi,
Here are the connection strings.
<connectionStrings>
<add name="Connection String" connectionString="Database=Database;Server=LNIDDBTUMSQL24\STAYATWORK;Integrated Security=SSPI"
providerName="System.Data.SqlClient" />
<add name="StayAtWorkEntities" connectionString="metadata=res://*/StayAtWorkDataModel.csdl|res://*/StayAtWorkDataModel.ssdl|
res://*/StayAtWorkDataModel.msl;provider=System.Data.SqlClient;provider connection string="
Data Source=LNIDDBTUMSQL24;Initial Catalog=STAYATWORK;Integrated Security=True;MultipleActiveResultSets=True""
providerName="System.Data.EntityClient" />
</connectionStrings>
Thanks & Regards,
Abdul Aleem Mohammad
St Louis MO - USA
|
|
|
|
|
Can you try to change the EF connection to:
<add name="StayAtWorkEntities" connectionString="metadata=res://*/StayAtWorkDataModel.csdl|res://*/StayAtWorkDataModel.ssdl|
res://*/StayAtWorkDataModel.msl;provider=System.Data.SqlClient;provider connection string="
Data Source=LNIDDBTUMSQL24\STAYATWORK;Integrated Security=True;MultipleActiveResultSets=True""
providerName="System.Data.EntityClient" />
The difference between the connection strings is that the ENTLib connection connects to a named instance (LNIDDBTUMSQL24\STAYATWORK) while the EF connection connects to the default instance on LNIDDBTUMSQL24.
|
|
|
|
|
Hi,
I did it, I just copied database on my local machine and tried to connect using the following connection strings. In the place of Datasource value it is coming correct, but in the place of Database its always coming as empty String. Did I do any mistake during the entity frameworks mapping to the database because when I debugged following values are coming while connecting to my local database server also context.Connection.Datasource="(local)\STAYATWORK" or ".\STAYATWORK", context.Connection.Database="".
Something should be wrong. Do I need to change anything in this
<dataConfiguration defaultDatabase="LocalSqlServer" /> should put the server name or something here.
Following are the connection strings that I have used.
<add name="StayAtWorkEntities" connectionString="metadata=res://*/StayAtWorkDataModel.csdl|res://*/StayAtWorkDataModel.ssdl|
res://*/StayAtWorkDataModel.msl;provider=System.Data.SqlClient;provider connection string="
Data Source=(local)\STAYATWORK;Integrated Security=True;MultipleActiveResultSets=True""
providerName="System.Data.EntityClient" />
<add name="StayAtWorkEntities" connectionString="metadata=res://*/StayAtWorkDataModel.csdl|res://*/StayAtWorkDataModel.ssdl|
res://*/StayAtWorkDataModel.msl;provider=System.Data.SqlClient;provider connection string="
Data Source=.\STAYATWORK;Integrated Security=True;MultipleActiveResultSets=True""
providerName="System.Data.EntityClient" />
Thanks & Regards,
Abdul Aleem Mohammad
St Louis MO - USA
modified 19-Aug-12 19:53pm.
|
|
|
|
|
Try to add
Initial Catalog=STAYATWORK; to the connection string.
|
|
|
|
|
Hi,
Yes I added but its doing the same thing, its showing the database name as empty string, is entity framework having any problem connecting the database using Windows authentication. Thats what I am seeing when googling. Should I switch to SQL Server authentication? For that I need to talk to DBA.
Please help me.
Thanks & Regards,
Abdul Aleem Mohammad
St Louis MO - USA
|
|
|
|
|
Hi,
I found whats the problem is, if you can help me in solving it, it would be really great. When I am degging when Entity Framework class "StayAtWorkEntities" is trying to get the data from the SQL Server. There it is throwing exception, because application is trying to access the databse using "<domainname>\<machinename>" account instead of "<domainname>\<my user="" name="">" account.
But this "<domainname>\<machinename>" account, doesnt have access to the Database. Instead I have access to the database.
Now is there any way to force IIS to run these two applications Web Application and a WCF Service under my user account "<domainname>\<my user="" name="">".
I am also admin on the Server is there any way to force IIS to do that, I have tried by changing the Application Pool Identity to "LocalSystem", "Network Service" in both the cases its running under the same user account "<domainname>\<machinename>" which doesnt have access rights to access the database.
Thanks & Regards,
Abdul Aleem Mohammad
St Louis MO - USA
|
|
|
|
|
User accounts were lost from your post, but you can configure IIS App pool to run using any windows account.
as mentioned here[^]. But select "Custom Account"
|
|
|
|
|
Yeah Hesham,
I got it solved thanks for your help I have set my Windows user account on my Application pool Identity. Yes it has reolved all the problems.
Now its working fine.
Thanks a lot once again.
Thanks & Regards,
Abdul Aleem Mohammad
St Louis MO - USA
|
|
|
|
|
Hi All,
ASP.Net AjaxToolkit MaskedEditExtender defaults to AM only when system time is between 12-1 PM
For system date and time other than between 12:01 PM to 1:00 PM it is working as expected:
Just key in the month and press “Tab” key and it fills rest of the part based on system date/time.
-----------------------------------------------------
For system date and time between 12:01 PM to 1:00 PM it is NOT working as expected:
Key in month and press “Tab” key
The time displayed remains “AM” only. It should have changed to “PM” because System time is in PM. The issue exists only for 12-1.
-----------------------------------------------------
Thanks in advance
gf
|
|
|
|
|
I have default.aspx and inside it i am including two web user controls signup.ascx and message.ascx
in message.ascx i have a function script like this:
<script type="text/javascript">
// <![CDATA[
</script>
I want to know how can I run the function ShowMessageWindows from the signup.ascx.cs or default.aspx.cs code file?
|
|
|
|
|
One way to do this is to have a label that will contain scripts. from code behind you can set the text of this label as the script that you want to run. for example:
lblScript.Text = XHtmlWriter.Tag("script", "type=\"text/javascript\"", "ShowMessageWindow();");
Every now and then say, "What the Elephant." "What the Elephant" gives you freedom. Freedom brings opportunity. Opportunity makes your future.
|
|
|
|
|
ClientScriptManager class allows you to call javascript from code behind.
MSDN Link has examples:
ClientScriptManager Class[^]
Schenectady? What am I doing in Schenectady?
|
|
|
|
|
Hi all,
I want to develop shopping website with online payment using debit or credit card basically used for transaction in India.
Please any one help me the procedure and where to get the code
|
|
|
|
|
ashjassi wrote: where to get the code
Here[^]
|
|
|
|
|
|
That might be the best answer to a "gimme code" type question I have seen yet. Thanks for brightening my morning with that.
I wasn't, now I am, then I won't be anymore.
|
|
|
|
|
You're welcome
|
|
|
|
|
I got a good laugh out of that!
I'm still laughing
It blows me away that people think of code like songs that you can just download from iTunes,
Gimme Code has been used here frequently in the last 4 months.
|
|
|
|
|
When the demand is higher than the supply, the quality of the supply goes down naturally. This is what is happening with programmers also. Many people choose programming as a profession just because they think it will earn them more money, which is absolutely acceptable if the person is willing to learn and improve themself over time. But unfortunately, the facts seem to be otherwise.
|
|
|
|
|
That was a good way of phrasing the situation.
I came to the Code Project to get away from that, eg asp.net forum. Now it has spilled over to here.
I live in Orange County California, and bad programmers are finally being given pink slips, or layed off for lack of skill, and being replaced with much higher paying salaries and benefits, in exchange for the skill set.
I don't mind helping out someone who has at least written some code, and posted a sample. But the ones that phrase the question, and say what is wrong drives me nuts.
I looked at steins master page markup last night, and what a mess. What do you tell them?. There's no way it can work.
As far as this post goes, the customer decides what service to use, not the programmer. Then get the API for it, and if you don't get it, ask for help.
Thanks for chatting with me. Over and out, going bowling.
|
|
|
|
|
You have to use a Payment Gateway like iVeri
|
|
|
|
|
I cant Get any Solution How to Implement
|
|
|
|
|