Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Entity Framework Core 6 VARCHAR(MAX)

Entity Framework Core 6 VARCHAR(MAX)

Scheduled Pinned Locked Moved Database
questionasp-netdatabasehelp
4 Posts 3 Posters 15 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    Kevin Marois
    wrote on last edited by
    #1

    Using EF Core 6 Code First. I'm trying to create a Notes field.

    entity.Property(e => e.Notes)
    .HasColumnName("Notes")
    .HasColumnType("varchar");

    This becomes varchar(1) in the DB. How do I create a column with varchar(max)?

    If it's not broken, fix it until it is. Everything makes sense in someone's mind. Ya can't fix stupid.

    V 1 Reply Last reply
    0
    • K Kevin Marois

      Using EF Core 6 Code First. I'm trying to create a Notes field.

      entity.Property(e => e.Notes)
      .HasColumnName("Notes")
      .HasColumnType("varchar");

      This becomes varchar(1) in the DB. How do I create a column with varchar(max)?

      If it's not broken, fix it until it is. Everything makes sense in someone's mind. Ya can't fix stupid.

      V Offline
      V Offline
      Victor Nijegorodov
      wrote on last edited by
      #2

      See [https://stackoverflow.com/questions/24224442/what-is-the-proper-usage-of-hascolumntype-and-database-generated\](https://stackoverflow.com/questions/24224442/what-is-the-proper-usage-of-hascolumntype-and-database-generated)

      K 1 Reply Last reply
      0
      • V Victor Nijegorodov

        See [https://stackoverflow.com/questions/24224442/what-is-the-proper-usage-of-hascolumntype-and-database-generated\](https://stackoverflow.com/questions/24224442/what-is-the-proper-usage-of-hascolumntype-and-database-generated)

        K Offline
        K Offline
        Kevin Marois
        wrote on last edited by
        #3

        Your post did not answer the question

        If it's not broken, fix it until it is. Everything makes sense in someone's mind. Ya can't fix stupid.

        J 1 Reply Last reply
        0
        • K Kevin Marois

          Your post did not answer the question

          If it's not broken, fix it until it is. Everything makes sense in someone's mind. Ya can't fix stupid.

          J Offline
          J Offline
          jschell
          wrote on last edited by
          #4

          When I look at the posted link it certainly looks to me like it provides an answer to the question asked. So perhaps you might want to explain how that does not answer your question.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups