c# .

  1. Conduct Exam

    Question How to Add Watermark in Wordfile ?

    I want to add watermark Using C#. And I expect this solution. first the watermark should be added as a watermark object rather than a shape in the header. And Watermark add to all pages of word file. The second watermark should be editable and when I edit the watermark Manually in Wordfile, the...
  2. A

    How to select user from kendo dropdown then click kendo button do add row to Database table and displayed with kendo grid passing JSON to ajax functio

    /Controller [AcceptVerbs(HttpVerbs.Post)] public ActionResult Create([DataSourceRequest] DataSourceRequest request, Model x) { if (x!= null && ModelState.IsValid) { DataLayer.Create(); } return Json(new[] { x }.ToDataSourceResult(request, ModelState)); }...
  3. GabrielAspirans

    help using firebase storage

    I'm having difficulty using firebase storage, a lot of the material is outdated and the libraries present methods that no longer exist, I'm not able to follow the documentation either. Can anybody help me ? Please. I have a ddd application in C#, I want to save and read files from firebase storage
  4. M

    Question how to make cancel button to cancel or stop task async in my proxy checker code

    namespace WindowsFormsApplication7 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } public async Task testProxy(string ip, int port) { bool OK = false; try {...
  5. H

    Draw Both Arabic And English Words Char By Char?

    I'm trying to draw the same text from textBox to Panel char By Char For both Arabic & English with the same char size and position also style and color my code works perfectly if the text is English language but for Arabic its printing separated chars . I Know if i use DrawString , DrawTextBox...
  6. R

    Resolved Translate VB6 to C Sharp with DLL

    Hello, I don't know if the title is correct but that's the idea. I am programming a Payway POS program in the console Payway POS that loads a DLL, I was able to do almost all the procedures but there are three that don't work and I need help. The procedures are almost the same but I am only...
  7. A

    Resolved Error Creating Window Handle

    I am creating a winform app that accepts a name and position as input and upon clicking the submit button generates a barcode of that name and prints that on the entered position in a pdf file(generates this as well). The app is giving me error on Environment.Exit(1) - Error Creating Window...
  8. A

    Question How to download pdf using link label?

    I am creating a pdf using PDFsharp and saving it automatically on button click- // Save the document... string filename = "Barcode.pdf"; document.Save(@"E:\" + filename); MessageBox.Show("PDF saved successfully!"); Instead of automatically saving it by...
  9. D

    System.FormatException : 'Input string was not in a correct format.'

    Good evening, I get an error on this line : command.Parameters.AddWithValue("@chambreCat", Convert.ToInt32(cbAdminCat.Text)); I want to be able to convert my character string to INT otherwise I could not insert the value into the database if it is not an integer. Here is the code for my...
  10. D

    Resolved Problem displaying information in a listBox

    Hello, When I display all the agents in my listBox I get the right number of agents but not the right information. I get the result from the attachment. And here is the code of my function: public static List<Utilisateur> GetTousLesAgents() { List<Utilisateur> ListeUsers =...
  11. D

    Resolved Windows -1252 is not supported encoding name

    Hello, I get an encoding related error when I want to check if my database connection is working when I press the "Connection" button on my form. The error is on "conn.Open();". I have attached my static class which contains the function for connection and the code where I call my function...
  12. P

    Hello I am making a primitive AI program, but do not know how to instantiate a class...

    namespace SafeHaven { public class Class { public string Name { get; set; } public string Description { get; set; } public decimal Balance { get; set; } public int Amount { get; set; } = 0; public void MakeCharacteristics() { } public...
  13. lcorcoran1

    Send data from C# string object to SQL Server Database

    Hello, I have a console app that calls an API and gets a response in JSON I'd like to the "upload" this json into an existing SQL Server Table. Is this possible?
  14. Samuel David

    Resolved How to view sql command execution with Stored Procedure ?

    Hello Everyone, I have below block of code. private TData ExecuteReturnData<TData>(string procName, Func<IDataReader, TData> translator, SqlConnection sqlCon, params SqlParameter[] parameters) { using var sqlCmd = CreateCommand(procName, sqlCon, parameters); sqlCmd.CommandTimeout=120; using...
  15. Samuel David

    How to write Unit test for DAL which call stored procedure and direct sql commands

    Hello Everyone, I am writing unit test cases(using xunit) for DAL methods(which are calling stored procedures and some direct sql commands and not returning methods). How can I mock the results coming from db in unit tests. public class Notification : Base, INotificationBal { public void...
  16. Samuel David

    Question How to see code coverage result in Visual Studio 2022 professional

    Hello Everyone, I am using visual studio 2022 professional. Used Xunit, wrote unit cases in the project. How can I see the code coverage percentage. Please suggest me. Thanks
  17. Samuel David

    Resolved Unit test project creation dependency injection mocking

    Hello Everyone, Can someone suggest me to create unit test project with mocked dependency injection & other dependencies used in business logic with sample reference. Thanks Sam
  18. P

    How to start to create mp4 class?

    Hi Guys, I want to create my own mp4 class to modify file details(Title,comments,author etc.), but I don't know how to start. Could you expert help me? thank you.
  19. simos-sigma

    Question How can I access the resources of a project through a custom "uitypeeditor" which is located into a control library?

    Hello!!! :) I am trying to make a custom UITypeEditor with a dialog box which will import .svg files into a project or will select one from those already imported, like the Select Resource Dialog Box does with other files. I have managed to make it get the .svg file from a file and then place...
  20. J

    Question How can I get a valid stream from a zip file which contains xml?

    Hi Gents, I have a specific requirement is to get a valid stream(which will be further operate) from given zip path? The situation is use a support code snippet to determine given path is xml/zip file(one of these files inside zip is xml which what I want), if it's a xml then easily get a...
Back
Top Bottom