|
I know the feeling - I was working for a Terminal manufacturer, just before the advent of the PC and they bought an APL company (they made APL interpreters if I recall correctly). So they wanted a APL terminal, which meant I had to sit down with these guys and work out what they actually needed. Took forever to get it all up and running on a Z80 (with 8K RAM and 32K ROM) but it worked pretty well, I think. Don't think we actually sold any, or at least I never got a single bug report ...
Sent from my Amstrad PC 1640
Never throw anything away, Griff
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
You programmers seem to think and speak in the most peculiar, esoteric terms I've ever heard in my life.
|
|
|
|
|
Nah, we actually make sense when you understand the terms - just there is a lot of complexity and a need to be precise about what we are saying so there are a lot of technical terms.
Compare that with doctors, where the technical terms are there to make it hard for non-medical staff to understand: "Clavicle" for "Collar bone"; "Sphenopalatine ganglioneuralgia" - "ice cream headache"; "Synchronous diaphragmatic fluttering" - "Hiccups"; "Sternutate" - "Sneeze"; "Borborygmi" - "Tummy rumbles"; "Horripilation" - "Goose bumps"; and so on ... they aren't there to make things any clearer!
Sent from my Amstrad PC 1640
Never throw anything away, Griff
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Perhaps one day you'll take a course in Computer Science.
«Where is the Life we have lost in living? Where is the wisdom we have lost in knowledge? Where is the knowledge we have lost in information?» T. S. Elliot
|
|
|
|
|
Name spaces help to avoid "name collisions" when you start creating "solutions" that have multiple "classes", in multiple "projects". A "console app" can easily wind up becoming something "bigger" where the benefits of name spaces become more obvious.
Besides allowing one to "split" a "partial" class across multiple source files, partial classes also allow you to "extend" a 3rd party or "generated" source code (class) file without modifying the original. (e.g. Entity Framework "entity" classes)
The Master said, 'Am I indeed possessed of knowledge? I am not knowing. But if a mean person, who appears quite empty-like, ask anything of me, I set it forth from one end to the other, and exhaust it.'
― Confucian Analects
|
|
|
|
|
xlApp.Workbooks.Open(filePath, 0, false, 2, " ", " ", false, XlPlatform.xlWindows, " ", true, false, 0, true,
xlWorkSheet = (Worksheet)xlWorkBook.Worksheets.get_Item(1));
System.Runtime.InteropServices.COMException: 'Exception from HRESULT: 0x800A03EC'
Thank You in Advance for your kind consideration
|
|
|
|
|
This code won't even compile. You're making an assignment in an argument being passed to Open. That's not going to work.
Also, are you opening a password protected workbook? You're supplying a password, a space character, when opening the workbook. That is NOT the same as leaving the password parameter as empty or having "no value".
You didn't specify what type of app you're writing, Windows Forms, Windows Service, WPF, ASP.NET, MVC, ... Yes, it matters. You cannot use Excel interop in a web application, like ASP.NET or MVC, or a Windows Service app.
|
|
|
|
|
Yes Thank You! I also was wondering about the password parameter! Your information is helpful and Thank You for your Time
|
|
|
|
|
hello!!!! my C# code is not going on i have some difficulties to write on my database(postgresql with pgadmin4) this is my code please help me
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Npgsql;
using NpgsqlTypes;
using WindowsFormsApplication1.Beans;
namespace WindowsFormsApplication1
{
public partial class inscription : Form
{
public static Client client;
DateTime date;
string Conx = "Server=localhost;Port=5432;Database=postgres;User=postgres;pwd=yannick93";
NpgsqlCommand MyCmd = null;
NpgsqlConnection MyCnx = null;
public inscription()
{
InitializeComponent();
}
private void label1_Click(object sender, EventArgs e)
{
}
private void label4_Click(object sender, EventArgs e)
{
}
private void textBox1_TextChanged(object sender, EventArgs e)
{
}
private void b_annuler1_Click(object sender, EventArgs e)
{
}
private void b_confirm1_Click(object sender, EventArgs e)
{
String nom = esp_nom.Text;
String prenom = esp_prenom.Text;
String adr = esp_adr.Text;
String ville = esp_ville.Text;
String pass = esp_pass.Text;
String confirm = esp_conf.Text;
if (nom == "" || prenom == "" || adr == "" || ville == "" || pass == "" || confirm == "")
{
MessageBox.Show("veuiller entrer tous les parametres", "parametres manquants");
}
else
{
if (!pass.Equals(confirm))
{
MessageBox.Show("veuillez bien saisir votre mot de pass", "erreur de confirmation");
}
else
{
Connexion connect = new Connexion();
try
{
date = DateTime.Now;
String dateh = date.ToShortTimeString();
String datej = date.ToShortDateString();
var tabh = dateh.Split(':');
var tabj = datej.Split('/');
String h = tabh[0];
String m = tabh[1];
String j = tabj[0];
String mois = tabj[1];
String an = tabj[2];
String dnom = nom.Substring(0, 1);
String id = "dif-" + dnom + h + m + j + mois + an;
client = new Client(id, nom, prenom, adr, ville, pass);
string insert = "INSERT INTO client(id,nom,prenom,adr,ville,pass) values('" + client.id + "','" + client.nom + "','" + client.prenom + "','" + client.adr + "','" + client.ville + "','" + client.pass + "')";
MessageBox.Show("erreur d'accessibilite 2", "error2");
NpgsqlCommand MyCmd = connect.con.CreateCommand();
MyCmd.CommandText = insert;
MessageBox.Show("erreur d'accessibilite3", "error3");
MyCmd.ExecuteNonQuery();
MessageBox.Show("erreur d'accessibilite4", "error4");
connect.con.Close();
MessageBox.Show(dateh, datej);
}
catch (Exception)
{
MessageBox.Show("erreur d'accessibilite", "error");
}
}
}
}
public void InsertPersons(string nom, string prenom, string tel, string adresse)
{
MyCnx = new NpgsqlConnection(Conx);
string insert = "INSERT INTO \"client\"(id,nom,prenom,adr,ville,pass) values(:id,:nom,:prenom,:adr,:ville,:pass)";
MyCnx.Open();
MyCmd = new NpgsqlCommand(insert, MyCnx);
MyCmd.Parameters.Add(new NpgsqlParameter("id", NpgsqlDbType.Varchar)).Value = client.id;
MyCmd.Parameters.Add(new NpgsqlParameter("nom", NpgsqlDbType.Varchar)).Value = nom;
MyCmd.Parameters.Add(new NpgsqlParameter("nom", NpgsqlDbType.Varchar)).Value = nom;
MyCmd.Parameters.Add(new NpgsqlParameter("prenom", NpgsqlDbType.Varchar)).Value = prenom;
MyCmd.Parameters.Add(new NpgsqlParameter("tel", NpgsqlDbType.Varchar)).Value = tel;
MyCmd.Parameters.Add(new NpgsqlParameter("adresse", NpgsqlDbType.Varchar)).Value = adresse;
MyCmd.ExecuteNonQuery();
MyCnx.Close();
}
}
}
this my error
<pre>A first chance exception of type 'System.InvalidOperationException' occurred in Npgsql.dll
The thread 'vshost.RunParkingWindow' (0x338) has exited with code 0 (0x0).
The thread '<No Name>' (0x1658) has exited with code 0 (0x0).
The program '[7312] WindowsFormsApplication1.vshost.exe: Program Trace' has exited with code 0 (0x0).
The program '[7312] WindowsFormsApplication1.vshost.exe: Managed (v4.0.30319)' has exited with code 0 (0x0).
|
|
|
|
|
run the debugger and inspect the string "insert" and see if you can run that directly using one of the postgresql clients. This will most likely identify the issue.
Also read up on sql injection attacks as you are inviting someone to destroy your database.
Never underestimate the power of human stupidity -
RAH
I'm old. I know stuff - JSOP
|
|
|
|
|
The annoying thing is that he has already copy'n'pasted the code to avoid SQL Injection elsewhere without understanding what the heck he is doing or why...
Sent from my Amstrad PC 1640
Never throw anything away, Griff
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
PLEASE i do not understand well what you are saying
|
|
|
|
|
Quote: read up on sql injection attacks as you are inviting someone to destroy your database.
What that means is this: never concatenate strings to build a SQL command. It leaves you wide open to accidental or deliberate SQL Injection attack which can destroy your entire database. Always use Parameterized queries instead.
When you concatenate strings, you cause problems because SQL receives commands like:
SELECT * FROM MyTable WHERE StreetAddress = 'Baker's Wood' The quote the user added terminates the string as far as SQL is concerned and you get problems. But it could be worse. If I come along and type this instead: "x';DROP TABLE MyTable;--" Then SQL receives a very different command:
SELECT * FROM MyTable WHERE StreetAddress = 'x';DROP TABLE MyTable; Which SQL sees as three separate commands:
SELECT * FROM MyTable WHERE StreetAddress = 'x'; A perfectly valid SELECT
DROP TABLE MyTable; A perfectly valid "delete the table" command
And everything else is a comment.
So it does: selects any matching rows, deletes the table from the DB, and ignores anything else.
So ALWAYS use parameterized queries! Or be prepared to restore your DB from backup frequently. You do take backups regularly, don't you?
Sent from my Amstrad PC 1640
Never throw anything away, Griff
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
i doont no how to run the debugger
|
|
|
|
|
Then learn!
The debugger is the biggest, badest, best tool in your box: chances are you will spend more time using that than you will your editor - even when you get more experience - because as you advance, so your code becomes more complex, and testing and diagnosing problems also becomes more complicated.
So find out how to use the debugger, and start finding your problems. Judging by the amount of HTML there is stuffed into your sample, you are using VS Code, so start reading here: Debugging in Visual Studio Code[^]
If you aren't, then start here: Navigate code with the debugger - Visual Studio | Microsoft Docs[^]
Sent from my Amstrad PC 1640
Never throw anything away, Griff
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
|
Ok so you do not know the basics of software development, you should get a beginners book and work through the examples as you read the book BEFORE you start trying to build.
Never underestimate the power of human stupidity -
RAH
I'm old. I know stuff - JSOP
|
|
|
|
|
I am developing C# application compatible with ZKTeco finger device
therefore, when I can connect to device then when I enroll new employee to finger
device it shows bidirectional error.
please if someone knows that
|
|
|
|
|
You should talk to the people who created it - they should provide technical support and will know more about their product than we will. If they don't, then find another supplier and demand your money back!
Sent from my Amstrad PC 1640
Never throw anything away, Griff
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
inho, another case (see my post) that illustrates why a requirement the OP search CP for resources prior to posting would be valuable. And, yes, I know that would be "iffy" to implement.
«Where is the Life we have lost in living? Where is the wisdom we have lost in knowledge? Where is the knowledge we have lost in information?» T. S. Elliot
|
|
|
|
|
CodeProject is your friend: "C# ZKTeco Biometric Device Getting Started" by Ozesh Thapa, 2019: [^]
«Where is the Life we have lost in living? Where is the wisdom we have lost in knowledge? Where is the knowledge we have lost in information?» T. S. Elliot
|
|
|
|
|
I am joining two list<t> type and each list has more than 800000 records.
may be this huge records causing this issue. my pc is 64 bit and 8GB RAM. i have windows 7 OS installed.
var QCViewAllHistValue1 = (from frmlst in cfList
join viewalllst in QCViewAllBrokerList1
on new
{
val = String.IsNullOrEmpty(frmlst.Section) ? "" : frmlst.Section.Trim().ToUpper(),
val1 = String.IsNullOrEmpty(frmlst.xFundCode) ? "" : frmlst.xFundCode.Trim().ToUpper(),
val2 = String.IsNullOrEmpty(frmlst.Period) ? "" : frmlst.Period.Replace("A", "").Replace("E", "").Trim().ToUpper(),
val3 = String.IsNullOrEmpty(frmlst.Broker) ? "" : frmlst.Broker.Trim().ToUpper()
}
equals new
{
val = String.IsNullOrEmpty(viewalllst.ViewAllSection) ? "" : viewalllst.ViewAllSection.Trim().ToUpper(),
val1 = String.IsNullOrEmpty(viewalllst.xFundCode) ? "" : viewalllst.xFundCode.Trim().ToUpper(),
val2 = String.IsNullOrEmpty(viewalllst.ViewAllPeriod) ? "" : viewalllst.ViewAllPeriod.Replace("A", "").Replace("E", "").Trim().ToUpper(),
val3 = String.IsNullOrEmpty(viewalllst.ViewAllBroker) ? "" : viewalllst.ViewAllBroker.Trim().ToUpper()
}
select new QCHelper()
{
Value = viewalllst == null ? string.Empty : (viewalllst.Value == null ? string.Empty : viewalllst.Value),
}).ToList<QCHelper>();
cfList & QCViewAllBrokerList1 these are two List<t> type. i am joining these two list and getting out of memory exception
i follow these two below links but there suggestion does not work for me.
https://stackoverflow.com/a/17322112/10839668
https://stackoverflow.com/a/53424048/10839668
please guide me how could i get rid of out of memory exception. thanks
|
|
|
|
|
That query is such a dog breakfast that I'm not surprised it fails. You are probably creating the equivalent of an outer join and getting 800k * 800k records.
I would ask a couple of question of the requirements, why do you need 800k records in the client and how do you expect to use the collection when you have it.
If this was my problem I would create a view in the database to validate the joins and then select on the view with a filter (you cannot consume 800k record in the client).
Never underestimate the power of human stupidity -
RAH
I'm old. I know stuff - JSOP
|
|
|
|
|
My question is .Net can not handle big data when run on 64 bit processor?
so many company work with huge data...how they handle it. as per our client requirement i have to work with xml file. we store data in xml not in db. this is client requirement.
any good suggestion please.
|
|
|
|
|
Up until .NET 4.5, there was a hard limit on the size of any single object, which was 2GB. With .NET 4.5 and above, that limit ins't hard set any more. You can set an option in your apps App.Config file to remove that limit.
See With .NET 4.5, 10 years memory limit of 2 GB is over | Bahrudin Hrnjica Blog[^] for a short explanation.
But, you still have a problem. There is only ever so much memory in a machine. If your .XML file grows (and do NOT make the mistake of saying it never will!) you will eventually run out of memory, even on a 64-bit machine.
|
|
|
|
|