I have a query string that works fine if tableStr is for example MSFT. However, if tableStr is BRK-B, the query fails. How do I get around this? Answer Per MySQL Documentation, “The identifier quote character is the backtick (`)”. This means that if your table name has special characters in it, you need to surround the identifier with backticks.
Tag: c#
Trying to publish SQL DB on Visual Studio, I keep getting SQL72025 error
I’m trying to publish a database using Visual Studio, the project has no issues plus I downloaded the (Data storage and processing) toolset. Yet I keep getting SQL:72025 error every time I try to deploy the project. SQL:72025: The referenced assembly .DLL is corrupt or invalid. I get the same message if I try to build the project too. Now
How to export data to already existing excel sheet in C#?
I know how to create a new excel and export data into it. But how can I export data to an already existing excel which have some formats and data validation? Answer Take a look to NuGet library ClosedXML . I used it in the past and it’s really straightforward. Install the package in your solution: from VS: Tools >
Accessing another database user’s tables using Entity Framework
I am trying to access Oracle database using EF Core 6. But the database user given to me doesn’t have any database table. Instead I can see and modify another database user’s tables via SQL DEVELOPER. For example; my user: my user Other user: IFSAPP the following query While returning me a result, does not return any results. With EF
EF Core transaction lifetime
We are using our select statement inside transaction scope because of concurrency concerns. The question is, if I put my transaction in using statement, do I still have to call Commit() method explicitly to be sure that the transaction is closed or Dispose() method will do the job? Here’s example code: Answer The official docs would be your best friend
Convert Sql to linq with groupby
I have view on which I use this request And it’s running sucessfully and get me this data How I need to write it using linq to get same data? I tried like this But on new HumpChartDto() {SpendBand = x.SpendBand} I got Cannot resolve symbol ‘SpendBand How I can solve this? Answer First, after grouping on SpendBand, you need
DataGridView selected row to check a checkbox
I am currently trying to check a checkbox dependent of the SQL data after selecting the row in a datagridview. I have gotten this to display text with TexBoxes, but cannot get it to check a check box. Yes = True No = False Any recommendations, would be very much appreciated. The table being displayed is bound by’binding source’ the
C# Multiple comboBoxes used in MySQL Where
Im trying to learn using MySQl with C# so im creating app that allow sorting and adding data to my tables. That is code that i use to show items selected only by my comboBox_1 value. But now i want to add 2nd comboBox and show data that meets both conditions. The problem is i have no idea how to
How link/bind textbox, dropdown list and SQL database together on C#?
Basically what the task is that you search someone’s name in the textbox, click search, the users with that name will populate the dropdown list. SQL Server: this is the query I am try to add to the search button on my page: Aspx side: C# side: I’ve got this already (this is me attempting to fetch data from the
Why Is My API Not Returning Nested Object (.NET 6 Entity Framework and SQL DB)
I have created an API, using EF and database first approach via scaffolding. I have the following in my context file and then the following in my models Request: Request Line: My Request controller looks like this: In Swagger, it is displayed correctly in the example, based on the model: But when running the GET, what I am actually seeing