webmatrix

How can I access a single XML element's value using C#.net web-pages with WebMatrix?

情到浓时终转凉″ 提交于 2019-12-04 23:51:05
问题 I've looked at a lot of resources, done a lot of research, and tried many "best-guesses" to access a single element at a time using WebMatrix with C#, web-pages, however nothing I am trying is getting through. Consider a simple xml document that looks like this: <root> <requisitionData> <element1>I am element 1</element1> <element2>I am element 2</element2> </requisitionData> </root> I know I can use a foreach loop, like so: @using System.Xml.Linq XDocument doc = XDocument.Load(Server.MapPath

should I use WebMatrix to build a real-world website?

和自甴很熟 提交于 2019-12-04 18:17:25
问题 I have gone through hundreds of articles and blog posts that saying WebMatrix is just for beginners and such. my question is, why shouldn't I use WebMatrix to create a real-world working website, like a light-weight Q&A website? we can create anything that is needed for a website, with this tool. so why not to use it? is there something that real websites need, that cannot get done by WebMatrix? it looks like it is ok to create a fully functional and strong website with this tool. but people

What to use to open an .mdf (SQL Database) file

夙愿已清 提交于 2019-12-04 17:35:42
问题 I was hoping to be able to open .mdf file. I am using WebMatrix, I can view the queries there. I can read the schema too. But how can I read the file without using WebMatrix. Its SQL Server file not the Comptact edition. I have searched for web help (Through windows). But all in vain. I will prefer any link or any method to read the basic queries. 回答1: .sdf is, in fact, a Compact Database file (unless you've changed the extension which would be problematic). SQL Server would be .mdf . SQL

Using Web Deploy (msdeploy) to publish a WebMatrix site

ε祈祈猫儿з 提交于 2019-12-04 14:59:52
I started building my site in WebMatrix and then switched to using VS2010 so I could have better Intellisense and debugging. I've been loading WebMatrix to deploy and it's been working fine. However, loading WebMatrix is a PITA and I actually want more flexibility over the web deployment process. So I started learning about msdeploy.exe and how to use it. I was able to successfully get the site to sync as I wanted with the following command line: msdeploy.exe -verb:sync -dest:iisApp=MySite,wmsvc=www.mysite.com,username=administrator,password=blahblahblah -allowUntrusted -skip:absolutePath

How do I connect to a SQL Server database using WebMatrix?

£可爱£侵袭症+ 提交于 2019-12-04 09:47:47
I added a connection and it shows up in "Other Connections" but I can't seem to reference it. var db = Database.Open("MyNewConnection"); throws an exception: Connection string 'MyNewConnection' was not found. Have you checked to make sure your connection string is correct in your web.config file? <?xml version="1.0" encoding="utf-8" ?> <configuration> <connectionStrings> <add name="MyNewConnection" connectionString= "server=myServer;database=myDatabase;uid=username;pwd=password" providerName="System.Data.SqlClient" /> </connectionStrings> </configuration> 来源: https://stackoverflow.com

how to Export wordpress database from web matrix

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-03 23:07:33
问题 I have WebMatrix version 1. I made a WordPress site and now it's time to publish it. From what I've read, the best option is to publish the site from web matrix using the web deploy option. But my hosting (godaddy) doesn't support this feature. So I have to upload my site via FTP. The problem is that I don't know how to export the databse from my webmatrix to my hosting. From reading some posts, I think the best option is to use phpMyAdmin, but I couldn't install it on my computer. Is that

How do you set the content type for a WebMatrix/Razor Response?

白昼怎懂夜的黑 提交于 2019-12-03 22:44:38
I'd like to return some XML instead of HTML in my WebMatrix cshtml file? How do you change the content type header? Use the Response.ContentType property at the top of your .cshtml file then include the XML in the content of the view: @{ Response.ContentType = "application/xml"; } <?xml version="1.0" encoding="UTF-8"?> <Response> <Dial>415-123-4567</Dial> </Response> At the top of your Razor file, set the ContentType of the Response object: @{ Response.ContentType = "application/xml"; } ... xml here ... If you are using ASP.NET MVC, you can choose to make the change in your action method in

Configure Webmatrix for Windows Users

不羁的心 提交于 2019-12-03 20:49:47
I create asp .net page and i have use windows user to authenticate. <authentication mode="Windows" /> I create simply page with one label and display information. if (Page.User.Identity.IsAuthenticated) { Label1.Text = "Authenticated = 'TRUE'<br/>"; Label1.Text = Page.User.Identity.Name; } else { Label1.Text = "Authenticated = 'FALSE'<br/>"; } I often get Authenticated = 'FALSE' How configure web.config and WebMatrix to take user from Windows? Probably you published your web site without changing authentication on the corresponding virtual directory of IIS. You should deactivate "Anonymous"

Razor C# - Get data from database

萝らか妹 提交于 2019-12-03 17:10:22
I am using WebMatrix, I have created a database and put a table with a few rows of data. I can connect to it and get the data with the WebGrid , but it only provides a way to output the data using a table. Here is my code for 'shows.cshtml': @{ var db = Database.Open("TVPort"); var shows_data = db.Query("SELECT * FROM shows"); var shows_grid = new WebGrid(source: shows_data); } What I would like to be able to do is enumerate through each row returned by the query, and do whatever I want with the value of each column. But the WebGrid only allows you to output the data in a table. I just started

How can I access a single XML element's value using C#.net web-pages with WebMatrix?

一曲冷凌霜 提交于 2019-12-03 15:24:53
I've looked at a lot of resources, done a lot of research, and tried many "best-guesses" to access a single element at a time using WebMatrix with C#, web-pages, however nothing I am trying is getting through. Consider a simple xml document that looks like this: <root> <requisitionData> <element1>I am element 1</element1> <element2>I am element 2</element2> </requisitionData> </root> I know I can use a foreach loop, like so: @using System.Xml.Linq XDocument doc = XDocument.Load(Server.MapPath("~/User_Saves/cradebaugh/testFile.xml")); foreach (XElement element in doc.Descendants(