SQL Server + Visual Studio for ASP.NET Core on Mac (M1/Intel) - Updated for 2022 - Detailed Demo

Поділитися
Вставка
  • Опубліковано 9 лис 2024

КОМЕНТАРІ • 142

  • @tom-summerfield
    @tom-summerfield 2 роки тому +1

    You are literally a life saver! Thanks from the UK!!!

    • @rungxanh2901
      @rungxanh2901  2 роки тому

      Thank you Tom! I intended to keep this tutorial for myself initially haha, I'm happy I did otherwise

    • @rungxanh2901
      @rungxanh2901  2 роки тому

      Also to answer your original question, the source code is available on Murach’s website for ASP.NET CORE MVC, under the Free downloads tab

  • @nadiaochikh3304
    @nadiaochikh3304 2 роки тому +3

    when i updated my database i got this error:
    A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: TCP Provider, error: 35 - An internal exception was caught)
    how i can fix that pleaaase, help me.

  • @alessonjuley
    @alessonjuley 2 роки тому +1

    Thank you, Joe! This is very helpful.
    I'm pretty new to ASP.NET Core and I'm learning it right now in my school. We're learning the code-first approach for MVC pattern. How do I make a db from scratch using Visual Studio 2022 in macOS? In your video, I know you already have one, but what if I want to start coding my models and DbContext first and then creating a db for that in my localhost?

    • @rungxanh2901
      @rungxanh2901  2 роки тому +1

      Hi Alesson, thank you!
      In this case, make sure you have EFCore CLI installed on your Mac. Then check out this post from Microsoft themselves, to add an initial for your code-first approach:
      docs.microsoft.com/en-us/ef/core/managing-schemas/migrations/?tabs=dotnet-core-cli

  • @ryanoh1816
    @ryanoh1816 Рік тому +1

    Thank you so much. You have solved my issue :D

  • @yasielbarroso
    @yasielbarroso 2 роки тому

    I have an M1 MacBook Air and it works for me. Thank you

    • @rungxanh2901
      @rungxanh2901  2 роки тому

      I'm using the very same model 😄

    • @jerrycaleb8035
      @jerrycaleb8035 2 роки тому

      Hey, I am facing Connection string keyword 'server' is not supported.
      Did you also face the same?

  • @elhistoriadoraguila1493
    @elhistoriadoraguila1493 Рік тому

    Hello bro I am from the video of jet brains, I got confused, I was watching the jetbrains tutorial when I need to make the connection with visual studio 😂
    I am using a proyect Created on Mac, do I need to change it to a Windows one?

  • @piotrpalacz3387
    @piotrpalacz3387 2 роки тому +1

    Hey thank you for this tutorial! In case you run your SQL server in a Virtual Machine there is a chance the connection is refused because of The certificate chain was issued by an authority that is not trusted. You can solve this problem by adding Encrypt=False; to your connection string.

    • @rungxanh2901
      @rungxanh2901  2 роки тому +1

      Thank you! Yeah there's always new things to learn from 🤝

  • @noorsaid2259
    @noorsaid2259 2 роки тому

    so beautiful i can cry.... thank you 🙏🏻

    • @rungxanh2901
      @rungxanh2901  2 роки тому

      Great to hear it is helpful to you Noor!

  • @mrmone5068
    @mrmone5068 2 роки тому

    Very good video.
    Do you have like a step by step of creating the models views and controller code for this project?

    • @rungxanh2901
      @rungxanh2901  2 роки тому

      Thank you! I don’t, but there are already other resources that would help you with your question.
      My intention with this tutorial is only to help fix the very issue of no SQL Server support on macOS 😄

  • @orick08
    @orick08 2 роки тому +1

    Thank you so much, is very useful any information related with the difference of configurations between windows and mac

    • @rungxanh2901
      @rungxanh2901  2 роки тому

      Definitely, thank you for your appreciation ♥

  • @themodernwaiter8455
    @themodernwaiter8455 2 роки тому

    Thank you for this tutorial Joe

  • @hasanmougharbel8030
    @hasanmougharbel8030 2 роки тому

    Hey there,keep up the great work in your channel.
    I have only a general enquiry as a newbie sql learner.
    Could i channel shopify live data into an sql application?(This should be an application developed for a company of 50 employees mainly for the sake of generating reports and analytics))
    Is this an easy process to undertake as a sql beginner? What should i keep in mind
    and what are the tools or softwares that i should work with right from the beginning.
    For notice, I made my mind to work with microsoft sql server, also our company has a dedicated server.
    Thanks for taking care of my enquiry

    • @rungxanh2901
      @rungxanh2901  2 роки тому +1

      Hi Hasan, thank you for the kind words! 🫡
      Unfortunately I don't think I have an informed answer for you 😅

  • @violin15895
    @violin15895 2 роки тому

    Omg god thank you so much you literally saved me! I owe you one.

  • @leomessi1100
    @leomessi1100 2 роки тому

    Thank you for the great tutorial

    • @rungxanh2901
      @rungxanh2901  2 роки тому

      I got your back man! Really appreciate your view 🙏🏻

  • @kelumkp
    @kelumkp 2 роки тому

    kudos! nice and smooth :)

  • @andreanomorango
    @andreanomorango 2 роки тому

    thanks for your video, only if you can. and dare, will a tutorial with identity scafolding be possible

    • @rungxanh2901
      @rungxanh2901  2 роки тому

      Thank you Andrés. That’s a possibility 😄 I’m still learning ASP.NET Core at the moment haha 🙂

  • @robertonoguera7076
    @robertonoguera7076 2 роки тому

    you are a TITAN! thank you

  • @abdullahkaraylan7042
    @abdullahkaraylan7042 2 роки тому +2

    I have a imac m1 24 inch(2021), Can i develop win apps on my mac? IS there any way?

    • @rungxanh2901
      @rungxanh2901  2 роки тому +1

      Easiest way I see is to run Windows on a VM. Otherwise, it’s a “depends” answer 😅

    • @danbarry3678
      @danbarry3678 2 роки тому

      @@rungxanh2901 What's the best way to run Windows on a VM? I see several options, but I am not sure which way to go.

    • @rungxanh2901
      @rungxanh2901  2 роки тому

      @@danbarry3678 I don't know the best way, it depends on your needs. I only know good options are using Parallels, VMWare, or Virtual Box. You can try out and see for yourself Dan! Good luck! 👍

  • @ozhonourkorkmaz261
    @ozhonourkorkmaz261 2 роки тому

    He is the best !

    • @rungxanh2901
      @rungxanh2901  2 роки тому +1

      Thank you, great to know my little tip helped!

  • @arturobacs7742
    @arturobacs7742 2 роки тому

    I love you... thanks a lot. would you make a tutorial about power bi?

    • @rungxanh2901
      @rungxanh2901  2 роки тому

      Haha thanks! What's power bi?

    • @arturobacs7742
      @arturobacs7742 2 роки тому

      @@rungxanh2901 power bi desktop on mac m1

    • @rungxanh2901
      @rungxanh2901  2 роки тому +1

      I don’t have an idea what PowerBI is, but if I managed to understand it, I’d definitely make a tutorial 😄

  • @CikaVuksan
    @CikaVuksan 2 роки тому

    Man you are awesome. I just have one question. When I try to do 'dotnet ef database update', I got this error:
    Could not execute because the specified command or file was not found.
    Possible reasons for this include:
    * You misspelled a built-in dotnet command.
    * You intended to execute a .NET program, but dotnet-ef does not exist.
    * You intended to run a global tool, but a dotnet-prefixed executable with this name could not be found on the PATH.
    Do you know or someone what is the problem actually? Thank you to all!

    • @rungxanh2901
      @rungxanh2901  2 роки тому

      I’m clueless, but are you executing the command at your project folder or solution folder? Sometimes that matters

    • @CikaVuksan
      @CikaVuksan 2 роки тому

      @@rungxanh2901 Hello bro. No no, not solution folder. I was trying with project folder.

  • @manavshah6929
    @manavshah6929 2 роки тому

    Thankyou so much for the video man, you are a saviour, just one question do we need SSMS for M1 chip to manage? I'm new to both mac and DotNet so I dont know, if anyone know please help me.

    • @rungxanh2901
      @rungxanh2901  2 роки тому +1

      Sorry what is SSMS?
      Correction: Okay I think you can see by asking what SSMS is, it means I probably didn't know what it is, didn't install it and still, this solution works on my M1. Hence I guess the docker image of `azure-sql-edge` is enough (given your architecture is M1). Plus, when I download SSMS, I only can download the .exe installer 🤷🏻‍♂️
      In case you really wanna manage and manipulate your database, hopefully Azure Data Studio is enough, though as of this moment is not M1 native

    • @rungxanh2901
      @rungxanh2901  2 роки тому +1

      I answered in the comment above 👍🏻

    • @manavshah6929
      @manavshah6929 2 роки тому

      @@rungxanh2901 thankyou so much 🙌🏻

    • @rungxanh2901
      @rungxanh2901  2 роки тому +1

      Good luck 👌🏻

  • @moshikof7778
    @moshikof7778 2 роки тому +1

    so in order to connect to a sql container on mac (i have m1 mac mini),
    in connection string, when "server", i need to simply write "localhost" ?

    • @rungxanh2901
      @rungxanh2901  2 роки тому +1

      Yes, and remember to have docker and the container on running mode too 👍🏻

    • @moshikof7778
      @moshikof7778 2 роки тому

      @@rungxanh2901 thanks, that was the part i couldnt figure it out

    • @rungxanh2901
      @rungxanh2901  2 роки тому +1

      @@moshikof7778 No problem. I reminded it at 7:27

  • @MrVietvan123
    @MrVietvan123 Рік тому

    Lỡ mua mac rồi muốn học .net phải mua máy windows lại à a :(

    • @rungxanh2901
      @rungxanh2901  Рік тому

      Hoặc em dùng máy ảo Windows để chạy Visual Studio, hoặc em chạy Docker image như trong clip tutorial. Dùng Mac lợi đôi đường chứ, sao lại "lỡ" 😂

  • @theo3018
    @theo3018 2 роки тому

    Ngoài azure-sql-edge, còn cách nào khác ko bạn? Mình cần cài SQL Server cho con M1 nhưng mà azure-sql-edge thì thiếu nhiều features mình cần cho project của mình quá.
    Mình có paid version of Parallel (windows 11) if that helps.

    • @rungxanh2901
      @rungxanh2901  2 роки тому

      Cá nhân mình chỉ biết cách này nên share cho mọi người thôi bạn. Nếu project cần tính năng đặc thù thì chắc dùng Windows 11 luôn cho nhanh chóng

  • @elizabetalazova6625
    @elizabetalazova6625 2 роки тому

    Which form should I use If I create new project?

    • @rungxanh2901
      @rungxanh2901  2 роки тому

      Depends on your intention, but for an ASP.NET Core project, it's usually "ASP.NET Core (Model-View-Controller)"

    • @elizabetalazova6625
      @elizabetalazova6625 2 роки тому

      @@rungxanh2901 Thank you so much.Your videos are the best

  • @moshikof7778
    @moshikof7778 2 роки тому

    can you please tell what NuGet packages did you used in visual studio in order to connect to sql edge from dotnet ?

    • @rungxanh2901
      @rungxanh2901  2 роки тому +1

      It depends on your project, but here are the common ones I see in Murach's sample projects:
      Microsoft.EntityFrameworkCore.Design
      Microsoft.EntityFrameworkCore.SqlServer
      Microsoft.EntityFrameworkCore.Tools
      Microsoft.VisualStudio.Web.CodeGeneration.Design

    • @moshikof7778
      @moshikof7778 2 роки тому

      @@rungxanh2901 thanks, any chance you can direct me to the docs you've used to figure it out ?

    • @rungxanh2901
      @rungxanh2901  2 роки тому

      @@moshikof7778 The source code is available on Murach’s website for ASP.NET CORE MVC, under the Free downloads tab. You can download the Windows version of it, so that projects use SQL Server instead of SQLite.
      For an easier access, here's one from my Google Drive: tinyurl.com/bdz2t3j7

    • @moshikof7778
      @moshikof7778 2 роки тому

      @@rungxanh2901 thanks, but i need guides for visual studio and sql edge for mac, i was confused because there not a lot of guides specificly for mac m1's

    • @rungxanh2901
      @rungxanh2901  2 роки тому

      Which part specifically that you need help with? I think I answered your question about NuGet already no?

  • @lebaransbntarlagi2854
    @lebaransbntarlagi2854 2 роки тому

    when i start the template web with mvc, but why there isn't migration folder, startup.cs file ??

    • @rungxanh2901
      @rungxanh2901  2 роки тому

      1. You gotta configure your database context and add migrations yourself. That’s something beyond the scope of this video.
      2. Dotnet 6.0 moved away from having a Startup.cs file. Program.cs takes over

  • @curly_mess
    @curly_mess 2 роки тому

    "ConnectionStrings": {
    "DefaultConnection": "DataSource=app.db;Cache=Shared"
    }
    this is in my appsettings.json , where should i put the new connection string then? replacing this?

  • @samynathan3449
    @samynathan3449 2 роки тому

    If you can share the project file along with this , it may be very helpful.

    • @rungxanh2901
      @rungxanh2901  2 роки тому +1

      The source code is available on Murach’s website for ASP.NET CORE MVC, under the Free downloads tab. You can download the Windows version of it, so that projects use SQL Server instead of SQLite

    • @ahsanhabibswassow8407
      @ahsanhabibswassow8407 2 роки тому

      @@rungxanh2901 I couldn't find it can you please provide the download link?

    • @rungxanh2901
      @rungxanh2901  2 роки тому

      You can try this: tinyurl.com/bdz2t3j7

    • @devmn2583
      @devmn2583 Рік тому

      @@rungxanh2901 Hey, thanks for this sharing. At this time, I can't access this link so can you provide another download link please? Have a good day you guys!

  • @coco5843
    @coco5843 2 роки тому

    You are the best

  • @abdessamadbouaicha3286
    @abdessamadbouaicha3286 2 роки тому

    Can I install SQL Server on a Windows 11 on a VM on parallels on a MacBook Air with intel i5? Thanks 🙏

    • @rungxanh2901
      @rungxanh2901  2 роки тому +1

      You can do that of course. Running Windows as a VM on Parallels, with Visual Studio + SQL Server built-in. Just keep in mind the overall performance might take a huge hit

    • @abdessamadbouaicha3286
      @abdessamadbouaicha3286 2 роки тому

      @@rungxanh2901 thanks

  • @callmesenny5148
    @callmesenny5148 2 роки тому

    thank you

  • @JMaldonad0
    @JMaldonad0 2 роки тому

    can I run MS SQL 2017 on M1?
    one more..
    if I upload a 2017 backup to azure SQL edge, will the database be migrated?

    • @rungxanh2901
      @rungxanh2901  2 роки тому +1

      Hi Juan, fair question but I don’t have the knowledge to answer it 😅

    • @JMaldonad0
      @JMaldonad0 2 роки тому +1

      @@rungxanh2901 tks man

  • @RickyLloren
    @RickyLloren 2 роки тому

    where can I download the textbook? @6:33

    • @rungxanh2901
      @rungxanh2901  2 роки тому

      I can only send you the link to the book.
      www.murach.com/shop/murach-s-asp-net-core-mvc-detail

  • @elhistoriadoraguila1493
    @elhistoriadoraguila1493 Рік тому

    hello, how can I create the windows version of de code like the version you opened in the minute 6:40

    • @rungxanh2901
      @rungxanh2901  Рік тому +1

      You can go to Murach's website, search for "ASP.NET Core" book. Under their "Downloads" tab, there's link to download Windows/Mac versions of their source codes

    • @elhistoriadoraguila1493
      @elhistoriadoraguila1493 Рік тому

      @@rungxanh2901 thanks you bro

  • @elhistoriadoraguila1493
    @elhistoriadoraguila1493 Рік тому

    what can I do If I don't have the folder "Migrations"

    • @rungxanh2901
      @rungxanh2901  Рік тому +1

      Hi. Sorry this video is a tutorial for a workaround for SQL Server support on Mac, not a tutorial on ASP.NET Core migrations.
      I'm sure you can find plenty videos on that topic on UA-cam instead.

    • @elhistoriadoraguila1493
      @elhistoriadoraguila1493 Рік тому

      @@rungxanh2901 I was wondering because if I don't have them, can I continue with the tutorial?

  • @AL-bt1px
    @AL-bt1px 2 роки тому

    I get this when I in the step 5 with Intel Mac 🤔
    docker: invalid reference format: repository name must be lowercase.
    Do you have any idea how to solve this?

    • @rungxanh2901
      @rungxanh2901  2 роки тому

      Yes the error is quite self-explanatory. I guess you can double check the part after "docker run -d -name" command, where the name is, is lowercase or not?
      If not then make it lowercase

    • @AL-bt1px
      @AL-bt1px 2 роки тому

      @@rungxanh2901 I have it on lowercase all the times I tried 🙄

    • @rungxanh2901
      @rungxanh2901  2 роки тому

      Would you mind leaving a link to your screenshot of the Terminal app on that error, with the command too?

    • @AL-bt1px
      @AL-bt1px 2 роки тому

      ​@@rungxanh2901 Every time I try to share you a screenshot, my comment disappears.

    • @fridayalways3434
      @fridayalways3434 2 роки тому +2

      @@AL-bt1px & anyone else with this issue try:
      docker run -d --name ms-sql-server -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=newPASSWORD123$' -p 1433:1433 mcr.microsoft.com/mssql/server:2022-latest
      Note the extra -e to separate --name from 'ACCEPT . . .' and change in the image location(?) to match the necessary pull command as well (I.e. docker pull mcr.microsoft.com/mssql/server:2022-latest )

  • @jerrycaleb8035
    @jerrycaleb8035 2 роки тому

    Hey,
    I tried to change in appsettings.json. Since my file is default one, I get default connection under connectionstrings. When I changed the default connection line in code to the one you provided, I get an error that Connection string keyword 'server; is not supported.

    • @rungxanh2901
      @rungxanh2901  2 роки тому

      Hey Jerry, does your connection string start with a 'Server' with a capital 'S' or lowercase 's'? That may be the case?

    • @jerrycaleb8035
      @jerrycaleb8035 2 роки тому

      @@rungxanh2901 This was my code
      "ConnectionStrings": {
      //"DefaultConnection": "DataSource=app.db;Cache=Shared",
      "DefaultConnection": "Server=localhost;Database=leavemanagementnet6;User=leavemanagement;Password=leavemanagement;"
      },

    • @jerrycaleb8035
      @jerrycaleb8035 2 роки тому

      @@rungxanh2901 Thanks. Sorry for the inconvenience
      I did not install botnet ef tools

    • @rungxanh2901
      @rungxanh2901  2 роки тому

      @@jerrycaleb8035 Sounds fair. Good that you found it out 🤝

    • @jerrycaleb8035
      @jerrycaleb8035 2 роки тому

      @@rungxanh2901 Hey, I am facing the same issue again. How can I share the code with you?

  • @pvz2462
    @pvz2462 2 роки тому +1

    Is it possible to download sQL in mac m1

    • @mrmone5068
      @mrmone5068 2 роки тому +2

      Yes, you have to run this on docker and use azure data studio to manage the database.

    • @Hamdi_films
      @Hamdi_films 2 роки тому

      @@mrmone5068 do you now how to insert my data base in visual studio after using azure data studio?

    • @mrmone5068
      @mrmone5068 2 роки тому

      @@Hamdi_films sadly that is not possible for mac atm you will have to use azure data studio to view your database tables

  • @bhargavbodipalli2433
    @bhargavbodipalli2433 2 роки тому

    hii , i am not getting migrations folder what should do?

    • @rungxanh2901
      @rungxanh2901  2 роки тому

      Then you can consider adding your first migration to the project, from the Terminal console.
      `dotnet ef migrations add `
      P/s: the current folder that the Terminal is pointing to should be in the solution folder
      More info here docs.microsoft.com/en-us/ef/core/cli/dotnet

    • @bhargavbodipalli2433
      @bhargavbodipalli2433 2 роки тому +1

      @@rungxanh2901 thank you :-)

    • @rungxanh2901
      @rungxanh2901  2 роки тому +1

      @@bhargavbodipalli2433 You're welcome, hopefully it helps 😊

  • @elizabetalazova6625
    @elizabetalazova6625 2 роки тому

    Can I do all this things in COnsole App?

    • @rungxanh2901
      @rungxanh2901  2 роки тому

      Can try and see for yourself. This video is just for tips getting SQL Server to work with an ASP.NET Core project

  • @truongngocvinhtu8066
    @truongngocvinhtu8066 2 роки тому

    mình add rồi nhung đến lúc sudo updata database nó báo là There is already an object named 'DanhMuc' in the database. bạn có khi nào gặp trường hợp này không. chỉ mình fix với mình có tìm nhiều mà chưa fix dc

    • @rungxanh2901
      @rungxanh2901  2 роки тому

      Chào bạn. Lỗi này mình cũng đã gặp, có hướng dẫn từ phút 13:00 đấy bằng cách tải Azure Data Studio và thực hiện tiếp theo tutorial.
      Một cách chữa nhanh bạn có thể thử là trong file appsettings.json, ở connectionString, bạn đổi tên database khác đi.
      Ví dụ: thay vì Server=localhost;Database=MyDatabase;User=sa;Password=Docker@123;
      => bạn chữa thành
      Server=localhost;Database=MyDB;User=sa;Password=Docker@123;
      Rồi chạy lại lệnh `dotnet ef database update` 👍🏻
      Chúc may mắn nhe

    • @truongngocvinhtu8066
      @truongngocvinhtu8066 2 роки тому +1

      cảm ơn bạn nhiều nhé👍

    • @rungxanh2901
      @rungxanh2901  2 роки тому +1

      Ko có chi Tú

  • @Aselelle
    @Aselelle 2 роки тому

    Hey
    How can i open webform in mac ?

    • @rungxanh2901
      @rungxanh2901  2 роки тому

      This I don’t know a solution yet, sorry!

  • @junjie4501
    @junjie4501 2 роки тому

    It says that connection string keyword 'server' is not supported. How can I solve it?

    • @rungxanh2901
      @rungxanh2901  2 роки тому +1

      I guess “server” wasn’t capitalized?

    • @ohirikennedy8072
      @ohirikennedy8072 2 роки тому

      @@rungxanh2901 I get the same error regardless

    • @rungxanh2901
      @rungxanh2901  2 роки тому

      Can you provide a link to screenshot with the error and your connection string?

    • @rungxanh2901
      @rungxanh2901  2 роки тому

      I'm no expert, but what I'm seeing in your connection string is a weird "*" for password. Try replacing that asterisk with another password that: 1. is the same with the password you used to initialize your Docker image, and 2. satisfies the mentioned password requirements.

    • @ohirikennedy8072
      @ohirikennedy8072 2 роки тому

      Fixed, my program.cs had UseSqllite instead of UseSqlServer

  • @mrmone5068
    @mrmone5068 2 роки тому

    Industry Connect?

    • @rungxanh2901
      @rungxanh2901  2 роки тому

      Sorry, I don’t get what you meant?

  • @simbeJob
    @simbeJob 2 роки тому

    Người Việt Nam giỏi thật

  • @CikaVuksan
    @CikaVuksan Рік тому

    Can you give us source code for DataContext ?

    • @rungxanh2901
      @rungxanh2901  Рік тому

      You can browse Murach Books' website, ASP.NET Core section to download the source code

  • @liamboyd4676
    @liamboyd4676 2 роки тому

    hi can you create a video on how to connect vs code to ms sql server on M1 Mac using python? seems like unixodbc is not fully supported for M1 yet, which is causing pyodbc not usable