Newest 'c#' Questions

Q&A for professional and enthusiast programmers

XML WPF C# Binding to TreeView

I'm searching for hours and I'm trying to bind a XML-File to a treeView. In general i want to select a XML-File in a ListBox an Open the XML File in a Treeview. The XML looks like this: <test>...

How do I call a partial view from a view and generate a drop down list?

I am have 2 drop down lists and based on the first one I want to populate the second one. So I first generate the second drop down list as an empty list and then using my action controller I try to ...

Teltonika fm1100

I have a problem with my Teltonika fm1100 device.It keeps sending me the old packs all the time ,i tried to reset it ,to re-configure but still the old data from 2016 are being received to the ...

Scroll Webview with RadialController while getting RotationChanged event

I'm using a Surface Dial to scroll a WebView in a UWP application. I'd like to grab the RotationChanged event of the RadialController class while the scrolling function is being preserved. However, ...

Update SqlCommand- Does not update in Database

this doesn't update in my database table. Have I over-looked something? The values are in the textboxes fine. No errors show, weird. using (SqlConnection connection = new SqlConnection(@...

xamarin studio, ios, save data between launches

Is there a some analog in xamarin (ios) of shared preferences in android studio to save data between launches? Or the best way to do this - write in file and read when its needed?

WebCam_Capture notfound

I'm new and I have a problem with a class. I have ever that problem " An unhandled exception of type 'System.IO.FileNotFoundException' occurred in WinFormCharpWebCam.exe" But I added the refrence to ...

Sound issue in universal windows platform

I am using insider build 15031. Mediaelement Sound plays in emulators but not in desktop. As per suggestions ,If I change package name more than 20 characters it works for first time,but second time ...

best way for compress insert code in controller

