Posts by D C • 119 points
14 posts
-
-1
votes2
answers3552
viewsQ: Add values to a C#list
Hi! I am reading values from a table and inserting them into a list. What I have is this: Expiração.Add(rdr["Name" + "Address"].ToString()); Expiração.Add(rdr["Address"].ToString());…
-
1
votes2
answers6013
viewsQ: Printing widgets from a list
Is there any way to read the values that are in a list and present them on the console? I tried it like this, but it doesn’t work Console.WriteLine(lista);
-
0
votes1
answer688
viewsQ: Use DISTINCT SQL Server clause
Hi, I need some help ! I need to do a query and bring in the Nifs without repeating. I do it like this: SELECT DISTINCT NIF FROM CustomerRegistrations But I also want to bring more columns from this…
-
0
votes2
answers19039
viewsQ: Create an executable
Good morning, I made an application in C# recently but it’s still only in code form and I needed to create an executable ! But I’ve never done it, I don’t know how. Can anyone help ? Thank you !…
-
-3
votes1
answer782
viewsQ: Read and insert data into a table via C#
I have this code to insert values in a table column: conn.Open(); comm.CommandText = @"INSERT INTO ArticleBarCode(Code, Code_Article, BarCode, CreatedBy, CreatedOn, ModifiedBy, ModifiedOn,…
-
1
votes2
answers212
viewsQ: Read column values - C#
I need to read the values of a column called Code_article and place them, only when the column is still empty, I execute and immediately gives the error: The object reference was not defined as an…
-
2
votes1
answer6778
viewsQ: The INSERT statement conflicted with the FOREIGN KEY C#
I have this code to insert values into a table: conn.Open(); comm.CommandText = @"INSERT INTO ArticleBarCode(Code, Code_Article, BarCode, CreatedBy, CreatedOn, ModifiedBy, ModifiedOn, IsDeleted)…
-
1
votes1
answer86
viewsA: Insert value in column C#
I changed the code like this, with a Try catch and it worked: conn.Open(); SqlCommand cmd3 = new SqlCommand("SELECT Code FROM ArticleFamily", conn); SqlDataReader rd3 = cmd3.ExecuteReader(); if…
-
1
votes0
answers175
views -
2
votes1
answer86
viewsQ: Insert value in column C#
I have to read a column (which is the primary key of a table) and see if there is the value of a variable in that column, if it does not exist, I want to add it, if it exists, I want to move on. I…
-
0
votes1
answer958
viewsQ: Compare variables with values from an SQL Server table C#
I have 1 table with 2 columns (Code and Value). I’m writing a code in C# and I have a variable taxpercentage. What I need is to return the column value Code, when the variable taxpercentage is equal…
-
1
votes1
answer121
viewsQ: Repeated nodes xml c#
Hi, I needed some help. I have this code: XmlNodeList xnList = doc.GetElementsByTagName("Line"); foreach (XmlNode xn in xnList) { string salescode = xn["ProductCode"].InnerText; if (salescode ==…
-
1
votes0
answers77
viewsQ: Compare childnode with C# and XML variable (Xpath)
I have an xml file with several structures. I have a structure called Product who has a field ProductCode and I have a structure called SalesInvoice, inside of it I have a field Invoice, within the…
-
-2
votes1
answer881
viewsQ: Read data from a column through C#
I have a postcode and divided into 2 variables: the first, where the first 4 numbers appear and the second where the last 3 appear. Ex.: 4300-234 - first = 4300; second = 234. I have a table in the…