Jump to content

K_Drive

Members
  • Posts

    51
  • Joined

  • Last visited

Profile Information

  • Location
    NE Ohio, USA

K_Drive's Achievements

Newbie

Newbie (1/7)

2

Reputation

  1. I am trying to complete what seems like a very simple example project on MSDN to learn how to use Profile Properties that are set up in the web.config file for an ASP.Net/C# project. Here is the link to the MSDN page:MSDN Profile Properties walkthrough I followed the C# steps on this page for the first simple project up to "To test the PostalCode property". I am getting the error below when I run/debug. I am using Visual Studio. I also have SQL Server. I copied/pasted the code. I am getting a server error listed at the end of this post. If I am reading the MS web page correctly, the first simple example uses the anonymousIdentification element. So, no login is necessary I set up this simple project in a new page within an existing project that has a database. I can see the Profile table in SQL Server. But, the app just can't seem to get to it. Is there something else I need to get profiles to work involving the database? -- error listing: -- System.Web.HttpException was unhandled by user codeMessage="Unable to connect to SQL Server database."Source="System.Web" ErrorCode=-2147467259 StackTrace: at System.Web.DataAccess.SqlConnectionHelper.CreateMdfFile(String fullFileName, String dataDir, String connectionString) at System.Web.DataAccess.SqlConnectionHelper.EnsureSqlExpressDBFile(String connectionString) at System.Web.DataAccess.SqlConnectionHelper.GetConnection(String connectionString, Boolean revertImpersonation) at System.Web.Profile.SqlProfileProvider.GetPropertyValuesFromDatabase(String userName, SettingsPropertyValueCollection svc) at System.Web.Profile.SqlProfileProvider.GetPropertyValues(SettingsContext sc, SettingsPropertyCollection properties) at System.Configuration.SettingsBase.GetPropertiesFromProvider(SettingsProvider provider) at System.Configuration.SettingsBase.GetPropertyValueByName(String propertyName) at System.Configuration.SettingsBase.get_Item(String propertyName) at System.Web.Profile.ProfileBase.GetInternal(String propertyName) at System.Web.Profile.ProfileBase.get_Item(String propertyName) at System.Web.Profile.ProfileBase.GetPropertyValue(String propertyName) at ProfileCommon.get_PostalCode() in c:\Users\amredstart\AppData\Local\Temp\Temporary ASP.NET Files\website1\839131dc\b553a82a\App_Code.ocx-hpma.0.cs:line 21 at _Default.Page_Load(Object sender, EventArgs e) in c:\Users\amredstart\Documents\Visual Studio 2005\Projects\WebSite1\CustomerProfiles.aspx.cs:line 16 at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) at System.Web.UI.Control.OnLoad(EventArgs e) at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
  2. Thank you for the replies and for the MSDN reference. I will read more. K
  3. I am going through a book on C# and ASP.Net.I ran across a statement that I don't quite understand.The book does not explain it.From the context I am assuming that it is an "if" statement. Here it is: shippingRegion = (profile.ShippingRegion == null || profile.ShippingRegion == "" ? "1" : profile.ShippingRegion); Here is the code around it: ProfileCommon profile = HttpContext.Current.Profile as ProfileCommon; address1 = profile.Address1; address2 = profile.Address2; city = profile.City; region = profile.Region; postalCode = profile.PostalCode; country = profile.Country;> shippingRegion = (profile.ShippingRegion == null || profile.ShippingRegion == "" ? "1" : profile.ShippingRegion); dayPhone = profile.DayPhone; evePhone = profile.EvePhone; mobPhone = profile.MobPhone; email = Membership.GetUser(profile.UserName).Email; If I need to add more explanation or code, please let me know. Thanks. K
  4. Yes! PasteBin! Thank you, boen robot! niche: I will look more closely at jsfiddle. It looked interesting. K.
  5. I seem to remember a website out there that allowed you to post a block of programming code. After you saved it you were given a link to give to others so they could get to your posted code. You didn't have to have an account or login, which meant the only way to find your post(s) were to keep the link(s). Does this sound familiar to anyone? K
  6. Thanks, Mr. Robot.I appreciate the first answer, and also the eighth where I can find more information.K_Drive
  7. I have an XML file with a list of books. The first part of the XML file with one record is at the end of this message.One element in the XML file contains the value that is the name of a bitmap file image. For example: <ImgName>Decade_Of_The_Wolf.bmp</ImageName> I am trying to use this value to display the image on an XSLT-generatred webpage.I am trying to generate the following HTML code in order to display the images when I display the list of books: <img src="Book_Images/Decade_Of_The_Wolf.bmp" /> My first attempt was to do this: <xsl:text><</xsl:text> <xsl:text>img src="Book_Images/</xsl:text><xsl:value-of select="ImgName" /><xsl:text>" /</xsl:text><xsl:text>></xsl:text> My second attempt was to do this: <xsl:value-of select="concat('<', 'img src=', '"', 'Book_Images/')" /><xsl:value-of select="ImgName" /><xsl:value-of select="concat('"', ' ', '/>')" /> Both of these attempts resulted in the correct HTML text for an <img> element appearing on the web page, but the images were not displayed. See the example just below.This is what was displayed on the web page for one of the books: <img src="Book_Images/Decade_Of_The_Wolf.bmp" /> The correct filenames for each book was retreived properly.The XML element name, "ImgName", is correct.The path to the Book_Image directory is correct.The image name is correct.How can I generate XSL code that will produce the <img> element that will display the images for each book in the XML file instead of just the HTML code as text?--------------------------------------------------------------------------------------------------------------------------------------------------Here is the first part of my XML file: <BookList> <Book> <Title PaperOrHard="Hardback">Decade Of The Wolf : Returning The Wild To Yellowstone</Title> <Author> <FirstName>Douglas</FirstName> <MiddleName>W.</MiddleName> <LastName>Smith</LastName> </Author> <Editor> <FirstName>John</FirstName> <MiddleName>Peter</MiddleName> <LastName>Ottoman</LastName> </Editor> <Publisher>Lyons Press</Publisher> <YearPublished>2005</YearPublished> <Edition>2nd</Edition> <NbrOfPages>212</NbrOfPages> <ImgName>Decade_Of_The_Wolf.bmp</ImgName> </Book>.........</BookList>
  8. Thank you for both replies.I will give them a try.I come from the old "<tables>" school of web pages. This CSS is new to me, but I like it a lot. More tools to use. I definitely like the separation of content and styling. It makes things more clear when I am building a page. It is just going to take some getting used to.K_Drive
  9. Hello.I am trying to work with text buttons. These are buttons that are created by using a background image with some text. I have been trying to simplyfy the code to create these buttons.Here is my website with some buttons:http://www.geocities.com/alcovespring/text_button.htmlAs you can immediately see, there is a gap between the middle and right end of the buttons.If I take out the text ("Link to Page 01") the gaps disappear.Any suggestions?K_Drivep.s.I made the page background black temporarily so that the gaps are easier to see.
  10. I am just learning XML. (I have read the XML tutorial. I am also reading the XSL tutorial.)I am setting up a new XML file with a list of books with their titles, authors, publishing company, etc.Some books have multiple authors or multiple editors.How do I set this up? What will be the consequences down the line of using different techniques?Basically, here is what I have: <book> <title>Learning XML</title> <author> <author_first_name>John</author_first_name> <author_last_name>Johnson</author_last_name> </author> <editor></editor> <year_published>2005</year_published> <publishing_company>Red River Publishing</publishing_company> <number_of_pages>450</number_of_pages> <edition>4th</edition></book> What happens when a book has multiple authors or editors?Is it better to to use: <book> <title>Learning XML</title> <author_01> <author_first_name>John</author_first_name> <author_last_name>Johnson</author_last_name> </author_01> <author_02> <author_first_name>Frank</author_first_name> <author_last_name>Ladder</author_last_name> </author_02> <editor></editor> <year_published>2005</year_published> <publishing_company>Red River Publishing</publishing_company> <number_of_pages>450</number_of_pages> <edition>4th</edition></book> Or is it better to do something like this: <author id="01"> <author_first_name>John</author_first_name> <author_last_name>Johnson</author_last_name> </author> <author id="02"> <author_first_name>Frank</author_first_name> <author_last_name>Ladder</author_last_name> </author> And, do I need to change the <author_first_name> and <author_last_name> as well?I eventually plan to try to display this XML file on a web page using an XSL file.
×
×
  • Create New...