- 相關(guān)專題
- PostGreSQL
- SQLServer
- 推薦閱讀
SQLite Error 1: 'no such table: AspNetUser'.
在用下面的命令重新創(chuàng)建數(shù)據(jù)庫 > drop-database > add-migration Init 然后VS自動創(chuàng)建生成遷移類,里面明顯可以看到有創(chuàng)建表的語句 migrationBuilder.CreateTable( name: "AspNetUsers", columns: table => new { Id = table.Column<string>(type: "TEXT", nullable: false), Sex = table.Column<string>(type: "TEXT", maxLength: 1, nullable: true), ...
[原創(chuàng)]MVC引入SqlLiet數(shù)據(jù)庫
引入 SQL 數(shù)據(jù)庫組件 · Microsoft.EntityFrameworkCore.Sqlite · 官方參考鏈接: https://docs.microsoft.com/zh-cn/ef/core/providers/sqlite/?tabs=dotnet-core-cli SQLLITE 連接字符串: https://docs.microsoft.com/zh-cn/dotnet/standard/data/sqlite/connection-strings 添加測試模型,生成基架 public class Blog { pu ...
C# SqlHelper
using System;using System.Data;using System.Xml;using System.Data.SqlClient;using System.Collections;using System.Configuration;using WinDPAPI;using System.Text;//如果要獲取連接數(shù)據(jù)連接對象或字符串的話,先要修改SQLHelper類中GetConnSting() 方法中的ConfigurationManager.ConnectionStrings["ConStr"].ConnectionString;才能調(diào)用。namespace DAL{ /// <summary> /// SqlServer數(shù)據(jù)訪問幫助類 /// </summary> public sealed class SqlHelper { #region ...
DbHelper
using System;using System.Configuration;using System.Data;using System.Data.Common;using System.Data.OleDb;using System.Data.SqlClient;namespace DB{ /// <summary> /// 數(shù)據(jù)庫助手類 /// </summary> public class DbHelper { private static string dbProviderName = ConfigurationManager.AppSettings["providerName"]; private static string dbConnectionString = ConfigurationManager.AppSettings["connectionString"]; private D ...
PG 28000錯誤消除
臨時解決方案:打開文件C:\Program Files\PostgreSQL\10\data\pg_hba.conf 查找關(guān)鍵字IPV4,找到后修改為如下所示: # IPv4 local connections: host all all 192.168.1.10/32 md5 host all all 0.0.0.1/0 trust # IPv6 local connections: host all all ::1/128 md5 信任客戶端連接即可。 ...