1
vote
2answers
47 views

Entity framework - COUNT rather than SELECT

If I call the GetFoo().Count() from a method outside of my DB class, Entity Framework 5 does a rather inefficient SELECT query rather than a COUNT. From reading a few other questions like this, I see ...
0
votes
2answers
34 views

Getting rid of duplicated data in a GridView

I am getting duplicated data within my GridView, while pulling info from a SQL Server. I am using stored procedures and using some C# to set the parameters then using the SqlDataSource to put the sql ...
0
votes
3answers
44 views

SQL Connection WPF

So i m using this code for my sql connection to connect to local server : public void ConnectToSql(string ServerName, string UserName, string Password) { string strConnection = ...
0
votes
2answers
37 views

Update database via stored procedure from code-behind fails to update

I have worked on this, but unable to figure why my update fails. I'm not big on SQL. I wrote a simple stored procedure. Here is the code: CREATE PROCEDURE [dbo].sp_UpdateTeamMemberProfile ...
1
vote
0answers
18 views

Installing SQL objects in C# - issue when installing CLR assembly and function scripts

I have written some C# to run through specified SQL scripts, separate the commands at the GO batch separator and execute each command. This is so the SQL objects can be installed at the start of the ...
3
votes
4answers
67 views

SQL Server slow inserts - SqlBulkCopy performance

I have a database with 30 million rows. The PK clustered index is a code generated GUID. The table is as follows: CREATE TABLE [dbo].[events]( [imageEventGUID] [uniqueidentifier] NOT NULL, ...
0
votes
1answer
22 views

Get osql output in command prompt

I am using the following code to execute osql command and then get its output (like 2 rows affected etc) but it never finishes. Please let me know what am I missing. string sqlFilePath = ...
0
votes
1answer
38 views

How to get data from SqlDataReader to Array of arrays or Array of strings

I'm trying to populate an array of arrays from a SqlDataReader, but in the end all rows of the array are filled with the same array of numbers. Here's my T-SQL code: SELECT ...
0
votes
2answers
35 views

How to trace Error Log and user activity on database [on hold]

I'm developing a classic web application in ASP.NET C# and I wan't to log on my SQL Server DB: user activity: for example what page users visit,what file was downloade,etc.. web application error ...
0
votes
1answer
29 views

Run a SQL file on .MDF file using C#

I have got a .MDF file at specific location on which I want to run .sql file. I am using following code but it doesn't do it very well. it always gives me error that failed to connect to the server ...
-2
votes
1answer
51 views

Get number of result sets from a SqlDataReader [on hold]

I have a SQL Server stored procedure that returns multiple results. Like Select * from tableA Select * from tableB Select * from tableC How can I get the count of result sets in C#? No count of ...
2
votes
2answers
27 views

ObjectContext.ExecuteStoreCommand doesn't recognise parameter

What am I doing wrong here? ... using (var ctx = ObjectContextManager<MyDataContext>.GetManager("MyDataContext")) { var idsToUpdate = "2,3"; var parameters = new[] { new ...
2
votes
2answers
33 views

Error occur if I use base class to define a key

I get an error for define DbGeography in EF6 (i don't have this Error in EF5) entity type if I use it from base class to define key: for this class : public class University { public int ...
0
votes
0answers
34 views

How to view the database table of each datagridview row?

I can't view the database table I created in each row of the datagridview. As I add a new supplier with a field of SuppID,Company,Address,ContactNo and Status it will create a database table named ...
0
votes
1answer
23 views

Renaming a Field name by accepting values from textboxes…It shows "Unclosed quotation mark after the character string ''

I am using text boxes, textbox1 accepts the value for the existing field and textbox2 accepts new field name. when i click on the button, the corresponding field name i entered in textbox1 in the d/b ...

1 2 3 4 5 534
15 30 50 per page