C# is a general-purpose, managed, garbage-collected, object-oriented programming language created by Microsoft.

learn more… | top users | synonyms

15
votes
3answers
345 views

How can I guarantee that inserts to SQL Server 2008 R2 are cached in RAM first?

Imagine a stream of data that is "bursty", i.e. it could have 10,000 events arrive very quickly, followed by nothing for a minute. Your expert advice: How can I write the C# insert code for SQL ...
14
votes
2answers
504 views

Setting up a central CLR stored procedure / function respository library for internal stored procs in other databases to use?

I would like to use code that I developed in C# CLR to be used in all of the databases on the system so that I don't have to set each to trustworthy and turn CLR on and keep a bunch of the same code ...
7
votes
2answers
1k views

how will nvarchar(max) store data in database will it be fast if some data is less then 4000 characters?

I have to develop a CMS which will support two Language English, Arabic. This CMS will be a sort of Article Publishing site. While designing & analysis i found that some articles are more than ...
6
votes
3answers
3k views

3rd party dll in SQL Server CLR

I need to use a third party DLL in a trigger c# code in SQL Server CLR But when I try to add reference it just shows some DLLs from SQL Server. How can I add my third party dll to SQL Server?
6
votes
4answers
6k views

Converting RTF in a text column to plain text in bulk

I have a legacy system with about 10 million rows in a table. In that table there is a column of type text, most of them are standard text but about 500 thousand rows have RTF markup in them. I need ...
5
votes
1answer
625 views

Deadlocks in SQL Server

We're currently encountering a problem with out ASP.NET Application that results in deadlocks on the SQL Server database. A bit of background information I can provide is that we rely heavy on AJAX ...
5
votes
1answer
348 views

Design for file based with many events

I'm not a database guy but I need to design a database to store events for our application. Our client app connects to remote hardware and syncs count data. The count data are csv files split into ...
4
votes
3answers
8k views

Login to SQL Server using Windows Authentication

I have an (.Net Console App) EXE which connects to various SQL databases using SQL server Authentication with appropriate credentials. Now there is change required in the EXE to use windows ...
4
votes
2answers
136 views

why SELECT is still using CPU & DiskIO?

