Tagged Questions
15
votes
1answer
10k views
PostgreSQL and C# Datatypes
I searched type convertion table between PostgreSQL and C#, but I couldn't find anything.
I'll research empty cell on above table if I have time.
But if you know the web page which has these ...
5
votes
1answer
4k views
Entity Framework 6 with Npgsql
I want to use Entity Framework 6 with PostgreSQL in ASP.NET MVC 4 project. I got Entity Framework 6.0.2 + Npgsql 2.0.14.3, but I get error. How do I fix this?
Error:
An exception of type ...
5
votes
3answers
2k views
Using npgsql 12 and ef 6 together - have anyone succeeded with it?
I'm trying to create a small POC for my boss about the hybrid of npgsql 12 and ef6,
created a new project on visual studio
created a sample database
created the corresponding classes and the dbcontext
...
0
votes
2answers
880 views
How to retrieve randomized data rows from a postgreSQL table?
I have a table on a PostgreSQL server database with almost 3 million rows and I need to save all rows to a CSV file. The problem here is that the rows must be saved in a different random order each ...
2
votes
2answers
266 views
Postgresql use alternative character instead of quote for column and table names
Is it possible to use different character instead of " for PostgreSQL table and column names?
Something like:
select [TableID], [TableColumn] from [TableName]
or
select 'TableID', 'TableColumn' ...
1
vote
2answers
655 views
Can't immediately receive multiple notifications in Npgsql
Today i wrote the following code that works with PostgreSQL C# library named Npgsql:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ...
1
vote
2answers
3k views
C# / Postgres / FluentNHibernate : configuring npgsql throws NotSupportedException
Sometimes I really start wondering what's going on in my sourcecode:
I'm trying to connect to PostGres 9.0 using npgsql 2.0.11.0, which I'm damn sure I already did, but right now, my program throws a ...
30
votes
7answers
24k views
C# .NET + PostgreSQL
I'm looking at working on a project which uses C#.NET (sitting on a windows box) as the primary language and PostgreSQL as the backend database (backend is sitting on a linux box). I've heard that ...
6
votes
3answers
1k views
Quoting column names with NHibernate and PostgreSQL
I have started to use NHibernate 3.0 and PostgreSQL for a small project, so far the ride has been a little rough due to the NHibernate site being down and I'm sure this answer is on their website ...
4
votes
2answers
3k views
How to pass parameter to sql 'in' statement?
I want to create this query:
select * from products where number in ('123', '234', '456');
but I can't find any example of achiving this with Npgsql and NpgsqlParameter. I tried like this:
...
3
votes
2answers
5k views
Postgres bytea column is returning string (char array) instead of byte array
I have been using C# to write a concrete provider implementation for our product for different databases. W/out getting into details, one of the columns is of byte array type (bytea in postgres - due ...
5
votes
2answers
11k views
Select clause containing non-EF method calls
I'm having trouble building an Entity Framework LINQ query whose select clause contains method calls to non-EF objects.
The code below is part of an app used to transform data from one DBMS into a ...
2
votes
1answer
154 views
How to select binary data from postgres column
I am.programming an.application in which i am selecting data from postgres database and table name cards.
In.cards we have many columns but two.columns are bytea datatype. It has a blob saved ...
2
votes
2answers
737 views
PLINQ on ConcurrentQueue isn't multithreading
I have the following PLINQ statement in a C# program:
foreach (ArrestRecord arrest in
from row in arrestQueue.AsParallel()
select row)
{
Geocoder ...
1
vote
1answer
1k views
How to make PostgreSQL trigger and C# Windows Service work together?
I want to write a windows service in C# that will wait for a change in the particular table in PostgreSQL database and then operate based on the data from the last inserted row.
As far as I know (I'm ...
0
votes
1answer
653 views
Linq to Postgresql
I have a program written in C#, which uses Linq to NHibernate to access the data. The database backend is Postgres.
In my application, I have a table called contractors, which has 10,000 records. ...
7
votes
1answer
438 views
Recommended approach to insert many rows with Castle ActiveRecord and ignore any dupes
I have a webmethod that inserts a bunch of recipes into a queue in the database (to store recipes the user is interested in cooking, similar to NetFlix's movie queue). The user is able to check off a ...
2
votes
1answer
2k views
How to integreate PostgreSql with EntityFramework 6.0.2?
I am receiving following error
The 'Instance' member of the Entity Framework provider type
'Npgsql.NpgsqlServices, Npgsql, Version=2.0.14.2, Culture=neutral,
PublicKeyToken=5d8b90d52f46fda7' ...
2
votes
4answers
648 views
Sending an automatic email periodically
I have Windows server with PostgreSQL database. I stored in the database employees data including contract expiry date.
I would like to send an automatic email for each employee 30 days before the ...
2
votes
4answers
4k views
Unable to find an entry point named 'InterlockedIncrement' in DLL 'kernel32.dll' - VS2005@Win7 64 bit
I have a problem with my Visual Studio 2005 C# project. I have been using it under Windows XP, since Monday. Then my laptop broke down and on my new one I have Windows 7 64 bit and I am still using VS ...
1
vote
1answer
216 views
Npgsql Error With Column
I have a Model and have the same database table. Both are synchronized. I have another database at some other server and I am ussing the same model for it but different dbContext.
My system what it ...
1
vote
1answer
340 views
Lock table in PostgreSQL
I have a table "Links" with some download links.
My .NET application reads this table, takes the link, creates a web client and downloads the associated file.
I want to create several threads that do ...
1
vote
2answers
394 views
Improve MMO game performance
we are all aware of the popular trend of MMO games. where players face each other live.
My area of concern, is storage of player moves and game results.
Using Csharp and PostgreSql v9.0 via ...
1
vote
1answer
933 views
What is the Date type in npgsql?
I am using postgreSQL database. I need to add "Date" parametres with SQL query. What do I have to write where I wrote in the code "XXX"
Here is the source code:
NpgsqlCommand RupCmd = new ...
1
vote
4answers
4k views
C# and PostgreSQL
Can any one show me working example of using cursor returned from PLSQL to c# code?
I found many examples showing how to fill dataSet with returned data but I cannot find how to use that cursor with ...
0
votes
1answer
469 views
Inserting a duplicate record using Npgsql
I'm trying to insert data into the following table using the Npgsql ADO.NET provider:
CREATE SCHEMA core;
CREATE TABLE core.config(
name TEXT NOT NULL,
value TEXT NOT NULL,
CONSTRAINT ...
0
votes
2answers
430 views
Castle Activerecord error is “relation does not exist” on Postgresql?
ActiveRecord mape:
[ActiveRecord("JobTitle",Schema="public")]
public class JobTitle :ActiveRecordValidationBase<JobTitle>
{
[PrimaryKey(Column = "Id")]
public virtual int Id { get; ...
0
votes
1answer
229 views
Npgsql: Can it recognize ODBC espace sequences?
I have this SQL query (in T-SQL):
--DECLARE @strTerm varchar(300)
--SET @strTerm = 'c'
SELECT TOP 10
USR_ID
,USR_UserName
FROM T_Benutzer
WHERE (1=1)
--AND {fn LCASE(USR_UserName)} ...
0
votes
1answer
970 views
PostgreSQL date C# DateTime
I'm using this query to insert into a table a date:
DateTime dt = DateTime.Now;
String query = "Insert into \"Table1\" (\"tableDate\") values (:date1)";
NpgsqlConnection conn = new ...
0
votes
2answers
1k views
Anyone using ASP.NET MembershipProvider with Nhibernate?
I'm trying to implement Membership controls in a mvc 2 application and i'm having trouble dealing with the MembershipUser class.
I have my own data store (in Postgresql) and I'm using Nhibernate to ...
0
votes
1answer
507 views
How can I provide the table name for a query as command parameter in Npgsql?
I want to provide the table name for a query as command parameters, like so:
public class Foo
{
private const String myTableName = "mytable";
public void Bar()
{
NpgsqlCommand ...