我试图通过Excel VBA在图表中创建ErrorBars,但我需要宽度为12PT,或者要改变.这是我正在使用的代码,但它看起来不像它的工作:
Set s = .SeriesCollection.NewSeries()
With s
.Name = "=GraphicSchedule!$" & getColumn(objList.ListColumns.Item("Activity").Range.Column) & "$" & sourceRow
.XValues = "=GraphicSchedule!$" & getColumn(objList.ListColumns.Item("DateMid").Range.Column) & "$" & sourceRow
.Values = "=GraphicSchedule!$" & getColumn(objList.ListColumns.Item("Loc1").Range.Column) & "$" & sourceRow
.HasErrorBars = True
.ErrorBar Direction:=xlX, Include:=xlErrorBarIncludeBoth, Type:=xlErrorBarTypeCustom, Amount:="=GraphicSchedule!$" & getColumn(objList.ListColumns.Item("BarLength").Range.Column) & "$" & sourceRow, MinusValues:="=GraphicSchedule!$" & getColumn(objList.ListColumns.Item("BarLength").Range.Column) & "$" & sourceRow
Set eB = .ErrorBars
With eB
With .Format.Line
.Visible = msoTrue
.Style = msoLineSingle
.Weight = 12
End With
.EndStyle = xlNoCap
End With …Run Code Online (Sandbox Code Playgroud) 我的 MVC Core 应用程序中有一个ApplicationDbContext上下文。有没有办法可以在不创建新数据库的情况下将 EF Core 搭建到该数据库上DbContext?
到目前为止我所看到的如何添加 EF Core 就是这样
Scaffold-DbContext myConnectionString Microsoft.EntityFrameworkCore.SqlServer -OutputDir Models
Run Code Online (Sandbox Code Playgroud) 我一直在使用一些代码,从字面上看,它突然间突然中断了我。这是我收到的错误消息:
Run-time error '-2147467259 (80004005)'
Automation error
Unspecified error
Run Code Online (Sandbox Code Playgroud)
该行代码专门用于实例化InternetExporer对象,除非我没有做任何更改。它只是停止工作。可能是什么问题?
之前发生过这种情况,我通过显式调用该库(之前为HTMLBsaeObject的MSHTML)进行了更正,但在命名变量时只使用了一个Object
Public Sub ValueLineResearch()
setUp
Dim myFund As String
loginN = Sheets("Logins").Range("B2").Text
pwStr = Sheets("Logins").Range("B3").Text
'Get the site
iEx.Navigate "https://jump.valueline.com/login.aspx"
iEx.Visible = True
Call waitForIE
'Need to login now don't we
iEx.Document.forms("aspnetForm").Item("ctl00_ContentPlaceHolder_LoginControl_txtUserID").Value = loginN
iEx.Document.forms("aspnetForm").Item("ctl00_ContentPlaceHolder_LoginControl_txtUserPw").Value = pwStr
iEx.Document.forms("aspnetForm").Item("ctl00_ContentPlaceHolder_LoginControl_btnLogin").Click
Call waitForIE
Application.Wait DateAdd("s", 6, Now)
iEx.Navigate "https://research.valueline.com/secure/research#sec=library"
Call waitForIE
For Each el1 In iEx.Document.getElementsByClassName("symbol-search textInput ui-autocomplete-input mod_search-symbols primary_symbol_search")
el1.Value = fundToResearch
Next
Application.Wait DateAdd("s", 2, Now)
iEx.Document.forms("quoteSearch").submit
Call waitForIE
Application.Wait DateAdd("s", …Run Code Online (Sandbox Code Playgroud) 我正在尝试通过Excel连接到Oracle DB.我在我的机器上安装了Oracle的Instant Client,但是在运行此代码时收到此消息:
Sub testing()
Dim myConn As Connection: Set myConn = New Connection
Dim mySet As Recordset: Set mySet = New Recordset
Dim CONNSTRING As String
CONNSTRING = "Driver={Microsoft ODBC for Oracle}; " & _
"CONNECTSTRING=(DESCRIPTION=" & _
"(ADDRESS=(PROTOCOL=TCP)" & _
"(HOST=xxxxxx.xxx.xxxxxxxxxxx.com)(PORT=1524))" & _
"(CONNECT_DATA=(SERVICE_NAME=dev))); uid=xxxxxxx; pwd=xxxxxxxxxxx;"
myConn.Open CONNSTRING
mySet.Open "SELECT * FROM apps.ap_invoice_lines_interface", myConn, adOpenStatic, adLockBatchOptimistic, adCmdTable
Sheet1.Range("A1").CopyFromRecordset mySet
mySet.Close
myConn.Close
End Sub
Run Code Online (Sandbox Code Playgroud)
我得到的信息是
未找到Oracle(tm)客户端和网络组件.这些组件由Oracle Corporation提供,是Oracle 7.3(或更高版本)客户端软件安装的一部分.在安装这些组件之前,您将无法使用此驱动程序
我正在尝试为我正在开发的 Web 应用程序运行后台工作程序。我使用 Npgsql 作为我的 EF Core 提供程序。
为了澄清起见,我已经为我注入DbContext了一个瞬态生命周期,并在我的连接字符串中允许池化,但是,每当我尝试测试它时,我都会收到以下错误:
Npgsql.NpgsqlOperationInProgressException:命令已经在进行中:[My Query Here]
我的Program班级设置如下:
public class Program
{
public static void Main(string[] args)
{
CreateHostBuilder(args).Build().Run();
}
public static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.ConfigureServices((hostContext, services) =>
{
// Get the configuration
IConfiguration config = hostContext.Configuration;
// DbContext
services.AddDbContext<MyDbContext>(options => options.UseNpgsql(config.GetConnectionString("PostgreSQLString")), ServiceLifetime.Transient);
services.AddHostedService<Worker>();
services.AddScoped<IDTOService, BackgroundDTOService>();
});
}
Run Code Online (Sandbox Code Playgroud)
然后通向我的Worker班级
public class Worker : BackgroundService
{
private Logger logger;
public Worker(IServiceProvider services, IConfiguration configuration)
{
this.Services = services; …Run Code Online (Sandbox Code Playgroud) 有没有办法让一个选择的索引DataRowView中DataRow?
我目前有以下代码
private long GetSelectedIndex(DataView dataView, string searchString)
{
long selectedIndex = 0;
foreach(DataRowView dataRow in dataView)
{
if(dataRow.Row.ItemArray.Contains(searchString)
{
//Do Something.... I've tried everything to get the index out of the dataRow
}
}
return selectedIndex;
}
Run Code Online (Sandbox Code Playgroud) 我将以下文本框绑定到 MVVM ViewModel
文本框
<TextBox Height="71" Width="341"
Text="{Binding BalanceValue, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, StringFormat=N2}"
Margin="0,2,2,2" HorizontalAlignment="Right"/>
Run Code Online (Sandbox Code Playgroud)
下面是我ImportPresenter处理输入的内容。
Public Class ImportPresenter : ObservableObject
{
private double _BalanceValue = 0;
public double BalanceValue
{
get
{
return _BalanceValue;
}
set
{
_BalanceValue = double.Parse(value.ToString(),
System.Globalization.NumberStyles.Currency);
RaisePropertyChangedEvent("BalanceValue");
}
}//END BALANCEVALUE
}
Run Code Online (Sandbox Code Playgroud)
在大多数情况下,这是有效的,除了测试时,它TextBox会在我打字时自行更新。我应该使用不同的事件吗TextBox?
c# ×3
excel ×3
vba ×3
asp.net ×1
asp.net-mvc ×1
charts ×1
datarowview ×1
dataview ×1
excel-vba ×1
mvvm ×1
npgsql ×1
oracle ×1
oracleclient ×1
wpf ×1
xaml ×1