I have a large database, about 30GB. In order to delete some data from a table (most data is in this table, simply because the # of rows), I have to do delete in batch. However, if I delete in too ...
4
votes
2answers
2k views

What server property makes TransactionScope escalating to MSDTC?

In our application we're using TransactionScope's. We're aiming to not use the MSDTC service because it's a lot slower than lightweight transactions. using (var transactionScope = new ...
3
votes
2answers
2k views

How to import a varbinary(max) column with bulk import?

I have a varbinary(max) column that I need to bulk import. The data I'm putting into this column is a byte[] in C#. How do I format the data in the comma-delimited file used for bulk import? In ...
3
votes
1answer
510 views

“Thread was being aborted” error when inserting 25k rows

I need to store about 25k rows worth of data into a single table about once a week. To achieve this, I'm creating an object (created from parsing XML), and sending the data within that object to a ...
3
votes
1answer
3k views

sql server , set N prefix as unicode for all queries by default

Is there any option in ms sql server which use N prefix for my database. There are many query in my application which non of them use N prefix for nvarchar fields , and now I have to set N for all of ...
3
votes
1answer
422 views

Why does DataContext.SubmitChanges() Exist?

I'm not sure if this goes here or on Stack Overflow, but I figure someone here might know it. Why did the developers of LINQ decide that not only do you need ctx.InsertOnSubmit(item); but you also ...
3
votes
1answer
819 views

Daily database maintenance using SQL Server 2008 and a stored procedure

I have created a database maintenance plan using wizard though that link for SQL Server 2005. I have created a Maintenance Plan for SQL Server 2008 and it works fine. Now I required to complete the ...
2
votes
2answers
2k views

Looking for example design of using an SQL database as a queue for throttling web service requests of multiple users

I'm designing a system for multiple users to queue their requests to a web service which takes requests such as creating new entries, changing entries, requesting data. Many of the web service calls ...
2
votes
2answers
895 views

Trace unclosed connections

I get timeout errors every couple of days or so between IIS7 and an SQL 2008 Server. The error message I get is: System.InvalidOperationException: Timeout expired. The timeout period elapsed prior to ...
2
votes
2answers
603 views

Restoring database always throwing exception

I am trying to restore some database backup file into the same database. The .bak file is creating problem always. When I select the .bak file from a network drive like "\\TestPC\ShareFolder\test.bak" ...
2
votes
1answer
430 views

How would you implement conversation groups/ locking for multiple users of a Service Broker Queue?

How do you implement conversation groups for multiple users using their own instance of the user applications but sending related messages to the service broker queue? Any good example of this kind ...
2
votes
1answer
69 views

What is happening with locks in my database?

I'm having some problems on my database. At any given time, I'm trying to execute an update with five records on my table, but this table is locked and I get a time out executing the query. I ...
2
votes
1answer
187 views

Best Practices for Creating and Deleting Records in MYSQL

I'm fairly new to working with databases, but I've currently have a webCrawler that I've written in C# using MYSQL database. The crawler is frequently writing and deleting records from the database ...
2
votes
0answers
121 views

Sleeping connections

I have a dedicated MySQL server(8GB) with following configuration. [mysqld] datadir=/var/lib/mysql socket=/var/lib/mysql/mysql.sock user=mysql lower_case_table_names = 1 ...
2
votes
0answers
212 views

Strugling with updating a cassandra row in FluentCassandra

I have this problem with using Fluent Cassandra in a test application. All I want to do is set the IsOnline field to true inside the SignIn method, but I keep getting the exception supercolumn ...
2
votes
0answers
259 views

going from heirarchical XML to heirarchical SQL tables then SQL to c# objects to go to user view, how should I store the data in the databases?

Hi I'm getting my data from a web service using their getData call and it comes in as fairly chunky heirarchical XML, first everything all at once, like <allData> <product1> ...
1
vote
2answers
416 views

Designing a database tables for the following scenario

I just got following entities Employee, Client and Company. Where Employee and Client have one to many relationship with Company ie A single employee may be mapped to attend to many companies and ...
1
vote
3answers
477 views

What's the solution for corrupted MDF files?

We are working on an MDF file that has been corrupted, because a virus deleted 2 MB from the header of the file. We also have another backup of this MDF File from 3 months ago. Both MDF files have ...
1
vote
2answers
277 views

Trying to connect to PostgreSQL with Entity Framework via Npgsql and C#

So, I'm new to databases and only have done a little with PostgreSQL before. I have C# (visual studio 2012) and have downloaded the Entity framework (6). I have also downloaded the latest Npgsql data ...
1
vote
1answer
156 views

Can geography datatype Lat/Long properties be returned using a view in SQL Server 2008?

Hopefully the question is fairly self-explanatory. I've been ferreting through the, what appears to be quite minimal/poor microsoft documentation regarding both views and geography datatypes in the ...
1
vote
1answer
4k views

How to make stored procedure with outputs OUT sys_refcursor, OUT varchar2, and OUT number, then use in c#.net app

What is the syntax for a stored procedure that outputs a refcursor, a varchar2, and a number? I would like to output all three in the result, for the purpose of displaying count, and a message which ...
1
vote
2answers
2k views

Installing SQL Server Express instance so common users can access

I need to install a SQL Server Express instance (as an admin) which can be later on read and modified by regular users. I run into http://msdn.microsoft.com/en-us/library/ms254504.aspx, and I'm ...
1
vote
1answer
343 views

SSIS 2012 Ftp parallel/asynchronous multiple file download

Any help would be appreciated with either scenario. if Are there any settings available to download multiple files in parallel from an FTP server? else If not, I guess I'll just roll my own via ...
1
vote
3answers
1k views

Local user login access in sql server 2008

I have a created a local user called 'MynetDB' with SQL Server Authentication (password) in SQL server 2008. Server roles is public and user mapping to 2 databases as db_owner and public. Status has ...
1
vote
1answer
525 views

CLR TVF that calls web service is getting 401error

I am calling a web service from a CLR TVF in SQLServer 2008R2. On the IIS server this service has open permissions. When tested using GET or POST requests on a browser the web service works as ...
1
vote
1answer
653 views

Best Format to Bulk INSERT/UPDATE Data to SQL SERVER using C# [closed]

Can anyone tell me what is best way to bulk insert/update data to SQL SERVER 2012 using C#? I have an excel file which I am passing as TVP(table value parameter) to a SP. But this is little bit ...
1
vote
1answer
49 views

Is there a public repo where I can contribute to the MySQL .NET connector?

We have found ourselves making some performance and scale improvements for the MySQL .NET driver from here http://dev.mysql.com/downloads/connector/net/ We know where to get the source in a ZIP ...
1
vote
2answers
583 views

Microsoft SQL Server how can i detach localdb to run on any computer

I am working on a personal project and have implemented a database system using the Entity Framework code first tutorial on msdn, link below, http://msdn.microsoft.com/en-gb/data/jj193542 I am ...
1
vote
1answer
172 views

Database Tasks in C#

We have 2 database environments a "Production" Database and a "Reporting" Database located on different physical windows server 2003 boxes. The reporting Db is derived off the Production database and ...
1
vote
1answer
701 views

Merge Replication from SQL 2008 R2 to SQL 2005 Express: SQL Server version (10.50) is not supported

I'm setting up a (one way) pull, RMO merge replication via web sync from my main database (SQL Server 2008 R2) and clients running SQL Server 2005 Express or 2008 Express (I must support both). I've ...
1
vote
0answers
26 views

Selecting aggregated string from database

I have a table in my database consisting of one column which is NewLanguage(varchar). I insert new languages to the table and I want to select the rows of the table and assign them to a string ...
1
vote
0answers
48 views

Transfer an Advantage Database's Schema/Data to a PostgreSQL Platform Using C# Program

I am currently in the process of writing a .NET program with C# to transfer a database on a Sybase/Advantage 9.1 platform to a PostgreSQL 9.3.4 platform. I am doing this transfer in two stages - ...
1
vote
0answers
142 views

Best practice - SQL Schema to store Timerecords for a Time and Attendance module

I'm starting a time and attendance module in C# and SQL. There will be many time rules depending on every shift. For example: Shift 7:00 - 14:00 for Administratives: 15 min grace time, but if ...
1
vote
1answer
347 views

LOAD DATA INFILE fatal error encountered

I use this query for loading sql data from my pc to localhost mysql database.(version 5.0.10 working witj XAMPP) The query is as below: cmd = new MySqlCommand("LOAD DATA LOCAL INFILE '" + filename + ...
1
vote
0answers
50 views

Rows do not match Subscriber and Publisher

I have an transactional replication setup with updateable subscription that is utilized by an Application. When I insert a project into the application, the msrepl_tran_version is different on the ...
1
vote
0answers
484 views

Remote connection to PostgresSQL in Windows 2008 Server is prompting the error below [closed]

The error: Unable to read data from the transport connection. an existing connection was forcibly closed by the remote host. The conditions: I have the following connection string: server = ...
1
vote
0answers
247 views

Oracle server session terminated by fatal error

I have an Oracle server running on Windows Server. When an INSERT statement runs I receive an Oracle Ora-00603 error. The insert statement just tries to insert a BLOB into a table. I searched the ...
1
vote
0answers
443 views

Can the service-broker cause SQL Server to crash when using SQLDependency

I have C# application that uses SQLDependency to get updates from a message table. I have tested it quite extensively and worked great in the development environment but when I ran it on the ...
0
votes
2answers
86 views

Home rolled gridview search results shows rows that are supposed to be ignored [closed]

Note: I tried posting this on Stack Overflow but didn't get any good bites. I'm still researching this but wanted to see if any db czars can assist here. I'm in the process of trying to troubleshoot ...
0
votes
3answers
2k views

Connecting to SQL Server instance through C# [closed]

I made a program, using c# and sql server with sql authentication. It works properly in my device, but after making the program setup file .exe extension using Innosetup, I cannot connect to my ...
0
votes
1answer
796 views

What is the best practices to backup and restore full and partial database with SQL Server 2012 and C#?

How can I do the following with C#: Completely backup an existing database. Partially backup an existing database. Completely restore an existing database from a backup file. Partially restore an ...
0
votes
1answer
328 views

Get all the database in db2 through web

I would like to get all the databases available on a db2 instance from a C# application. The CLP command to be used is LIST DB DIRECTORY. How can I fire this command from C#? Is there another select ...