我.mdf通过SQL Server 创建了一个文件并将其放到本地文件中.我在没有安装SQL Server的计算机上运行我的程序.我还使用了System.Data.SqlClient命名空间中的类(即SqlConnection..)
我想与.mdfSQL Server创建的文件进行某种访问连接?可能吗 ?
我需要在表上隐藏一列,但之后我无法读取所选行的隐藏列值.
dtTable = $('#lookupTable').DataTable({
"columnDefs": [
{
"targets": [ 0 ],
"visible": false,
"searchable": false
}
],
aaData: data,
aoColumns: cols,
paging: false,
scrollCollapse: true,
destroy: true
});
Run Code Online (Sandbox Code Playgroud)
如你所见,现在隐藏了第一列.我试图用该代码读取列值
selectedIndex = $(this).find('td:eq(0)').text();
Run Code Online (Sandbox Code Playgroud)
如果我从代码中删除<"visible":false>,我可以读取第一列的值,但如果它被隐藏,它会给我第二列值.
我厌倦了改变"witdh"的财产,但它没有工作..
我想获得按钮的颜色..我无法从返回drawable的getbackground函数获得颜色.我使用了getsolidcolor,它返回整数值,但它一直是0(零)..我不明白问题出在哪里.也许它不是真正的功能..
这是我的android代码
int renk = btn1.getSolidColor();
if(renk== Color.GREEN)
Toast.makeText(getApplicationContext(), "green" , 1000).show();
else if(renk== Color.RED)
Toast.makeText(getApplicationContext(), "red" , 1000).show();
else if(renk== Color.YELLOW)
Toast.makeText(getApplicationContext(), "yellow" , 1000).show();
else
Toast.makeText(getApplicationContext(), "unknown", 1000).show();
btn1.setBackgroundColor(Color.YELLOW);
renk = btn1.getSolidColor();
if(renk== Color.GREEN)
Toast.makeText(getApplicationContext(), "green" , 1000).show();
else if(renk== Color.RED)
Toast.makeText(getApplicationContext(), "red" , 1000).show();
else if(renk== Color.YELLOW)
Toast.makeText(getApplicationContext(), "yellow" , 1000).show();
else
Toast.makeText(getApplicationContext(), "unknown", 1000).show();
Run Code Online (Sandbox Code Playgroud)
即使我将背景设置为黄色,我也会得到未知的吐司消息.
我想在我的项目(WPF)中使用并行编程.这是我的for循环代码.
for (int i = 0; i < results.Count; i++)
{
product p = new product();
Common.SelectedOldColor = p.Background;
p.VideoInfo = results[i];
Common.Products.Add(p, false);
p.Visibility = System.Windows.Visibility.Hidden;
p.Drop_Event += new product.DragDropEvent(p_Drop_Event);
main.Children.Add(p);
}
Run Code Online (Sandbox Code Playgroud)
它没有任何问题.我想用Parallel.For写它,我写了这个
Parallel.For(0, results.Count, i =>
{
product p = new product();
Common.SelectedOldColor = p.Background;
p.VideoInfo = results[i];
Common.Products.Add(p, false);
p.Visibility = System.Windows.Visibility.Hidden;
p.Drop_Event += new product.DragDropEvent(p_Drop_Event);
main.Children.Add(p);
});
Run Code Online (Sandbox Code Playgroud)
但是在producd类的构造函数中出现错误
调用线程必须是STA,因为许多UI组件都需要这个.
那么我使用了Dispatcher.这是代码
Parallel.For(0, results.Count, i =>
{
this.Dispatcher.BeginInvoke(new Action(() =>
product p = new product();
Common.SelectedOldColor = p.Background; …Run Code Online (Sandbox Code Playgroud) 我下载了一些文件,但我也想为webclient设置超时.我看到没有变化只是我们可以使用重写WebRequest.我已经做了但它不起作用.我的意思是重写GetWebRequest方法不起作用..这是我的代码
public class VideoDownloader : Downloader
{
/// <summary>
/// Initializes a new instance of the <see cref="VideoDownloader"/> class.
/// </summary>
/// <param name="video">The video to download.</param>
/// <param name="savePath">The path to save the video.</param>
public VideoDownloader(VideoInfo video, string savePath)
: base(video, savePath)
{ }
/// <summary>
/// Starts the video download.
/// </summary>
public override void Execute()
{
// We need a handle to keep the method synchronously
var handle = new ManualResetEvent(false);
var client = new WebClient();
client.DownloadFileCompleted …Run Code Online (Sandbox Code Playgroud) 当我在某个项目中编写代码时,会弹出Intellisense窗口,但列表为空(就像项目不可见),当我尝试单击时,没有任何反应.
在我看到Intellisense窗口没有弹出但我有不同的问题之前.
所以我要解决的问题是:
我打开另一个项目,它的工作原理.但对于某个项目,它没有.我用谷歌搜索但没有发现任何类似的问题.
问题刚刚发生.
我正在使用VS 2015,版本14 Update 2
我正在开发一个WPF程序,从网上获取图片并使用图像控件.我的图片列表有50张图片(来自vimeo的缩略图).一切看起来很好但是数字45.图片有一些问题,当我到达第45张图片时,我得到了这个例外:
价值不在预期范围内.
例外http://img232.imageshack.us/img232/2748/5688301315b2497090468bc.png
我用try-catch但是我抓不住它.因为它出现在Bitmap类中.以下是详细信息:
at System.Windows.Media.ColorContext.GetColorContextsHelper(GetColorContextsDelegate getColorContexts) at System.Windows.Media.Imaging.BitmapFrameDecode.get_ColorContexts() at System.Windows.Media.Imaging.BitmapImage.FinalizeCreation() at System.Windows.Media.Imaging.BitmapImage.OnDownloadCompleted(Object sender, EventArgs e) at System.Windows.Media.UniqueEventHelper.InvokeEvents(Object sender, EventArgs args) at System.Windows.Media.Imaging.LateBoundBitmapDecoder.DownloadCallback(Object arg) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler) at System.Windows.Threading.DispatcherOperation.InvokeImpl() at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state) at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Windows.Threading.DispatcherOperation.Invoke() at System.Windows.Threading.Dispatcher.ProcessQueue() at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 …
我为.Net v6.5安装了 MySQL连接器,它得到了Entity Framework的支持.当我使用Visual Studio 2012并尝试添加ADO.NET实体数据模型时,我看不到MySQL.只有Microsoft SQL Server.它在VS 2010中有效.
这个问题说他们正在研究它 - 有结论吗?
我有一个从ProfileBase派生的列表.此列表可以包含Profile,DynamicViewProfile的实例,因为它们都是从ProfileBase派生的
但是如果项目类型是DynamicViewProfile,我必须使用NodeName,如果是Profile,那么我应该使用DocName
profileListsForSearch = profileLists.Where(stringToCheck =>
((Profile)stringToCheck).DocName.Contains(searchBar.Text)).ToList();
Run Code Online (Sandbox Code Playgroud)
所以这是用于配置文件,它没关系,但如果列表包含DynamicViewProfile对象,那么我有一个例外,因为docname为null我需要获取NodeName
我希望我的问题很清楚
c# ×6
android ×1
datatables ×1
image ×1
intellisense ×1
jquery ×1
linq ×1
mdf ×1
mysql ×1
parallel-for ×1
sql-server ×1
timeout ×1
webclient ×1
webrequest ×1
wpf ×1