How to save SELECT sql query results in an array in C# Asp.net
How can I save the results of an SQL query into an array?
How can I save the results of an SQL query into an array?
I’m working on an application where one can get information on movies from a database as well as add, update and delete the movies. In the database I have three tables (Movie, Genre and MovieGenre <- stores the movies and their genre/s). Everything works fine besides one thing, and that’s when a movie hasn’t got any genres (which should be possible).
I have a table in database with numbers of tenants, each tenant lists a record of their sales per date. There are instance where in a tenant has NO SALES in particular date/s, therefore the date with no sales has NO RECORD in the table breaking a proper date sequence. Please see the sample table for illustration below:
I have database files in my App_Data folder and my web config looks like this
I created an internal website for our company. It run smoothly for several months and then I made a major update due to user suggestion. When I run in live, it run normally. Then suddenly one of my user from japan sending me an “The Wait operation timed out.” error. When I check access that certain link, It run normally for me and some other who I ask to check if they access that page. I already update the httpRuntime executionTimeout but still no luck. Is it the error come from database connection? If I increase the timeout in the database connection it will be fix the problem?
ExecuteNonQuery requires an open and available Connection. The connection’s current state is closed.
I’m using SqlBulkCopy to restore tables from xml backups. One of the table backup is ~200MB large and has a lot of records.
I have a SqlCommand object on my c# based asp.net page. The SQL and the passed parameters are working the majority of the time. I have one case that is not working, I get the following error:
I have a table (Threads) containing a field (id). I would like to select every row from Threads, as well as the number of rows in the table Posts where the field Posts.thread is the same as Threads.id.
I have a checkboxlist. The selected (checked) items are stored in List<string> selected.