connectionstring 추가

table생성 쿼리 수정
CandleDataList클래스 수정
This commit is contained in:
DESKTOP-1A3P75F\lee
2021-03-21 19:29:09 +09:00
parent 945c9a3bbd
commit 25e2dc7ae1
2 changed files with 24 additions and 7 deletions

View File

@@ -11,16 +11,16 @@ namespace Million.Data
// 코인 종목
public CoinGoodsData ConGoodsData { get; set; }
// 캔들 데이터 (1분)
public List<CandleDataList> CandleDataLists_Im { get; set; }
public List<CandleData> CandleDataLists_Im { get; set; }
// 캔들 데이터 (3분)
// 캔들 데이터 (5분)
// 캔들 데이터 (10분)
// 캔들 데이터 (30분)
// 캔들 데이터 (1시간)
public List<CandleDataList> CandleDataLists_IH { get; set; }
public List<CandleData> CandleDataLists_IH { get; set; }
// 캔들 데이터 (6시간)
// 캔들 데이터 (12시간)
// 캔들 데이터 (24시간)
public List<CandleDataList> CandleDataLists_Id { get; set; }
public List<CandleData> CandleDataLists_Id { get; set; }
}
}

View File

@@ -8,19 +8,36 @@ namespace Million.FileDBManagement
{
public class DBConnection
{
public static string sqlAddress = "192.168.0.21";
public static string uId = "sqlm";
public static string pwd = "12345678";
public static string GetConnectionString(string databaseName)
{
return "Data Source=" + sqlAddress + ";uid=" + uId + ";pwd=" + pwd + ";Database=" + databaseName;
}
/// <summary>
/// DB 테이블 생성
/// </summary>
/// <param name="market"></param>
/// <returns></returns>
public static string QueryCreateTable(string market)
public static string QueryCreateTable(string tableName)
{
var resultstring = "";
if (!string.IsNullOrWhiteSpace(market))
if (!string.IsNullOrWhiteSpace(tableName))
{
resultstring = @"if not exists (select * from sysobjects where name='" + market + @"' and xtype='U')
create table " + market + "(Name varchar(64) not null) ";
resultstring = @"if not exists (select * from sysobjects where name='" + tableName + @"' and xtype='U')
create table " + tableName + @"(
DateTime datetime not null,
StartValue float not null,
EndValue float not null,
HighValue float not null,
LowValue float not null,
MoneyValue float not null,
CandleTimeType int not null
) ";
}
return resultstring;
}