Click here to Skip to main content
15,891,136 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionSingle quote character in query string causes SQL injection Pin
Stephen Holdorf8-Jul-15 11:07
Stephen Holdorf8-Jul-15 11:07 
AnswerRe: Single quote character in query string causes SQL injection Pin
Paulo Zemek8-Jul-15 12:08
mvaPaulo Zemek8-Jul-15 12:08 
AnswerRe: Single quote character in query string causes SQL injection Pin
Richard Deeming9-Jul-15 1:54
mveRichard Deeming9-Jul-15 1:54 
QuestionMVC Role users error instance Pin
DPaul19948-Jul-15 8:39
DPaul19948-Jul-15 8:39 
AnswerRe: MVC Role users error instance Pin
Herman<T>.Instance13-Jul-15 0:18
Herman<T>.Instance13-Jul-15 0:18 
QuestionConnection to vpn using .bat file Pin
vineet13047-Jul-15 7:58
vineet13047-Jul-15 7:58 
AnswerRe: Connection to vpn using .bat file Pin
ZurdoDev7-Jul-15 8:02
professionalZurdoDev7-Jul-15 8:02 
QuestionUsing Entity Framework on a Web Forms Website Pin
jkirkerx6-Jul-15 6:23
professionaljkirkerx6-Jul-15 6:23 
I have a Webforms WebApp, and I'm toying with the idea of switching to Entity Framework 6.0 on it.
My idea is to create a dataAccessLayer.dll.
So I decided to spend a day testing the idea, and I'm not sure if I should create a edmx file, or if I'll suppose to hard code using models in a class.
I did import or create a edmx file, but creating the relationships is vague to me, and can't seem to find a decent lesson on it.
I created a couple class files, but the examples I used seem vague as well. This is what the Contoso University Example used in VB.

Example of one of my class files
Imports System.Data.Entity
Imports System.Collections.Generic
Imports System.ComponentModel.DataAnnotations
Imports System.Data.Entity.Infrastructure

Namespace Models

    Public Class Customer_Accounts

        Public Property ID As Integer
        Public Property Advanced As Boolean
        Public Property AccountName As String
        Public Property FirstName As String
        Public Property LastName As String
        Public Property EmailAddress As String
        Public Property Password As Byte
        Public Property PasswordSalt As Byte
        Public Property PhraseHint As String
        Public Property PhraseAnwser As String
        Public Property DateOpened As DateTime
        Public Property Lockout As Boolean
        Public Property LastLogin As DateTime
        Public Property IPAddress As String

    End Class

End Namespace

I did a job a couple of months ago in c#, and this guy made his class like this, I can see how this can create the tables in the database.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity;
using System.Linq;
using DataAccessLibrary.Models;

namespace DataAccessLayer.Models
{
    /// <summary>
    /// Class Customer.
    /// </summary>
    public class Customer : EntityBase, IValidatableObject
    {
        #region Public Constructors

        /// <summary>
        /// </summary>
        public Customer()
        {
            SalesOrders = new ObservableListSource<SalesOrderHeader>();
            Addresses = new ObservableListSource<CustomerAddress>();
        }

        #endregion Public Constructors

        #region Public Properties

        /// <summary>
        /// Gets or sets the addresses.
        /// </summary>
        /// <value>The addresses.</value>
        [Description("List of addresses for this customer")]
        public virtual ObservableListSource<CustomerAddress> Addresses { get; set; }

        /// <summary>
        /// Gets or sets the name of the business.
        /// </summary>
        /// <value>The name of the business.</value>
        [Description("This customer's business name.")]
        [DisplayName("Business Name")]
        [StringLength(45)]
        [Index(IsUnique = true)]
        public string BusinessName { get; set; }

I can't see how a table can be created from this class.

Im just looking for some suggestions on how you would do this, or if it even can be done.
QuestionSingle Page Application based on .NET Pin
Ishwor Khanal3-Jul-15 17:05
Ishwor Khanal3-Jul-15 17:05 
AnswerRe: Single Page Application based on .NET Pin
Abhinav S7-Jul-15 16:46
Abhinav S7-Jul-15 16:46 
QuestionXmlTextWriter.Create(MemoryStream, xmlSettings) Pin
jkirkerx3-Jul-15 9:32
professionaljkirkerx3-Jul-15 9:32 
QuestionThe message could not be sent to the SMTP server. The transport error code was 0x80040217. The server response was not available Pin
Kushal Gupta2-Jul-15 22:12
Kushal Gupta2-Jul-15 22:12 
AnswerRe: The message could not be sent to the SMTP server. The transport error code was 0x80040217. The server response was not available Pin
Abhinav S2-Jul-15 22:54
Abhinav S2-Jul-15 22:54 
Questiondisplay day name of selected date Pin
Praveen Kandari2-Jul-15 21:36
Praveen Kandari2-Jul-15 21:36 
AnswerRe: display day name of selected date Pin
Abhinav S2-Jul-15 22:52
Abhinav S2-Jul-15 22:52 
GeneralRe: display day name of selected date Pin
Praveen Kandari2-Jul-15 23:39
Praveen Kandari2-Jul-15 23:39 
QuestionASP.NET MVC4 / WebAPI OAuth - DotNetOpenAuth Pin
Jammer30-Jun-15 4:11
Jammer30-Jun-15 4:11 
QuestionCan any one help me to post content on linked in asp.net? Pin
Raghavendra.Kodimala29-Jun-15 21:19
professionalRaghavendra.Kodimala29-Jun-15 21:19 
AnswerRe: Can any one help me to post content on linked in asp.net? Pin
deepankarbhatnagar6-Jul-15 1:10
professionaldeepankarbhatnagar6-Jul-15 1:10 
QuestionCode or a network stack control to change the network gateway inside my app Pin
Michael Clinton29-Jun-15 12:14
Michael Clinton29-Jun-15 12:14 
QuestionFormat Excel Row Height Pin
Hellfire123128-Jun-15 17:54
Hellfire123128-Jun-15 17:54 
AnswerRe: Format Excel Row Height Pin
Herman<T>.Instance13-Jul-15 0:23
Herman<T>.Instance13-Jul-15 0:23 
Question.Net Pin
PRAKAS PANDEY28-Jun-15 1:14
PRAKAS PANDEY28-Jun-15 1:14 
AnswerRe: .Net Pin
Sascha Lefèvre28-Jun-15 1:22
professionalSascha Lefèvre28-Jun-15 1:22 
AnswerRe: .Net Pin
Seema Saraswat29-Jun-15 23:32
professionalSeema Saraswat29-Jun-15 23:32 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.