i create this controller for insert news . how can i compress this code ? /****************************************************************************************************************************...

C# pass action with parameters

today i was looking for some projects with ilspy i did not understand how Actions can be used like this, in one class this method is called public void Login(Action success, Action<bool> ...

ODP.NET && Entity Framework 'Index was outside the bounds of the array' Exception

I'm using oracle 12 c with entity framework 6 depending on oracle data provider for .net (ODP.net).When I'm trying to add result binding for computed columns in insert procedure I'm getting 'Index was ...

Login to a Website Programmaticaly in Asp.net

I want to extract data from HTML of a website that needs to be logged in. I am searhing the web for 4 days with no clear results. I need an answer for Asp.net/C#. The information I collected so far: ...

Resizing window causes out of memory datagridcellitemautomationpeer

I have a WPF window containing a Datagrid. Window starts in full-screen and the datagrid is populated. Then I Restore the window down and suddenly the process starts to require memory until it crashes....

Making student number = date of the school year and the college and specialization, and the serial number in the database

qustion i need to help me Keywords examples (the date of the year 2017 ,001 specialization Information Systems ,1 student number) becomes a figure of academic = 20170011 How can I encode student ...

Unity IoC InjectionFactory not respecting DependencyOverride

I'm currently trying to wrap a class in decorator and inject in one of the dependencies at runtime. I currently have an interface of IStorage that is implemented by a StorageCacheDecorator and a ...

Inherit dependency property and override local value

I have an attached property which inherits: public static class AttachedProperties { public static readonly DependencyProperty MyCustomProperty = DependencyProperty.RegisterAttached( ...

Locking conditional based on value

For example i have a method which return current seat place for ticket which will be sold. public async Task<int> GetSeatPlaceAsync(int busLineId) { var seatsInfo = await context....

WPF binding exception with ElementName

I have a simple window in which I wish to set the focus when opening to a TextBox. This I attempt to do using the FocusManager.FocusedElement in the XAML but I get the following error at runtime in ...

C# Change all Settings files values

I have some forms and have made a Settings File for each that contains int X int Y bool FirstRun i save these for the user so that the position of the window is in the same spot every time they ...

Nested aggregation not working with AggregationContainer

I'm having trouble with Nested aggregations. Here is how I define my aggregations and the json equivalent I get: var aggregations = new AggregationDictionary(); var nestedAgg = new ...

C# - Writing ata to existing template on Ms. Excel

I have windows form and after user filled up all data and click a button, all data that user inputted have to write to existing excel that already have a template inside and after that, filled excel ...

does not contain a constractor that takes 0 argument [duplicate]

I know this question is already been asked but all the solution out there did not solve my problem. I have problem with inherit a class it tells me that something is missing which is I do not know, ...

VS 2017 Document-level add-in build fails with com visible components

I have VS 2013 installed and I added 2017 RC. I made a document-level modified excel solution with some customisation in C# and this works fine. Then I added some VBA code in the spreadsheet and added ...

How to configure restrictions with Unity dependency injection?

I am using dependency injection with Unity in my ASP.Net web application. Suppose I create a simple service called MyService implementing IMyService. I would configure it like this in my ...

c# axWindowsMediaPlayer sometimes just play sound and sometimes show black screen

I am working on a WPF desktop application that play movie. i have used axWindowsMediaPlayer on it. But there is a problem. Videos can not be played on some computers and axWindowsMediaPlayer just ...

Trying to validate URI in different languages

i ma trying to valide string that will be used as URL for my site. The user inputs a url and i have to check if it is valid. For exemple we have the site in multiple languages. I used the Uri....

How can I develop a gRPC plugin that handles the transmission of request ID through c# generated code?

I have many microservices en .net communicating with each other via gRPC (I use "protoc.exe" and "grpc_csharp_plugin.exe" to generate the client and server parts). Now I need that the gRPC request ...

Aforge “Object is currently in use elsewhere ” case Multiple WebCam

I have the error "Object is currently in use elsewhere A first chance exception of type 'System.InvalidOperationException' occurred in System.Drawing.dll" and I can't solved I don't know what I do ...

Split C# application into module parts

I have a completly working application which have a main application and seperate modules/program functions stored in dll files. Forms stored in dll files are loaded into FlowLayoutPanel dinamicaly. I ...

Data Fetching in asp.net using my sql db? [on hold]

While try to get the 30000 plus records repeater did not show the records but restrict the limit of the records to 10000 in MY SQL it shows the data. what can i do to solve this?

Convert XML file to datatable C#

I've the following xml file: <?xml version="1.0" encoding="utf-8" ?> <font id="plejd"> <glyph unicode="&#x100;" glyph-name="area_add" d="string" /> <glyph unicode="&#x101;...

Opening specific page of PDF File using MuPDF

I am using MuPDF library to view the pdf file. I am working on Xamarin.Android. I need to know is there a way to open the pages of pdf file that lie in specific range. For example, if my pdf file have ...

<xmlns='' > was not expected. But cannot define XMLroot as it changes. C#

I have a site that imports bookings from an external XML file and stores them as nodes in an Umbraco site. The issue: Basically, The system in which I exported the bookings from has changed how it ...

What's the difference between List<Struct> and List<Class>? [duplicate]

Well... Is there any advantage of using List with Struct compared to List with Class? Something like memory related advantage(ex. garbage). And list with struct, when I want to change the value of a ...

how to convert json string to object in C#

Its been a day scratching my head & googling on how to convert json string to an object. This is my json. { "statusCode": 200, "data": { "items": [ { "id": 2623, "JsonData": "{\"...

i am trying to work on asp.net to create a table that connects to the datable but the structure of the table is a bit hard for me to create

how do i create a menu table that connects to the database with 4 columns and 10 rows with next and previous button. and A search button. with a drop drop down that shows number of entries

Gridview controllers null after inserting column

I am developing a Web App for managing Student exam entries but I am coming across an issue with my gridview. The basic idea is that a user can go on and enter and update details on a students exam. ...

Redirection to external page within web forms application

I have a WebForms application ( .Net Framework 4.5.2) . I need to redirect some pages to external web page example www.google.com I tried to modify the routes public class Global : HttpApplication ...

Control Content and Property change

I have dialogbox with Content control with templates: <ContentControl Content="{Binding Model,UpdateSourceTrigger=PropertyChanged}" ContentTemplateSelector="{StaticResource TemplateSelector}"/>...

mvc asp multiple bootstrap modals (opened with href=“@Url.Action()”)

Introduction: Hi, I'm new to Stackoverflow, any feedback apprichiated. I'm working on a larger mvc asp project and my problem concerns Views, modals and bootstrap. I created a website creating the ...

C# WCF: Get Requesters URL

I have a C# WebService called via ajax (javascript). Is it possible to retrieve the requesting URL? Example: test/index.html calls the WebService via "GET". Can I retrieve this calling URL (test/...

Bypassing the browser cache by asp-append-version not working in iframe

I have used the asp-append-version="true" for bypassing the browser cache but it's not working when I used it in iframe. Do I have to change my solution?

SELECT * FROM online_exam WHERE CONVERT (time, SYSDATETIME()) > start_time AND CONVERT (time, SYSDATETIME()) < end_time [on hold]

result of this SQL query is null... while my table has data that match this time condition someone help me as soon as possible SELECT * FROM online_exam WHERE CONVERT (time, SYSDATETIME()) >...

Issue with tracking related events using Operation Context

I have a WPF application that I would like to monitor using Application Insights. I would like to group each user action as one request, with embedded custom events and dependency calls. From what I ...

C# Server will not read in multiple lines sent from the client

I am currently creating a client which communicates with a server. Up until now, any communication has been no longer than a line, so I've been able to user Streamreader readline to get the clients ...

Unity: How to dynamically attach an unknown script to a GameObject (custom editor)

I'm currently making a system for the Unity Editor (custom inspector and custom windows) that will automate and make things easier for the artists working on the game we're making, but I've hit a ...

Trying to run boostrap Modal inside C#

I am trying to run the bootstrap modal inside the C# Here's the code inside C# } protected void GridView1_SelectedIndexChanged(object sender, EventArgs e) { ScriptManager.RegisterStartupScript(...

Error When button is clicked [duplicate]

I get this error i click button to save data to excel file. Object reference not set to an instance of an object. Please help. saveFileDialog1.InitialDirectory = "C:"; saveFileDialog1.Title = "...

WPF listview set several selected items

I am looking a way to select several items in a ListView, I explain my problem, as maybe there is an easier way to do that : private void symetrieX_Click(object sender, RoutedEventArgs e) { ...

Is a base class sufficient, or is it ALWAYS worth creating an interface also? [duplicate]

I have 3 entities which are similar, but have different ways of doing certain things. I use interfaces often and find them very useful, but here I chose a base class design for this approach, because ...
Translating... 0%