public virtual string GetTableScript(string tableName, string server, string username, string password, string database) { var sqlConnectionString = "Data Source=" + server + ";User Id=" + username + ";Password="******";Initial Catalog=" + database + ";"; _sqlCon.ConnectionString = sqlConnectionString; var common = new ClsCommon(); var dst = common.GetDatasetFromSqlQuery(ClsQueries.SqlGettablescript.Replace("{TABLENAME}", tableName), _sqlCon); var response = common.ConvertDatasettoString(dst); return(response); }
public string GetPrimaryKey(string tableName, string server, string username, string password, string database) { var sqlConnectionString = "Data Source=" + server + ";User Id=" + username + ";Password="******";Initial Catalog=" + database + ";"; _sqlCon.ConnectionString = sqlConnectionString; var common = new ClsCommon(); var dst = common.GetDatasetFromSqlQuery(ClsQueries.SqlGetprimarykey.Replace("{TABLENAME}", tableName), _sqlCon); var response = dst.Tables[0].Rows[0][1].ToString(); return(response); }