我有一个基于java的服务器(Tomcat),它使用JDBC连接连接到Oracle数据库.有多种方法可以连接到数据库:SID,TNS名称,服务名称.
我想了解每个连接之间的区别是什么,如果连接到集群数据库,建议的连接(SID,TNS或服务)是什么.这是我们为数据库提供的TNS名称:
MY_NICE_TNS_NAME.MY_COMPANY.COM =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = myhostname)(PORT = 1521))
(LOAD_BALANCE = YES)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = MY_NICE_SERVICE_NAME.MY_COMPANY.COM)
(FAILOVER_MODE =
(TYPE = SELECT)(METHOD = BASIC)(RETRIES = 180)(DELAY = 5)
)
)
)
Run Code Online (Sandbox Code Playgroud)
谢谢!
在System.Windows.Forms.GroupBox上,有没有办法隐藏它周围的框架?我尝试更改FlatStyle,但这不符合我的要求.谢谢!
我需要创建一个自定义形状以添加到WPF表单上.形状只是一个三角形.如果你想知道,是的,我可以用XAML中的Polygon做到这一点:
<Polygon Fill="LightBlue" Stroke="Black" Name="Triangle">
<Polygon.Points>
<Point X="0" Y="0"></Point>
<Point X="10" Y="0"></Point>
<Point X="5" Y="-10"></Point>
</Polygon.Points>
</Polygon>
Run Code Online (Sandbox Code Playgroud)
问题是我们需要绑定一个最终决定形状大小的其他地方的属性.所以,我写了一个像这样的形状类的简单扩展:
public class Triangle:Shape
{
private double size;
public static readonly DependencyProperty SizeProperty = DependencyProperty.Register("Size", typeof(Double), typeof(Triangle));
public Triangle() {
}
public double Size
{
get { return size; }
set { size = value; }
}
protected override Geometry DefiningGeometry
{
get {
Point p1 = new Point(0.0d,0.0d);
Point p2 = new Point(this.Size, 0.0d);
Point p3 = new Point(this.Size / 2, -this.Size); …Run Code Online (Sandbox Code Playgroud) 我正在尝试创建一个从服务请求一些XML数据的存储过程.我在网上找到了几个例子,所有这些例子都指向使用这个UTL_HTTP包.但是,每次我尝试使用它编译我的存储过程时,我都会收到错误:
PLS-00201: identifier 'UTL_HTTP' must be declared
Run Code Online (Sandbox Code Playgroud)
这是我想要使用的代码的基本框架.
PROCEDURE GET_XML_DATA2 AS
BEGIN
DECLARE
v_soap_request VARCHAR2(32767);
v_soap_response VARCHAR2(32767);
v_http_request UTL_HTTP.req; --Fails here
v_http_response UTL_HTTP.resp; -- Fails here too
v_action VARCHAR2(4000) := '';
BEGIN
null;
END;
END GET_XML_DATA2;
Run Code Online (Sandbox Code Playgroud)
它在指定的行中失败并且不编译.我正在使用Oracle Express Edition,我已经尝试授予我的用户对该包的执行权限.那没起效.我还能看到什么?还有什么可能导致这个?谢谢!
我有一个WPF MenuControl,我在运行时添加了几个菜单项.如果您有兴趣知道,原因是我们从数据库中读取数据并需要根据返回的数据创建MenuItems.我们所说的是一种复杂的菜单风格(至少复杂的阅读:)).现在,当我添加我的菜单项时,我不断在Visual Studio的调试窗口中收到此错误:
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='System.Windows.Controls.ItemsControl', AncestorLevel='1''. BindingExpression:Path=HorizontalContentAlignment; DataItem=null; target element is 'MenuItem' (Name=''); target property is 'HorizontalContentAlignment' (type 'HorizontalAlignment')
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='System.Windows.Controls.ItemsControl', AncestorLevel='1''. BindingExpression:Path=VerticalContentAlignment; DataItem=null; target element is 'MenuItem' (Name=''); target property is 'VerticalContentAlignment' (type 'VerticalAlignment')
Run Code Online (Sandbox Code Playgroud)
根据添加的MenuItem数量,我猜这两个重复几次.我注意到的另一个奇怪的行为是,在调试窗口出现这些错误之后,MenuControl会自动下降(打开),只需将鼠标移到它上面(不像通常那样点击它).所以,我猜一个人与另一个人有关系.
有什么想法发生了什么?MenuControlCode相当长,但如果需要,我也可以发布它.
这是MenuControl的XAML代码.之后,在代码中我只使用"PrincipalMenu"并根据需要添加MenuItems:
<UserControl x:Class="EOGMapControl.MainPropertyGUI.MenuControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
d:DesignHeight="41" d:DesignWidth="380">
<UserControl.Resources>
<SolidColorBrush x:Key="HighlightedBackgroundBrush" Color="#FFDEDEDE" />
<SolidColorBrush x:Key="MenuBackgroundBrush" Color="White" /> …Run Code Online (Sandbox Code Playgroud) 我从未做过任何DAP/AD管理员或查询.现在,我有一个任务,我需要在公司的AD中获得所有USERS; 但不断在查询结果中获取计算机.我使用objectClass = user并仍然获取AD中的所有计算机.我还缺少什么?有没有办法说"objectClass = user而不是objectClass = Computer"?谢谢!
我正在处理我的第一个连接到 SQL 服务器的 SSIS 包。在我开发它时,我使用 Windows 身份验证进行连接,这工作正常,因为我的 Windows 用户名已添加到我正在处理的数据库的安全性中。现在,我的 IT 部门创建了一个服务帐户来部署包。我的问题是,如何在部署之前更改连接的用户名/密码?是否有连接可以读取的配置文件?如何处理?
我与一个函数执行操作(我想用LINQ),并返回这样的对象的集合库工作:
System.Collections.Generic.IEnumerable<ColorInformation>
Run Code Online (Sandbox Code Playgroud)
这个"ColorInformation"是一个看起来像这样的类:
public class ColorInformation
{
private readonly System.Drawing.Color color;
private readonly string rowTitle;
private readonly System.Collections.Generic.List<int> ids;
public ColorInformation(System.Drawing.Color color, string rowTitle,
System.Collections.Generic.List<int> ids)
{
this.color = color;
this.rowTitle = rowTitle;
this.ids = ids;
}
public string RowTitle
{
get { return rowTitle; }
}
public System.Drawing.Color Color
{
get { return color; }
}
public System.Collections.Generic.List<int> Ids
{
get { return ids; }
}
}
Run Code Online (Sandbox Code Playgroud)
我有兴趣检索返回的集合中所有对象的所有ID.我试过这个:
var myids = from ids in theCollectionReturned select ids.Ids;
Run Code Online (Sandbox Code Playgroud)
这给了我一个带有ID的列表集合.我真正想要的只是一个包含所有整数ID的列表.所以,必须在某处进行演员或某种转换,我不知道该怎么做.任何帮助,提示,阅读,代码,示例将不胜感激.谢谢!
我有两个对象列表,其中一个对象具有不同数量的项目.现在,如果我这样做:
var result = list1.Except(list2);
Run Code Online (Sandbox Code Playgroud)
这会给我list1中的项目与list2中的项目之间的区别,对吧?如果可能的话,我想做的是从list1中删除同一步骤中的所有项目.我不想做的是必须遍历"结果"列表并从list1中删除它们.那可能吗?
谢谢!
我有一个我需要分组的列表.在列表中我添加了这个对象:
private class MyObject {
private System.Drawing.Color color;
private string title;
public MyObject(System.Drawing.Color color, string title)
{
this.color = color;
this.title = title;
}
public string Title
{
get { return title; }
set { title = value; }
}
public System.Drawing.Color Color
{
get { return color; }
set { color = value; }
}
}
Run Code Online (Sandbox Code Playgroud)
我将我的列表创建为:
System.Collections.Generic.List<MyObject> mList = new System.Collections.Generic.List<MyObject >();
Run Code Online (Sandbox Code Playgroud)
然后我尝试将内容分组:
var groupedList = mList.GroupBy(c => new {c.Title} ).ToList();
Run Code Online (Sandbox Code Playgroud)
那是我收到错误的时候.有任何想法吗?我怎样才能做到这一点?谢谢!
我在WPF中创建了一个带有菜单的用户控件.它工作得很好,现在我看到了格式问题MenuItem.Header.基本上,如果我添加名称具有"_"字符的标题,则删除它.例如,如果我将其添加到标题:"Test_Header_Name",则显示为:"TestHeader_Name".所以基本上它格式化/操作字符串并删除第一个"_"字符.我知道事情不只是突然发生的.我确信,我必须在某些方面做一些改变格式的事情......但我无法弄清楚它是什么.
这是测试菜单的C#:
public partial class MenuControl : UserControl
{
public MenuControl()
{
InitializeComponent();
MenuItem main = new MenuItem();
main.Header = "Sum(Test_Header_Name)";
for (int i = 0; i < 10; i++)
{
main.Items.Add("Test_" + i);
}
main.Items.Add(new Separator());
main.Items.Add("Remove");
this.PrincipalMenu.Items.Add(main);
}
}
Run Code Online (Sandbox Code Playgroud)
这就是XAML(这是我认为它正在发生的地方):
<UserControl x:Class="WindowsFormsApplication1.MenuControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
d:DesignHeight="41" d:DesignWidth="380">
<UserControl.Resources>
<!--**************************
* STYLE: MenuItem
************************** -->
<SolidColorBrush x:Key="HighlightedBackgroundBrush" Color="#FFDEDEDE" />
<SolidColorBrush x:Key="MenuBackgroundBrush" Color="White" />
<SolidColorBrush x:Key="NormalBorderBrush" Color="#FFE5DFDF" />
<SolidColorBrush x:Key="SolidMenuFontBrush" Color="Black" />
<SolidColorBrush x:Key="HighlightedText" Color="White" /> …Run Code Online (Sandbox Code Playgroud) 我有一个看起来像这样的对象:
public class TestObject {
private string name = string.Empty;
private List<int> ids;
public TestObject(List<int> ids, string name)
{
this.ids = ids;
this.name = name;
}
public string Name
{
get { return name; }
set { name = value; }
}
public List<int> Ids
{
get { return ids; }
set { ids = value; }
}
}
Run Code Online (Sandbox Code Playgroud)
我得到一个这样的对象列表,看起来像这样:
List<TestObject> listTest = new List<TestObject>();
listTest.Add(new TestObject((new int[] { 0, 1, 5 }).ToList(), "Test1"));
listTest.Add(new TestObject((new int[] { 10, 35, …Run Code Online (Sandbox Code Playgroud) c# ×8
linq ×4
wpf ×3
oracle ×2
xaml ×2
int ×1
jdbc ×1
ldap ×1
ldap-query ×1
list ×1
silverlight ×1
ssis ×1
tomcat ×1
winforms ×1
wpf-controls ×1