This is over my head, and I don't know c#. But when I deal with forms and tables, I tend to use .Visible=false on individual elements to hide them, yet have the data still exist to be referenced later. Not sure it can help you
The conventions don't understand that you wanted UserId to be the foreign-key column for the ApplicationUser navigation property.
As a result, EF assumes that UserId is just a standard string column, which is not connected to anything. It added the ApplicationUser_Id column to serve as the foreign-key link for the ApplicationUser navigation property.
So a program i've had in my head for a while, i've been thinking about how to go about retrieving data over the internet or even lan (securely)
mysql is a possibility, but dealing with the cert files on the client and lack of support for the connector is a pain (mainly due to no longer support for .net 2008, and I plan to make it strict .net 3.5 for compatability reasons)
What I did with one old, unrelated program was (.net 2005) was use PHP to feed XML over https (though it had no signing, I overrode that). This seemed to work fine, but i'm still not sure if this is the BEST way to go about it.
Really I think of the best ways would be PHP/MySQL/XML over lan, but I don't want to expose my scripts
But network (lan) traffic can still be intercepted, packet sniffed, and if unencrypted, exploited.
I'm now looking into possibly mysql over SSH. Disadvantage of course is the app must have the SSH username/password as program variables, which can be extracted. Vs direct MySQL, which you can just have a person login with their own mysql username and password. Is there any way to disassociate SSH with the filesystem/console and just mysql
is there any better way than using XML/SSH for over the internet (yes, not lan). As i'm still not sure if I should do this lan or internet.
This is a computer repair management software, i'm going to initially write it for myself, and maybe later release it, i'm not sure free or pay. If I use an internet web connector, I can enable a payment system for peoples accounts, but if thier internet is out, they can't use it. Lan, they can.
i'm also considering using studio 2012, as the mysql connector does not work in 2008 (says "system cannot find the reference specified")
and as much as i've learned vb.net a few years back, c#.net seems to be closer to PHP, my long learned language. Might consider learning c#
Hi. I want to implement a sending email service using .net core worker service. For doing that I use .net core 3 Worker service and in Worker class and I added NetCore.MailKit 2.0.2 to my project. I added the below lines of code:
public class Worker : BackgroundService
private readonly ILogger<worker> _logger;
private HttpClient client;
public Worker(ILogger<worker> logger)
_logger = logger;
public override async Task StartAsync(CancellationToken cancellationToken)
var message = new MimeMessage();
message.To.Add(new MailboxAddress("Mike", "email@example.com"));
message.From.Add(new MailboxAddress("Elen", "firstname.lastname@example.org"));
message.Subject = "Hi";
message.Body = new TextPart(TextFormat.Html)
Text = "Email for testing"
using (var client = new MailKit.Net.Smtp.SmtpClient())
client.Connect("smtp.gmail.com", 587, false);
//SMTP server authentication if needed
public override async Task StopAsync(CancellationToken cancellationToken)
// DO YOUR STUFF HERE
protected override async Task ExecuteAsync(CancellationToken stoppingToken)
await Task.Delay(1000, stoppingToken);
And the program class is as follows:
public class Program
public static void Main(string args)
public static IHostBuilder CreateHostBuilder(string args) =>
.ConfigureServices((hostContext, services) =>
I could created and deployed the service and when I start it, its status changes to running. Now my problem is, it doesn't send any email to the specified email address. I appreciate if anyone could solve my issue.
Microsoft does not currently recommend, and does not support, Automation of Microsoft Office applications from any unattended, non-interactive client application or component (including ASP, ASP.NET, DCOM, and NT Services), because Office may exhibit unstable behavior and/or deadlock when Office is run in this environment.
There are various ways to create or modify Excel spreadsheets on the server without using Office interop. For example:
Hello experienced people!!
I want to convert a data from text file to IList of X,Y,Z coordinates.
Actually i need to create topography in Autodesk Revit which needs Ilist of X,Y,Z coordinates. the text file which i am having i can manually directly feed into Revit and create topography as its X,Y,Z Coordinates. But using by c# coding in visual studio i need to convert it to Ilist of X,Y,Z coordinates to be ready as an input. Below is the text of my text file which is X,Y,Z separated by commas
The quick and dirty way is to loop over each line, do a string split using the comma and then convert the values from strings. Alternatively, you could use one of the many CSV libraries to read and parse the lines.
I am not sure the subject gives a clear indication of my problem/question.
I am building a set of applications based on a common database. In order to facilitate this I have a VB.NET project that handles all of the database connectivity and manages the tables.
One class in this project "Functionality" has methods for the actual database calls. The connection string is fixed in it.
The other classes in this project are for each table in the database for save, loadrecord, etc. Each of these classes instantiates the Functionality class to select/insert/update.
This project is compiled into a dll.
Other projects which include a stand-alone programme to deal with repetitive tasks and a desktop application, reference the DLL and instantiate the tables classes as required to obtain data, and change it.
Move forward and I now need the entire system to work with a second database. However the database is identical in structure. So the only change is the connectionstring. Obviously I can change this in the Functionality class, recompile the DLL. And recompile the applications and I have a version working with the new database. However, what I want is to be able to switch between the databases on the fly. And this is my problem.
I need someway for the Functionality class to be able know which Database (M or T or A or S) is required by the application that instantiated a table class that is using the Functionality class.
So, the Desktop application can have a Public Shared variable, but this can not be seen by the called method of the table class.
If you understand this, is there anyway of doing what I want?
PrivateSharedFunction CreateConnection() As SqlConnection
Dim connectionString AsString = ConfigurationManager.ConnectionStrings("Functionality").ConnectionString
If you need to access more than one database in a single application, you'll need to modify your classes so that you can pass in the connection string name somehow. You can still read the actual connection string from the configuration file.
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
You can have a static that references an interface (of an object) that you set at runtime to your primary database class from the appropriate Dll (i.e. the "repository").
Windows, in a number of cases, has a "Current" static that references the "app", "main window", etc. The same holds true for your app if you "know" there can only be ONE active repository, or weigh scale, or whatever.
If you already have 2 "database" dlls, I assume there are 2 namespaces; the interface goes into a different namespace from the previous 2 for it to "work".
(and maybe it's just the "connection" component you put in a separate dll and interface (if you want it hard-coded); the rest of the db code can be in the same name space if it's shareable).
It was only in wine that he laid down no limit for himself, but he did not allow himself to be confused by it.
― Confucian Analects: Rules of Confucius about his food
Thank you. Whilst I am not sure I would use an Interface to achieve what I need to do, you have helped me solve my problem.
Using Process I can see the main window's title from the instantiated class, because it is in the myprocess. As long as I have what I need there I can do it. It would be nice to be able to create a property on the process that I could see as easy to see it would be great.
Dim pReturn As Process
pReturn = Process.GetCurrentProcess()
cKey = (Left(pReturn.MainWindowTitle, 3)
All that is needed is a Select Case and I can change to the appropriate connection string for the company using the programme.