127 Answered Questions for the topic C#
C#
07/31/19
Shortest distance from a point to this curve?
I need to find the distance of multiple points to a curve of the form: `f(x) = a^(k^(bx))`
My first option was using its derivative, using a line of the form with the inverse of the derivative,...
more
07/30/19
const correctness in C#?
The point of const-correctness is to be able to provide a view of an instance that can't be altered or deleted by the user. The compiler supports this by pointing out when you break constness from...
more
C#
07/30/19
How can I execute an .rdl report with a Report Viewer control without an SSRS server?
I'm trying to set up a web page where users can select an .rdl file to run, and it will open a Report Viewer control (ASPX), load the report definition file, run it, and display the report.
So...
more
C#
07/27/19
Accessing SSRS log programmatically?
We have several SSRS reports. We call the SSRS execution web-service's Render method and pass the name of the report and the parameters which we want to execute. This method(report) internally...
more
C#
07/27/19
Check if a point is in a rotated rectangle (C#)?
I have a program in C# (Windows Forms) which draws some rectangles on a picturebox. They can be drawn at an angle too (rotated).
I know each of the rectangles' start point (upper-left corner),...
more
C#
07/27/19
.NET Geometry Library?
Does anyone know of a good (efficient, nice API, etc.) geometry open source library for .NET? Some of the operations needed:
- Data Structures
- Vectors (2D and 3D with `float`s and `double`s)
-...
more
C#
07/27/19
How can I read metadata from .slx file with C#?
I am working with MATLAB. When I create .slx model and use next MATLAB code for insert metadata.
`h = load_system(pathToFile);
set_param(h, 'Metadata', properties)`
MATLAB write my data in...
more
C#
07/26/19
Adding custom properties into slx file via C#?
I developing program which save .slx file into Vault. But during saving I need to set some custom properties into .slx file. After sucsesfull saving, second user will be able download this file and...
more
C#
07/24/19
ASP.NET Session has expired or could be found in SharePoint 2007?
I'm trying to load an .rdlc file in SharePoint 2007 but it is not getting loaded and the following error is coming on that Report Page.
Below mentioned is the code which I've used.
Kindly help...
more
C#
07/23/19
NULL checkbox in SSRS report?
In SSRS report if I mention `Nullable` tag in `ReportParameter` then it automatically creates a checkbox with text `NULL`. So is there a way to make the checkbox by default checked?
C#
07/22/19
SSRS authentication in a MVC application?
I have a ASP.NET MVC project which connects to SSRS using `ReportingService2010` web service endpoints to retrieve and download reports.
Connection works fine using...
more
07/19/19
Partially Overriding a Virtual Auto-Property in a Child Class?
Time for a theoretical question I just ran across.The following code is valid and compiles: public class Parent { public virtual object TestProperty { get; set; } } public class...
more
C#
07/19/19
Get file to send as attachment from byte array?
I have an ASP.NET MVC application that has to send an email to a list of recipients with an attachment detailing a specific "Project". I get the details for this from a report by making use of SQL...
more
C#
07/19/19
Get random vector3 on plane?
There are the planet and a few satellites in 3d space. I need to calculate axis of rotation for every satellite. They should rotate around planet center.
I calculated the vector from satellite to...
more
C#
07/19/19
How to get last inserted id?
I have this code:
string insertSql =
"INSERT INTO aspnet_GameProfiles(UserId,GameId) VALUES(@UserId, @GameId)";
using (SqlConnection myConnection = new...
more
C#
07/16/19
C# class within a class (or nesting)?
Hey all I have made the following class:
public class ssrsFormats
{
public static readonly string
pdf = "PDF",
mhtml = "MHTML",
html4 = "HTML4.0",
html3 = "HTML3.2",
...
more
C#
07/16/19
Render SSRS Reports in .docx instead of .doc?
I am using SQL Server R2 reporting service for designing reports and integrated then in ASP.Net using Report Viewer 11. When user exports the report in Word format, the extenction of report is .doc...
more
C#
07/15/19
How to import different format Excel files into a SQL Server database?
I have a requirement where I need to import different Excel files of different suppliers into a SQL Server database. I have created SSRS package for which I need to manually put data in my format,...
more
07/15/19
Arrays in c# programming/passing by reference
Create two static methods, one called changePrices and one called printit. When the changePrices method is called from Main you should pass the item_price array by reference, the price point and...
more
07/14/19
What is Entity Framework in MVC?
07/13/19
Does the ``??`` operator use shortcircuiting?
Does the `??` operator in C# use shortcircuiting when evaluating?
var result = myObject ?? ExpressionWithSideEffects();
When ``myObject`` is non-null, the result of...
more
07/13/19
Most succinct way to determine if a variable equals a value from a 'list' of values?
If I have a variable in C# that needs to be checked to determine if it is equal to one of a set of variables, what is the best way to do this?
I'm not looking for a solution that stores the set in...
more
07/11/19
Can we generate .DWG using autoCAD and programmed using java or C#? If yes, which one language is best to go with?
write a program in java/c#
use auto CAD lib
Run the code
Shall generate .dwg format files
C#
07/11/19
How to know if a line intersects a plane in C#?
I have two points (a line segment) and a rectangle. I would like to know how to calculate if the line segment intersects the rectangle.
C#
07/10/19
How to use DbContext.Database.SqlQuery<TElement>(sql, params) with stored procedure? EF Code First CTP5?
I have a stored procedure that has three parameters and I've been trying to use the following to return the results:
context.Database.SqlQuery<myEntityType>("mySpName", param1, param2,...
more
Still looking for help? Get the right answer, fast.
Ask a question for free
Get a free answer to a quick problem.
Most questions answered within 4 hours.
OR
Find an Online Tutor Now
Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.