Tagged Questions
9
votes
5answers
2k views
7
votes
3answers
387 views
How to optimize this code to get a instant/better result instead of waiting at least 10 seconds every time?
I have the following code that unfortunately is really slow:
...
7
votes
1answer
130 views
Fluent Nhibernate, is the mapping correct?
I'm very new to NHibernate and DB. I have three tables which are connected with many to many relationship.
Here are the tables creation Script:
...
6
votes
2answers
10k views
How to insert multiple rows into a SQL table?
I've written the following C# code to insert rows (that a user enters from a web application) into a SQL database. How does this code look? Is there a better, more efficient way to accomplish the ...
5
votes
5answers
463 views
Username, Password and UserType Validation
I have two tables in the database:
Credentials (userid, password, usertype)
Customer ...
5
votes
3answers
715 views
Lattitude document organizer
I'm not familiar with threads but I am not against them either. A bit of background the original program would have taken about 2 years to run. I had modified it and knocked down that time to around ...
5
votes
2answers
110 views
General select statement to stored procedures
I'm trying to write a general function to several specific stored procedures, but I'm afraid that it will cause errors that I don't see now. The function is to get the name of the stored procedure as ...
5
votes
1answer
1k views
Database Class Creator
Overview
I've written a class that will create C# code. The output is a single .cs file for each table in the default database (the database is defined inside a web.config file). I'm looking for a ...
5
votes
2answers
106 views
Adding object to database, using linq or sql connection
I have a table called tblDelegates in my database which I need to populate with some data. I have created a class called Delegates which has various properties to ...
5
votes
1answer
317 views
Fastest image upload into SQL database
Hello I am trying to upload an image (screenshot from desktop) to SQL database as fast as possible. I would like to optimize my current procedure in terms of speed:
...
4
votes
3answers
826 views
Generic class to call table parametered stored procedures
This code is to allow calling any stored procedure with one user defined table as the parameter.
I usually use Entity Framework, but I just don't need it for my current solution, so I am rolling my ...
4
votes
3answers
597 views
Speed up application and avoid SQL Timeouts
The code works just fine, but recently performace has taken a hit and it has SQL Timeouts far too often. I have it set up so I can run 50 different version of the application two for each different ...
4
votes
2answers
523 views
4
votes
9answers
3k views
Is there a better way to do this database insert? Looking for best-practice example.
I wrote the following code to insert records into a database. The user selects the rows from the RadGrid and the insert command is executed when that user clicks the button. I've been spending a lot ...
4
votes
2answers
398 views
How can I make this code more elegant
I want to make this code as elegant as possible. Let me know some of your feedback
...
4
votes
2answers
4k views
Database Access class
I'm looking for any comments or feedback on my database access class. Security and speed are two things I'm most concerned about.
One thing to note is this class has to work in a C# .NET 2 ...
4
votes
1answer
69 views
Batch of SQL statements in a single query
I'm using the following query for multiple transactions. This is the scenario.
Generate Salary (this is not in the scope of the query)
I have employee attendance in ...
4
votes
3answers
655 views
Handling optimistic concurrency violations
I'm trying to establish a concurrency violation verification in my SQL updates using C# and raw SQL.
What I'm doing now is storing the TimeStamp value in a ...
3
votes
1answer
189 views
3
votes
1answer
1k views
Making async SQL calls
I've written a class to make async SQL calls and it appears to work like a charm! But I'm a bit concerned about what it means to send a lot of queries to the server and then aborting them by throwing ...
3
votes
2answers
190 views
3
votes
1answer
90 views
Retrieving MAC addresses based on PCI interface connections and SQL queries
I am currently using this C# method to retrieve MAC addresses from a user's computer as a sort of unique identification. It retrieves the MAC address based on the fact that the physical card is ...
3
votes
2answers
545 views
Can This LINQ to SQL query be any cleaner?
I am working on a log in form, basically what my code does is search for a user name, then retrieves the hashed password that is related to that account.then converts that string hashed password.then ...
2
votes
3answers
1k views
Convert Sql LIKE to Regex
I have a bit of code that converts a Sql Like expression to a regex expression for the purposes of a Linq to objects Like extension method. For some time I have ...
2
votes
2answers
196 views
Injecting data into XML using a dll
This is a template for one of our data injection tokens.
When I first looked at the template, it was worse than it is now. I would like some input on this because I think that it can be cleaned up ...
2
votes
2answers
2k views
Improving the way a C# application communicates with a SQL database (Via SqlConnection)
*Originally posted this on stackoverflow but was told that it would be better suited here.
So I'm looking for a better way to setup how an application talks with a database. I'm sure this question ...
2
votes
3answers
610 views
Any improvement on this ridiculously inefficient LINQ query?
I have following (extremely simplified) database structure:
table: Competitions
Id: string, unique
table: ...
2
votes
1answer
201 views
build a string of ints for SQL WHERE IN [closed]
What's the best approach for creating on the fly a string of intergers for a WHERE IN clause in SQL
For example@
...
2
votes
1answer
201 views
DAL Efficiency Help
I am attempting my first try at some c#. So far I love it, (not more than vb tho ;)) however, I am wondering if I can make these classes a bit more efficient.
Please note ###Test is my attempts at ...
2
votes
2answers
248 views
Building Session-Variables from a sql stored procedure
I have been advised to submit my code here by a fellow Stack contributer as it was suggested the code could be further improved;
Calling Code and attempt at building session variables:
...
2
votes
1answer
142 views
Building database from file C# Mysql
well as the question reads I am building a database with 3 tables. Now these tables are going to be used to store names in.
Table 1 will store First Names
Table 2 will store Last Names
Table 3 ...
1
vote
2answers
13k views
Inserting Data in The Database using LINQ TO SQL
Can this Code be any shorter? because it seems it is very long with just simple insertion of data using LINQ TO SQL
...
1
vote
2answers
240 views
Critique my database design and help me simplify my code
I wish to create a database for a webpage where users are able to add their own events to a timetable. Users will be able to decide if the events should be recurring (weekly) or not. Users should be ...
1
vote
2answers
115 views
C# to Access SQL query based on UI controls
I have a WPF application (using MVVM pattern) that allows users to perform a search for a record/records based on their ...
1
vote
2answers
440 views
1
vote
2answers
3k views
Need help in MVC Winform example project to add a record into the DB [closed]
I want to learn MVC pattern using winforms and I have read some tutorial to understand.
Now, i'm working on my own example to just add a customer records in a database using MVC pattern.
The ...
1
vote
2answers
105 views
Exposing WCF Service with dynamic search operation
I have this WCF service providing search functionality - to be used by our client in his web application. There can be any number of search parameters and possible nesting of ...
1
vote
1answer
1k views
Hot Observable of Change Tracking Events from SQL Server 2008 R2
After I found the Change Tracking feature in SQL Server, I thought that I would love to have this information in a stream. That lead me to RX, and Hot Observables. Did some reading, and came up with ...
1
vote
1answer
198 views
(More) efficient and elegant way to retrieve data from a dataset?
I have a DataSet with only two tables in it. The first table is a list of models (of products) with default parameters (settings), and the second table is a list of modules. A module is a product ...
1
vote
1answer
410 views
How to dump UCCX stored procedure results via c# to SQL Server
I am writing a simple-ish c# CLI app to improve our telephony reporting system.
At present, I have a nightly DTS package which dumps a couple of tables from the Cisco telephony box into a database ...
0
votes
1answer
349 views
Is this a good way to limit the occurrence of OutOfMemoryException?
I have a class that uses the SqlBulkCopy to bulk insert data into a SQL Server database. My original implementation just passed the m_buffer (which is a reference ...
0
votes
2answers
9k views
Getting data from database and then outputing it to the DataGridView
I am at the point where I feel that I am not doing it right. It works and does the job, but I am sure that there are more efficient and smarter ways of doing it.
I would like to see if there is a way ...
-1
votes
2answers
5k views
Insert to datagridview when SELECT query has WHERE condition [closed]
I use this code to Load and Insert data to a table using a DataGridView in a C# windows application.
...