Posts by Pedro Azevedo • 435 points
25 posts
-
0
votes3
answers3861
viewsQ: How to replace the comma
I was wondering how can I replace the comma for a period. Example: I have the following number 2.32 wanted it to be 2.32. How can I do that? I’ve tried using the…
-
2
votes1
answer107
viewsQ: Error inserting data from an excel file into sql
I have a problem when I insert data from excel file into the database because a field that I am entering says it is not of the type time and does not allow inserting , but in the excel file the text…
-
3
votes1
answer98
viewsQ: How to Bulkcopy an excel file to an sql table
I wanted to make a bulkcopy from an excel file to an sql table. But you’re giving me this error when I try to send to sql: System.Invalidoperationexception: 'The Columnname indicated 'Transdate'…
-
1
votes2
answers200
viewsQ: How to convert text into file to number with decimals?
I have this data written in the text file "000001010" (you only have this data), but I wanted when it was for the variable to be like this 10.10. I’m reading the file data like this: var linhas =…
-
4
votes1
answer416
viewsQ: How to copy text from one text file to another
I wanted to copy the text from one text file to another with a different name and add a - at the beginning of the line of the text file. For example: I have a text file with the following text…
c#asked Pedro Azevedo 435 -
2
votes0
answers269
viewsQ: How to read an excel and insert the data into a table?
I wanted to send data from a file Excel for a table on Sql. I tried using the bulkcopy.ColumnMappings.Add but you’re making a mistake. System.Invalidoperationexception The Given Columnname does not…
-
2
votes2
answers1578
viewsQ: How to Perform IF function when selecting Combobox item?
I wanted to know how to make one if function only when the combobox have any item selected. I am making a program in windows Forms and I need a if to limit the program to only do that function when…
c#asked Pedro Azevedo 435 -
0
votes2
answers151
viewsQ: How to map an Excel column to a Database column
I needed help to do the specific mapping of a column of an excel file to a column of a database. I can read the excel file but I just can’t map the file to the column I want in the database. If you…
-
3
votes2
answers12946
viewsQ: How to limit decimal places using C#
I’m having some difficulty limiting the decimal places in C# . double x = 1,41293 I wanted to output only from 1.412 I have tested the following code: Convert.ToDecimal(x).ToString("0.00",…
c#asked Pedro Azevedo 435 -
1
votes1
answer87
viewsQ: How to write data from an excel to an xml file
I would like to be developing a program that has to read excel files and write to an xml file but I don’t know how to write the data to the xml file. I’m reading the excel file like this : var…
-
2
votes1
answer86
viewsQ: How to read an excel file and map
I would like to know how to read an excel file and then map to a datagridview. Code I tried on : var fileName = @"C:\Users\HP8200\Desktop\test.xlsx"; var connectionString =…
-
0
votes2
answers42
viewsA: How to create a date header but in the form of ISO 8601
I have already found a way to solve this problem so I will leave my answer so I can help someone who has the same doubt as me but thanks to those who helped. The answer : MethodInfo priMethod =…
-
2
votes2
answers42
viewsQ: How to create a date header but in the form of ISO 8601
I’m creating a communication with a web api and I needed to create a header date type but formatted to ISO 8601. What I want is to get the following output : Date: 2017-09-13T08:21:08Z My code is…
-
2
votes1
answer810
viewsQ: Creation of a Header that is used in the communication of a Webapi
I am creating a program that communicates with a webapi and is giving me this error in creating the header. I’m using this to create the header : var tempo =…
-
-1
votes3
answers4858
viewsQ: How to write a date in ISO 8601 type
I’m doing a communication program with Apis online and I’m using a header like DateTime and I needed that date to stay on the ISO 8601 how can I do this ? I’m using this to create the header : var…
-
0
votes0
answers287
viewsQ: How can I get information from a datagridview to use in another form
I am making a program in c# and I have a datagridview at Form1 and I have another datagridview on Form2. How can I get the selected cell from the datagridview that is in Form1 and use na as a…
c#asked Pedro Azevedo 435 -
2
votes0
answers40
viewsQ: Error writing file using Sqldatareader
I’m wearing a datagridview to show my table data and I have to create a file with that data, I tried to make the code I will post below but the using (SqlDataReader sqlReader = comm.ExecuteReader())…
c#asked Pedro Azevedo 435 -
0
votes0
answers52
viewsQ: How to write a text file by clicking on a Datagridview?
I have a DataGridView and by clicking on that DataGridView I have to write a file select comparing one column of a table to another column of another table and what results from that select is what…
-
1
votes1
answer358
viewsQ: How to log a post into a web api
I want to know what the Web Api is receiving in the Post that I am sending. This is the code I’m using. var httpWebRequest =…
-
0
votes1
answer579
viewsQ: How can I add Headers to an Httpwebrequest
I am wearing var httpWebRequest = (HttpWebRequest)WebRequest.Create("https://test.net"); to create a server connection and would like to know how I can add headers to the httpWebRequest?…
c#asked Pedro Azevedo 435 -
0
votes1
answer68
viewsQ: How to make a date in ISO 8601 format but still be a Datetime
I wanted to know how I can transform a Datetime into an ISO 8601 format but keep it in a type of Datetime
-
0
votes0
answers108
viewsQ: Error making POST from a json to a Web API
It’s giving me an error when I try to make a POST to the API that error is: System.Net.Webexception: Remote server returned an error: (405) Method not allowed. The code I’m using is: var…
-
1
votes1
answer1346
viewsQ: How to use POST on a json for an Http server
I was thinking how can I post a json to an http server. The code I am using to do json is as follows: Person person= new Person(); product.FirtsName = "Ola"; product.ID = 1; product.age= 10; string…
-
2
votes2
answers1703
viewsQ: How to get information from an App.config
I’m doing a program where I want the user to put in the variable the number you need because it will vary from computer to computer what will be the number you need. I’m using App.config for that…
-
2
votes1
answer172
viewsQ: How to delete lines from a datagridview
I am developing a program in C# and would like to know how I can block/delete an sql line in datagridview. The line I wanted to delete/block is the last one selected in the print, I wanted to know…