当前位置:网站首页>Unity connect to Microsoft SQLSERVER database
Unity connect to Microsoft SQLSERVER database
2022-06-12 11:21:00 【Game programming】
1. To configure Unity Environmental Science
- Unity Editor Set up Unity Frame compatibility to 4.X In the editor , You need to open the player settings ( file -> Build settings -> Player settings ). then , Under other settings , You can find the runtime and API Level

2. add to ddl
Unity Find the required... In the installation path ddl, Copy to project's Assets Under the folder D:\unity\2020.3.8f1c1\Editor\Data\MonoBleedingEdge\lib\mono\4.7-api

Copy to the project folder

2. Connection database scripting
- quote using System.Data.SqlClient; Namespace
- Write a script
void Start() { SqlConnectionStringBuilder builder = new SqlConnectionStringBuilder(); builder.DataSource = "localhost"; // update me builder.UserID = "sa"; // update me builder.Password = "123456"; // update me builder.InitialCatalog = "db_example"; string res = ""; try { using (SqlConnection connection = new SqlConnection(builder.ConnectionString)) { connection.Open(); // READ demo string sqlStr = "select * FROM [db_example].[dbo].[tb_user];"; using (SqlCommand command = new SqlCommand(sqlStr, connection)) { using (SqlDataReader reader = command.ExecuteReader()) { while (reader.Read()) { res = reader.GetInt32(0).ToString(); } } } } } catch (SqlException e) { Debug.Log(e.ToString()); } Debug.Log(res); }3. Configuration database
- Database security configuration allows remote connection with user name and password
Login status settings
Database services TCP/IP Service is open
restart SQLSERVER service
author :alwaysOnCoding
Game programming , A game development favorite ~
If the picture is not displayed for a long time , Please use Chrome Kernel browser .
边栏推荐
- PHP Apple internal purchase callback processing
- Using stairs function in MATLAB
- PHP specifies the number of people to distribute the specified amount equally at random (scaling method)
- K59. Chapter 2 installing kubernetes V1.23 based on binary packages -- cluster deployment
- Why check the @nonnull annotation at run time- Why @Nonnull annotation checked at runtime?
- FPGA-按键实验
- (37) How bee uses different data source instances at the same time
- M-arch (fanwai 12) gd32l233 evaluation -cau encryption and decryption (tease Xiaobian)
- Handwritten common interview questions
- 模块8作业
猜你喜欢

k52.第一章 基于kubeadm安装kubernetes v1.22 -- 集群部署

^33 variable promotion and function promotion interview questions

分布式存储探索

Mcuxpresso develops NXP rt1060 (3) -- porting lvgl to NXP rt1060

How to upload the video on the computer to the mobile phone without network

M-Arch(番外12)GD32L233评测-CAU加解密(捉弄下小编)

Malicious code analysis practice - lab03-02 DLL analysis

基于QT的旅行查询与模拟系统

M-Arch(番外10)GD32L233评测-SPI驱动DS1302

Index query efficiency of MySQL
随机推荐
How the ArrayList collection implements ascending and descending order
^34 scope interview questions
FPGA-按键实验
Grid layout
MYSQL——内置函数
【clickhouse专栏】基础数据类型说明
AcWing 1921. Rearranging cows (ring diagram)
读mysql45讲-自我总结(部分)
go基于阿里云实现发送短信
Leetcode 162 Looking for peak value (June 11, 2022)
Index query efficiency of MySQL
SharDingJDBC-5.1.0按月水平分表+读写分离,自动创表、自动刷新节点表
Heavyweight proxy cache server squid
CLJ3-100ALH30剩余电流继电器
M-arch (fanwai 13) gd32l233 evaluation - some music
DS18B20 digital thermometer (I) electrical characteristics, parasitic power supply mode and remote wiring
AcWing 1995. 见面与问候(模拟)
DrQueueOnRails 集成 LDAP 验证
套接字编程TCP篇
2022-06-11: note that in this document, graph is not the meaning of adjacency matrix, but a bipartite graph. In the adjacency matrix with length N, there are n points, matrix[i][j]