Skip to content
Advertisement

Tag: c#

Compare items in a SQL column with array

I have a SQL server table where I want to query for items on rows which have a value equal to an item in Array. Here’s my example: And my array: So, I want to return from SQL rows matching items in the array. my SQL query should return items where column1 matches an item in the array: This all

ConfigurationManager in WPF

I have a config file in a wpf project to store the connectionstring. But when I try to get AppSettings and ConnectionStrings, I get null. the WEB.config file is like this: I tried in several ways: None of them worked. But this one worked: (That means I cannot use a config file, which is against my will) I need help.

Call the maximum from SQL table to textbox

I am working on a Windows Forms C# application and I need to auto generate my invoice number from my database. For that I need to get the maximum value from the database and want to add one with the max value in db, any idea Answer You could design your database table using an IDENTITY column. The database will

SQL Insert Query Using C#

I’m having an issue at the moment which I am trying to fix. I just tried to access a database and insert some values with the help of C# The things I tried (worked) A new line was inserted and everything worked fine, now I tried to insert a row using variables: Didn’t work, no values were inserted. I tried

Performance for using 2 where clauses in LINQ

In LINQ-to-Entities you can query entities by doing: I know that behind the scenes it will be translated to SQL to something similar to: However is there a difference (with respect to performance) if I write: Will it be translated to the same SQL query? From my understanding .Where() will return IEnumerable<T> so the second .Where() will filter the entities

Advertisement