Questions tagged as 'c#'

2
answers

Assembly Microsoft.Owin not found

In my project I am using the OWIN library for user authentication. I have already installed the package, but when I run the project, the error is returned:    Could not load file or assembly 'Microsoft.Owin, Version = 2.1.0.0, Culture = neutr...
asked by 10.08.2016 / 05:44
2
answers

How to create a text file template?

How do I use a txt extension file template, so that my program can read this template, replace its specific points, and generate an output, for example, in another txt file. For example: File_template.txt Propriedade1: {aqui s...
asked by 30.08.2016 / 20:40
1
answer

Fill ComboBox without repetitions

I'm trying to fill a ComboBox from a db , but ComboBox is populated with many repeated items! OleDbConnection Con = new OleDbConnection(); Con.ConnectionString = Properties.Settings.Default.dbCombo; Con.Open(); OleDbComman...
asked by 26.08.2016 / 19:49
1
answer

Error in WPF application, but only on some machines

I made a small application to extract a .zip file. It works, but when I run on three other machines, it does not work there. The error is this:    An error occurred while creating ZIP file       Object reference not set to an instance of an...
asked by 07.06.2016 / 15:15
2
answers

Make submit a form via ajax

I have the following code in my controller: [HttpGet] public ActionResult Mensagem(long idT, long idD) { string raaluno = acr.getAlunoLogado().ToString(); ViewBag.idT = idT.ToString(); ViewBag.idD = idD.ToString...
asked by 08.06.2016 / 03:54
1
answer

Remove Row DataGridView Windows Form C #

I'm trying to delete row by line in DataGridView , these lines would be in the case files (attachments) without any database connection, only the following error message appears:    It is not possible to programmatically remove rows unl...
asked by 07.06.2016 / 18:03
1
answer

Error writing stream file

   The stream was not writable You receive this exception when you try to change a file that is in resource . Here is the code: var assembly = Assembly.GetExecutingAssembly(); Stream str = assembly.GetManifestResourceStream("PCCLC...
asked by 07.06.2016 / 22:04
1
answer

C # DataGridView align header in center

I'm suffering to get the DataGridView header aligned. I want the text to be centered in the center. Here is the code: dg.EnableHeadersVisualStyles = false; // Desabilita formatação padrão dg.ColumnHeadersDefaultCellStyle.Fon...
asked by 05.06.2016 / 16:55
1
answer

Read file that is in solution in C #

I created a file in the solution of my project. How do I read this file? It should stay in solution because when compiling it should be wrapped in .exe.     
asked by 01.06.2016 / 19:58
1
answer

Catch file size through OpenFileDialog and save to a ListAttachment

I'm doing a WindowsForms application to send email, within that application I have an OpenDialog that selects the files and saves them inside a: List<Attachment> AttachmentList = new List<System.Net.Mail.Attachment>(); As...
asked by 28.05.2016 / 02:11