c#-4.0

Workflow 4, Why WaitForInput can not accept Input=[command]

限于喜欢 提交于 2020-01-06 02:50:12
问题 I'm trying to implement a multi steps wizard using WF4 for my MVC project. I've installed "Client Profile Platform Update 1" on my machine and I've implemented my project based on this sample : http://dotnetslackers.com/articles/aspnet/Multiple-Step-Based-Registration-via-ASP-NET-MVC-2-WF-4.aspx#1797 The problem is when I add a "WaitForInput" to first step of my 'Activity' , and I try to set Input=[command] , the expression validation shows me this error : Compiler error(s) encountered

how to winform texboxt Text transfer value web page textbox

荒凉一梦 提交于 2020-01-06 02:45:11
问题 I have textbox1 , I want to transfer textbox1.Text into webbrowser1 web page textbox, how to do this? I have below code, but webpage text box selected index change event not fired. How to do this? private void button2_Click(object sender, EventArgs e) { HtmlDocument doc = webBrowser1.Document; HtmlElement HTMLControl2 = doc.GetElementById("flightno-filter"); //HTMLControl.Style = "'display: none;'"; if (HTMLControl2 != null) { // HTMLControl2.Style = "display: none"; HTMLControl2.InnerText =

How to handle whitespace in DataTrigger binding for WPF DataGrid?

为君一笑 提交于 2020-01-06 02:36:45
问题 I am using autogenerating datagrid and binding it to a DataTable.This DataTable has columns with whitespaces like 'Last Value'. Now I need to add a datatrigger to apply some style as shown below: <DataGrid.Resources> <Style x:Key="DgStyle" TargetType="{x:Type TextBlock}"> <Setter Property="TextAlignment" Value="Right"/> <Style.Triggers> <DataTrigger Binding="{Binding Last Value, Converter= {StaticResource DecimalToBoolConverter}}" Value="True"> <Setter Property="Foreground" Value="Red" /> <

ITextSharp: parse html with cyrillic/international words

萝らか妹 提交于 2020-01-06 02:17:08
问题 I try to parse html file and to generate pdf. I use code document.Open(); HtmlPipelineContext htmlContext = new HtmlPipelineContext(null); htmlContext.SetTagFactory(Tags.GetHtmlTagProcessorFactory()); ICSSResolver cssResolver = XMLWorkerHelper.GetInstance().GetDefaultCssResolver(true); IPipeline pipeline = new CssResolverPipeline(cssResolver, new HtmlPipeline(htmlContext, new PdfWriterPipeline(document, writer))); XMLWorker worker = new XMLWorker(pipeline, true); XMLParser p = new XMLParser

Execute SQL Server stored procedure with input parameter

不羁岁月 提交于 2020-01-06 02:00:26
问题 Could you suggest please how to execute from Sql Server a stored procedure that receives an input parameter? I tried this but it failed: EXEC GetFilmsInCategory('SF'); The stored procedure is correctly defined, by the way. I executed it from the visual interface and it worked, with this code generated automatically: DECLARE @return_value int EXEC @return_value = [dbo].[GetFilmsInCategory] @CatNume = N'SF' SELECT 'Return Value' = @return_value I find this automatically generated code too...

Execute SQL Server stored procedure with input parameter

牧云@^-^@ 提交于 2020-01-06 02:00:07
问题 Could you suggest please how to execute from Sql Server a stored procedure that receives an input parameter? I tried this but it failed: EXEC GetFilmsInCategory('SF'); The stored procedure is correctly defined, by the way. I executed it from the visual interface and it worked, with this code generated automatically: DECLARE @return_value int EXEC @return_value = [dbo].[GetFilmsInCategory] @CatNume = N'SF' SELECT 'Return Value' = @return_value I find this automatically generated code too...

How to save the value of Listbox in the database?

旧时模样 提交于 2020-01-05 20:04:27
问题 i m developing my project in asp.net MVC-3. In these in one module i created a view for creation of team. In that there is one dropdown list of Project name. and a listbox(ListBox-1) to display the members of the selected project from dropdownlist. and there is another listbox(ListBox-2) to transfer/select the selected or all records(member's names) in it. which is done perfectly using javascript. I have to save all the data in database of that form. in that i have to save the list of team

WMI Files Montioring using C#

主宰稳场 提交于 2020-01-05 12:16:25
问题 I am working on WMI(Windows Management Instrumentation) in C# and stuck at a point. I have to create an application using WMI (C#) similar to File System Watcher. I would like to get notified every time whenever within a particular folder a new file is created or deleted. MY WQL query is : SELECT * from _InstanceModificationEvent within 2 where TargetInstance ISA 'CIM_DataFile' and TargetInstance.Drive = 'C:' AND TargetInstance.Path='\\Test' While running the query using wbemtest , it

How to Use Distinct() and Sum() in Single Query in Linq

妖精的绣舞 提交于 2020-01-05 11:31:20
问题 Here I have 2 Columns like Id,Quantity. I want get the Distinct Id and its Quantity Sum in LINQ. I tried like this var r = list.Where(some operation) .Select(x => x.Id) .Distinct() .Select(x => (int?)x.Quantity)) .Sum(); Here at x.Quantity I got error..how can I solve this.. please give your suggestions 回答1: If I assume that Id is int and Quantity is string, then you can use aggregate also. Below is one example: class TestClass { public int I { get; set; } public string S { get; set; } }

Save File in DocumentDb with custom name

淺唱寂寞╮ 提交于 2020-01-05 11:04:29
问题 I'm trying to save a XML file in DocumentDb in Json format. I have no problem in converting it and saving. All the conversion and saving are working fine. However when I store my Xml file the DocumentDB provides its own file name to the file. Eg; 8756b9b9-41ac-47ca-9f4c-abec60b318be . But I want to save the file with my own custom name Eg; MyXmlFile1 or MyXmlFile2 etc; How do I pass my custom name when saving the file? That is MyXmlFile1 or MyXmlFile2. "jsontoStore" has the content of the