Can EFCodeFirst Work With The Existing Netdb.mdf
Jan 31, 2011As opposed to create the new one automatically, how to force the EFCodeFirst to use the existing aspnetdb.mdf in app_data?
View 2 RepliesAs opposed to create the new one automatically, how to force the EFCodeFirst to use the existing aspnetdb.mdf in app_data?
View 2 RepliesI have not found information how to do the following:
how to add a new table using EFCodeFirst to the existing database aspnetdb.mdf?
I have done the MusicStore Tutorial and it is working fine, but as I have tried to make my new project I running into trouble, big one, last three days I have been on my Pc everywhere on body id paining now; neck, back, ...The problem is as I create new Empty MVC3 project using Web developer express edition, and I add App_Data folder with new database with Product Table and Product Class in Model folder I try to install EFCodeFirst just as I did on the Tutorial from <Tools<LibraryPackageManager<AddLibraryPackageRefrence; and choose EFCodeFirs it says dependence is missing so install it from PowerShel Console which I did and I can see that it is installed but but as i try to run the project it saysInvalid object name 'dbo.Products'. this my homecontroller code
[Code]....
I am trying to populate a drop down list from my controller for a create action. I can display the dropdown as I want but when I cannot get the value to be stored in the database. My models:
[Code]....
Controller: [Code]....
View: [Code]....
This above snippet will show me the message "The value '50117dae-a7d7-4371-926f-7b1f7aaec133' is invalid."
if I change the line to @Html.DropDownListFor(ct => ct.CollectionType.CollectionTypeId, new SelectList(ViewBag.CollectionTypes as System.Collections.IEnumerable, "CollectionTypeId", "Title"))
@Html.ValidationMessageFor(model => model.CollectionType)
the page will not do anything - I believe this could be because the controller is trying to add a new CollectionType.
I have a website and a SQL Server Database. I want to use ASP.Net Membership for login and roles.
View 1 RepliesAfter opening an existing proyect in visual studio 2010, the web form in design view doens't work. All server control puts a gray box with the following message : Error Creating Control - imgTransportistaSession state can only be used when enableSessionState is set to true, either in a configuration file or in the Page directive. Please also make sure that System.Web.SessionStateModule or a custom session state module is included in the <configuration><system.web><httpModules> section in the application configuration.
View 4 RepliesI'm using SQL Server 2008 R2 Express and try to add ASPNETDB.mdf database to my web site project. However, the following message appears: "Connections to SQL Server database files (.mdf) require SQL Server 2005 Express or SQL Server 2008 Express to be installed and running on the local computer. The current version of SQL Server Express can be downloaded at the following URL: http://go.microsoft.com/fwlink/?LinkId=125883".
View 5 RepliesI am working on the MVC storefront Rob Conery project and I lost my ASPNET.mdf database !I would like to have the ASPNET.mdf database in my App_Data folder. I tried to include the db right clicking on it and including it in the project. But on the Server Exporer when I am tring to look at tables there are none.
<connectionStrings>
<add name="ApplicationServices" connectionString="data source=.SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true"
providerName="System.Data.SqlClient" />
<add name="CoderForTradersConnectionString"
[code]...
After reading this post and the mentioned blog, I am having the exact same problem. However, my web config does not have a membershipprovider section. Not sure how I'm going to fix it
http://weblogs.asp.net/scottgu/archive/2006/04/22/Always-set-the-_2200_applicationName_2200_-property-when-configuring-ASP.NET-2.0-Membership-and-other-Providers.aspx
I have installed Visual Web Developer 2008 Express Edition along with SQL Server Express 2008 on Windows Vista and Windows 7. On Windows Vista, when I click the "ASP.Net Configuration" icon in the Solution Explorer and then click on the "Security" link, a new ASPNETDB.MDF file is created in the App_Data folder of any new project I have open. The same actions on my "Windows 7 Ultimate" machine will result in a message along the lines of "Your Data Source is not configured properly. This may be because the server has an invalid name or you do not have the proper credentials or you do not have the proper permissions"(not at Windows 7 machine right now so this isn't verbatim)
View 4 RepliesI created an ASP.NET Website that requires user authentication. I am using VS 2010 Pro and SQL Server 2008R2 Express. On my local machine I established login capability using ASP.NET Configuration, which works fine. When running the website on my local server instance, I can login just fine. The site now has a folder titled App_Data containing the ASPNETDB.MDF data file. My Hosting site requires me to make a backup of the local database (*.bak), upload the .bak file to their site, then run a database restor
View 16 Repliesmy web site i have two databases, ASPNETDB.MDF and a self created one (database.mdf). (The don't contain a lot of data yet)But i need a relationship (foreign key) between a table in ASPNETDB.MDF and a table in database.mdf.So i guess i need to merge both databases first, would you just extend the "ASPNETDB.MDF" with the tables from "database.mdf" ?or better configure "database.mdf" for the asp.net Applicatoin Services and then delete "ASPNETDB.MDF"
View 2 RepliesCreating a system with web front end and SQL backend (microsoft obviously). I have tried using the asp.netsqlprovider but i can;t as i am only allowed one database on the server, so i then tried to update my current database with the triggers to input the schema into the already existing database.Next step i create my own table with two simple fields of username and password and try and authenticate that way, i can't get that to work either.
I ahve limited permissions on the network as i am a University Student. I really don't know what to do. Never had to create a log on system before and i thought it would be far simpler than this. I ahve used Microsoft's sqlprovider schema before and it worked fine. I have also authenticated via IIS and AD too before. I can't do any of those two in this instance it seems.I need an alternative for logging in users, if needs be in can be crude. I also still need to have some kind of two different views too for logged in users and not logged in users, but that can change if needs must.Don't let me down people, haha. Think this posts in the correct place, i could not find another one i thought could be more relevant.
I m getting the following error when i upload my site to Production Server using Database in App_Data ASPNETDB.MDF
Server Error in '/' Application.
Runtime Error
Description: An application error occurred on the server. The current
ustom error settings for this
application prevent the details of the
application error from being viewed
[code]...
I have created a crystal following your article which url isĀ
[URL]
It is working fine on local machine but when i upload it on the server it is not working. Crystal Report is showing but data is not showing in the crystal report.
I am working on a multi-language web site. It is half English and half Portuguese. I have created forms that have portuguese values in it. These forms work perfectly on my desktop. I'm using Cassini as the development server. When I move them over to IIS, they are not loading properly. The text comes up all weird looking. I am declaring the culture in the page attribute: Culture="pt-BR"
View 4 Repliesi'm trying to make this work for several days but it just doesn't work.
this is my code:
aspx page:
[Code]....
webservice:
[Code]....
this was downloaded from this website.
the problem is that the page loads fine but no autocomplete occurs.
I am a new to WCF. I have written ajax to use a web service before, but on this project I am trying to use ajax to WCF.After I build the project and wcf using ajax, I receive the return successfully. But, 10 or more minutes later I don't get a return, the ajax calls the error function, and the fiddler returns nothing.
If I rebuild the project without any source modifying, I receive the return successfully again.
I want to convert an existing asp.net 3.5 application to asp.net MVC2.0. how we can proceed with?
View 2 Repliesi am having 2 different txt files saved namely a.txt and a1.txt and my data in that is
a.txt 23ABCD444455510000GFHDHHD
a1.txt 2323143333344435.678gfdsfgskf
Now i would like to add those 2 values which are in bold and i have display the sum..
Right now, I am struggling with this ASP.NET problem. I want the computer to display a label that says, "ID Already exists -- must select a different value" when the computer has a matching (or the same) number in the dropdown list box. When I add a NEW ID, this is when the process happens.If the New ID does not = to the values in the ID Number, then when I press 'Add New Item', the red label should display:ID Already exists. Must select a different value. Right now, my code for the add button event is:
If ddlItems.Text = "Add New Item" Then
Dim item As New Item
With item
[Code]....
What can I do to add the text below and read all IDNumbers to verify that it is not chosen already?
i m using a regex to not allow certain characters, the below code works fine for certain html tags but not for all for i dont want the user to enter html tags for eg if i enter <nitin/> it allows but i dont want this to happen for other html tags it does not allow
!@#$%^&*()+=[]\';,/{}|":<>? or
!@#$%^&*()+=[]\';,/{}|":<>/>?
found while searching for help on my asp.net application.I have a small application with connected to a SQL database. As it was so small, and contained very little data of any importance, i had set it up with Clear passwords.Now i have been asked to expand the database considerably, and encrypted passwords are now required. I can easily modify the web.config so all future users are set up with encrypted passwords. But is there any way to change all existing users passwords to be stored encrypted?
View 10 RepliesI am receiving the contents of a file via ftp. I don't want to go into every detail (unless needed), but I am working with existing code that was using 3rd-party software to get ftp files. I am replacing that with .NET code. But I want to replace as little as possible of the existing code that is not specifically using the 3rd-party s/w. So I am trying to use a class originally written by the author of the code (a former employee).
This is his class constructor:
Code:
Public Sub New(ByVal fileName As String, ByVal content As StreamReader)
Me.FileName = fileName
Me.Content = content
Me.TimeStamp = Date.Now
End Sub
So I need to pass a StreamReader. My problem is how to get one.
In my procedure ReceiveFile(), I execute this code:
Code:
Private Shared Sub ReceiveFile(ByVal sFilename As String, ByRef objMemoryStream As System.IO.MemoryStream)
Try
Dim request As FtpWebRequest = DirectCast(WebRequest.Create("ftp site and folder" & sFilename), FtpWebRequest)
request.Method = WebRequestMethods.Ftp.DownloadFile
request.Credentials = New NetworkCredential("id", "pw")
Dim response As FtpWebResponse = DirectCast(request.GetResponse(), FtpWebResponse)
Dim responseStream As Stream = response.GetResponseStream()
Dim reader As New StreamReader(responseStream)
Dim sFile As String = reader.ReadToEnd
'reader.Close()
' response.Close()
'objMemoryStream = responseStream
Dim objStream As System.IO.MemoryStream
objStream = New System.IO.MemoryStream(Convert.FromBase64String(sFile))
' objMemoryStream = Convert.FromBase64String(sFile)
objMemoryStream = objStream
'Return reader
Catch ex As Exception
Dim i As Integer
i = 10
End Try
End Sub
responseStream is declared as a stream but when I query it in the debugger it says it's an FtpDataStream, after it's set equal to response.GetResponseStream. I want to take that stream and somehow get it into a MemoryStream. I thought I found the solution this morning via Convert.FromBase64String, but when I ran I got an exception saying "Invalid character in a base-64 string", and I think it's because of the newline character in the string. The file that's received contains three lines separated by a newline character.
Is there a preferred way to configure an ASP.net solution so that OpenRasta can run alongside an existing application asp.net application.
I'm interested in what the process would be for a request coming in to the server for:
a resource OR knew about
a resource the old web app knew about
a resource neither app know how to handle
I'd like to keep the 2 projects separated so that we can gradually move over functionality to being based on OpenRasta and away from our legacy app.
As an example, on a machine with a virtual directory of /api
Requests to /api/contacts <-- handled by OpenRasta.
Requests to /api/v0.1/contacts <-- handled by Legacy web app.
Requests to /api/junk <-- handled by Neither web app.