Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Cannot connect to database when webgl project builded

Discussion in 'Multiplayer' started by batuhanaslanturk28, Nov 19, 2020.

  1. batuhanaslanturk28

    batuhanaslanturk28

    Joined:
    Jan 27, 2019
    Posts:
    15
    hello guys,i cannot connect to sqlserver when i build to project.
    While in unity editor i can connect but when i upload my project to website cannot connect to database. Sorry for my bad English. Thanks.
    Here is the steps;
    baglanti = connect
    error2.png
    Freeze here and wait for 3-4 minutes and then get out of memory error. But when i delete connection.open() code, its working. error.png

    error3.png
     
  2. batuhanaslanturk28

    batuhanaslanturk28

    Joined:
    Jan 27, 2019
    Posts:
    15
  3. luke-unity

    luke-unity

    Unity Technologies

    Joined:
    Sep 30, 2020
    Posts:
    306
    You cannot use standard c# sockets in WebGL builds. (SqlConnection uses them). One way of accessing a database via WebGL would be to run a webserver as an API interface for the database and access it over UnityWebRequests.
     
  4. batuhanaslanturk28

    batuhanaslanturk28

    Joined:
    Jan 27, 2019
    Posts:
    15
    can i Do it for MSSQL Server ?