15,894,896 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Member 10558090 (Top 13 by date)
Member 10558090
12-Apr-17 5:55am
View
You're probably right. This will save me a lot of time. I changed varibile in VarChar
and use this query: INSERT INTO ProvaTimbrature (Data, Ora, Codice_Tessera, Verso, Giustificativo, Tipo_Operazione, Lettore, Cognome, Nome, Causale, Matricola_Dipendente, Campo1, Campo2, Controllo) SELECT Data, Ora, Codice_Tessera, Verso, Giustificativo, Tipo_Operazione, Lettore, Cognome, Nome, Causale, Matricola_Dipendente, Campo1, Campo2, Controllo FROM tmpProvaTimbrature WHERE tmpProvaTimbrature.Controllo NOT IN (SELECT Controllo FROM ProvaTimbrature)
Finally, it works.
Member 10558090
11-Apr-17 4:08am
View
"Record in your database the last file size and, next time, start reading from such a position"
Which statment need I to use?
Member 10558090
11-Apr-17 3:52am
View
Alternatively I could do so. Take the last record of the table based on the "Date" fields and "Hour" and start reading from there. It's possible?
Member 10558090
20-Mar-17 12:45pm
View
Code is correct because work for every sku present on website that I want to analyze. The problem is when a sku not exists into website.
I show you two links, maybe I'll explain:
WORKS: http://www.trovaprezzi.it/prezzo_desktop_x3j70et$23abz.aspx
NOT WORKS: http://www.trovaprezzi.it/prezzo_desktop_blablabla.aspx
Substantially, page exists, but not contains html tag that I search. So, DocumentNodes.SelectedNodes responde null.
Member 10558090
4-Nov-15 5:46am
View
I solved conversion problem, but price and availability didn't change.
Member 10558090
3-Nov-15 9:03am
View
DELETE statement require a condition.
For example: DELETE FROM [yourTableName] WHERE youcolumn = youvalue.
If you want to delete all data into your table, without remove columns, you can use TRUNCATE statement.
Member 10558090
3-Nov-15 8:37am
View
I think that you query works, because when I run it on my SQL Management Studio says: "(806 row(s) affected)".
But, if I do:
SELECT * FROM Table1
The column t1.Availability and t1.Price have data "NULL"
Why ?
Edit:
Now, using your query I had this error:
Msg 8114, Level 16, State 5, Line 1
Is a problem to convert data. Because in the first table Price and Availability are VARCHAR and in the second table are DECIMAL(18,4) and INT
Member 10558090
29-Oct-15 6:02am
View
Thank you for your answer. Using your code, output isn't correct.
For example, my first data for campi[14] is 0000000000000004.97.
If i using your code the variable "d" become 497.0 and "s" 497.
My output must to is 4.97.
And, if some price start with 0 like this 000000000000000.97 , I want to became 0.97
Member 10558090
28-Oct-15 12:52pm
View
Ok, I solved all my problems.
Thank you.
Member 10558090
28-Oct-15 7:16am
View
Yes, but I have this error:
Error converting data type nvarchar to numeric.
SqlCommand value and columns in my SQL Table are the same.
int idfornitore = 6;
string connString = "Data Source=192.168.50.18,1433; Network Library=DBMSSOCN; Initial Catalog = Gestionale; User ID=sa; Password=netinfo;";
SqlConnection connessione = new SqlConnection(connString);
string inserimento = "INSERT INTO dbo.ecListinoFornitori (IDFornitore,CodiceArticolo,CodiceArticoloFornitore,Descrizione,Giacenza,GiacenzaData,Prezzo,PrezzoVendita) VALUES (@idfornitore,@codicearticolo,@codicearticolofornitore,@descrizione,@giacenza,@giacenzadata,@prezzo,@prezzovendita)";
SqlCommand cmd = new SqlCommand(inserimento, connessione);
connessione.Open();
using (TextFieldParser reader = new TextFieldParser(txtPercorsoNEXT.Text))
{
reader.SetDelimiters(new string[] { txtSeparatoreNEXT.Text.ToString() });
reader.HasFieldsEnclosedInQuotes = true;
reader.ReadLine();
string oggi = DateTime.Now.ToString("dd-MM-yyyy");
while (!reader.EndOfData)
{
string[] campi = reader.ReadFields();
cmd.Parameters.Add("@idfornitore", SqlDbType.Int).Value = idfornitore;
cmd.Parameters.Add("@codicearticolo", SqlDbType.VarChar).Value = campi[0].ToString();
cmd.Parameters.Add("@codicearticolofornitore", SqlDbType.VarChar).Value = campi[1].ToString();
cmd.Parameters.Add("@descrizione", SqlDbType.Text).Value = campi[4].ToString();
if (campi[5].Contains("N"))
{
int NoStock = 0;
cmd.Parameters.Add("@giacenza", SqlDbType.Int).Value = NoStock;
}
else if (campi[5].Contains("S"))
{
int inStock = 1;
cmd.Parameters.AddWithValue("@giacenza", SqlDbType.Int).Value = inStock;
}
cmd.Parameters.AddWithValue("@giacenzaData", SqlDbType.VarChar).Value = oggi.ToString();
cmd.Parameters.AddWithValue("@prezzo", SqlDbType.Decimal).Value = campi[9].ToString();
cmd.Parameters.AddWithValue("@prezzovendita", SqlDbType.Decimal).Value = campi[9].ToString();
cmd.ExecuteNonQuery();
}
Member 10558090
28-Oct-15 5:16am
View
Hi, can i do something like this ?
connString = "My connection string";
SqlConnection connect = new SqlConnection(connString)
string query = "INSERT INTO ecList (SKU,Description,Price) VALUES (@sku,@description,@price);
using (StreamReader file = new StreamReader(nomefile))
{
string line;
while ((line = file.ReadLine()) != null)
{
if (riga.Trim().Length > 0)
{
string[] columns = line.Split(Convert.ToChar(delimiter));
cmd.Parameters.AddWithValue("@sku", columns[2].ToString();
cmd.Parameters.AddWithValue("@description", columns[4].ToString();
cmd.Parameters.AddWithValue("@price", columns[9].ToString();
cmd.ExecuteNonQuery();
}
}
}
Member 10558090
22-Oct-15 9:14am
View
Yes, ok. But, I have to compare 4 different file, in different formats. Some are TXT and some are CSV.
You have a few examples that I can recommend?
Maybe someone who has done something like this ?
Member 10558090
22-Oct-15 9:01am
View
I give you an example. I sell a notebook that is available from 4 of my suppliers , but each has different prices. I sell the notebook for 3 £.
My vendor sell it at:
1 supplier --> 1 £
2 supplier --> 5 £
3 supplier --> 4 £
4 supplier --> 2 £
I want to update it's price from 3 £ to 1 £ (1 supplier has the best price).
Have you understand now?
I want to know how I can do this with a C# application.
Thank you for your reply.
Show More