Tagged Questions
5
votes
5answers
379 views
Username, Password and UserType Validation
I have two tables in the database:
Credentials (userid, password, usertype)
Customer ...
5
votes
2answers
90 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 ...
7
votes
1answer
105 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:
...
1
vote
2answers
104 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 ...
4
votes
3answers
652 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 ...
5
votes
1answer
251 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:
...
2
votes
1answer
142 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@
...
3
votes
1answer
86 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 ...
1
vote
2answers
89 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 ...
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 ...
4
votes
2answers
483 views
4
votes
3answers
492 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 ...
3
votes
1answer
179 views
2
votes
2answers
193 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
1answer
198 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 ...
5
votes
3answers
699 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 ...
2
votes
2answers
240 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:
...
-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.
...
1
vote
2answers
392 views
4
votes
3answers
623 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 ...
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 ...
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 ...
1
vote
1answer
920 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
172 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 ...
0
votes
1answer
320 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
1answer
277 views
Products table or Products + attributes when using EF + MVC 4 [closed]
What I need to build is a web application that maintains and shows products. A product has a lot of attributes, some that will be changed or added during the next year. I have 2 options for designing ...
2
votes
1answer
137 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
1answer
405 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 ...
7
votes
3answers
384 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:
...
3
votes
2answers
183 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 ...
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
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
12k 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
...
3
votes
2answers
524 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
595 views
Any improvement on this ridiculously inefficient LINQ query?
I have following (extremely simplified) database structure:
table: Competitions
Id: string, unique
table: ...
4
votes
2answers
395 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
...
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 ...
4
votes
9answers
2k 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 ...
9
votes
5answers
2k views