Tagged Questions
0
votes
0answers
10 views
npgsql 2.1.3 and EF 6: Could not determine storage version; a valid storage connection or a version hint is required
I'm adding the support to EF 6 to my sql generator for PostgreSQL: PostgreSQL Migration Generator
I have created a test project to try it but when I create a new connection return new ...
0
votes
1answer
49 views
PostgreSQL “Column ”foo“ does not exist”
I'm trying to make a search method for my program. In search page, there are 8 variables a user can search in. For example, If user types only into "Name:" this method will Select according to the ...
1
vote
0answers
75 views
Encoding accented characters with C#
Whene i try to display a message text from an postgresql Exception, the accented characters don't display correctly.
With this code :
catch (Exception e)
{
MessageBox.Show("Incorrect user name / ...
1
vote
0answers
45 views
Do not make integer id column serial?
Schema export automatically generates a serial column.
I tried everything:
mapping.Id(x => x.Id)
.CustomType<int>()
.CustomSqlType("integer")
...
0
votes
1answer
21 views
data extraction from .rpt file to copy in database in PostgreSQL 9.0
I have a report file(.rpt) having text as shown below and this .rpt file get updated every day.
...
0
votes
1answer
26 views
How to check if dotConnect for postgreSQL database connection is right
I've got a excel plugin connected to a PostgreSQL database server and all works well. There is a user interface to switch databases, but when somebody accidentally mistypes the database there are a ...
0
votes
0answers
23 views
Rejecting Insert rows with Entity Framework and PostgreSQL
I use PostgreSQL and EF6 in some project.
I want to reject silently some rows I insert who have duplicated data. The table is very simple, looking like :
CREATE TABLE data
(
table_id PRIMARY KEY
...
0
votes
0answers
19 views
statement for npgsql using parameter
I pass the parameters in the sql query using the driver npgsql:
SqlCommand = new NpgsqlCommand();
....
SqlCommand.CommandText = "SELECT id,name FROM table1 WHERE field1=:param2 ORDER BY name;";
...
0
votes
1answer
39 views
Filtering Invalid Byte Sequences for UTF8 Encoding in C# for a PostgreSQL Database
I have been searching and attempting a lot of different solutions to this problem, but have not found an answer yet. Basically, I am inserting data from an ODBC connection into a PostgreSql database ...
2
votes
1answer
81 views
PostgreSQL error: query string argument of EXECUTE is null
I have a table called evidence with a trigger which calls a stored procedure which basically does table partitioning by month. However I get an obscure error when I start inserting lots of rows under ...
1
vote
0answers
36 views
Trying to using EF 6 with PostgreSQL - Failed to find or load the registered .Net Framework Data Provider
I am trying to use EF 6 Code First with Npgsql provider. When I try to run Add-Migration command in package manager I have the following exception: Failed to find or load the registered .Net Framework ...
0
votes
1answer
38 views
Make a new table in DB to extract data from an already existing large table
I am working on a database which has around 2 year data and has around 10 crore rows and 30 columns with values of every 10 seconds of different parameters. I want to create a new table which will ...
0
votes
1answer
108 views
Wrong query generated by PostgreSQL provider to Entity Framework for Contains and Concat
I'm using EF to connect to PostgreSQL. EF is in 5.0 version, Npgsql in 2.0.14.3.
The query that I want to run is:
var list = new List<string> { "test" };
var res = from t in db.Test
where ...
0
votes
1answer
48 views
Linq and Lambda Expressions with postgreSQL database
Is it possible to use Lambda Expressions to query a PostgreSQL database in C#?
I've tried with ODBC and with Npgsql, but haven't found a way to do so yet.
What I would like to do is something ...
0
votes
1answer
18 views
Update command using Npgsql postgres and C#
I have created a search form to locate a record based on a search value called license ID. I am able to pull the all the fields for that value. My question is I am trying to update any field for that ...
0
votes
1answer
27 views
PostgreSQL C++ Api getting error LNK1107: invalid or corrupt file: cannot read at 0x2E8
I try libpqxx and pg_bulkload for C++ data bulk loader from my Simple C# App.
Because this two libs on my PC not finally supported.
I now , new create simple DLL project,with native PostgreSQL libpq ...
1
vote
1answer
117 views
Create PostgreSQL Database with case-sensitive name using npgsql
I'm trying to create a PostgreSQL database using the npgsql library, but the database name always ends up in lower case. Is it possible to preserve the case or should I just lower case everything? I ...
3
votes
1answer
163 views
System.Data.Common.DbCommand: Parameterized Query as Procedure Parameter?
I have procedure in PostgreSQL defined as:
CREATE OR REPLACE FUNCTION CreateCursorC(text, text)
RETURNS text
LANGUAGE c
AS '$libdir/mylibs', $function$createcursorc$function$
Execute example:
...
0
votes
0answers
67 views
How to retrieve notice/warning from trigger in postgres with npgsql.net library?
I am trying to retrieve a warning or notice thrown by a trigger in c# client code using npgsql.net library. How can I accomplish that? I know that in the case of error an exception is thrown but what ...
0
votes
1answer
46 views
Drop Postgresql database
I am trying to drop a database from aspnet(c#). But It is giving me an error: There are some connections.
If I delete all the connections:
SELECT pg_terminate_backend (pg_stat_activity.pid) FROM ...
0
votes
1answer
243 views
NpgsqlCopyIn fails by timeout (“CommandTimeout” setting ignored)
I have a quite large dataset (900K records, 140Mb disk space) stored in CSV file in a client app (.NET 4.0). I need to load this data to Postgres 9 db the fastest way. I use Npgsql "NpgsqlCopyIn" ...
0
votes
1answer
35 views
How to get the value of selected row from PostgreSQL in C#?
I am using PostgreSQL database with C# and the Npgsql library.
Right now I can select the last row in my table, but I can not figure out how to assign a C# variable to it. I know that my selection ...
0
votes
1answer
35 views
The underlying provider failed on ConnectionString PostgreSql EF6
My web.config:
<system.data>
<DbProviderFactories>
<remove invariant="Devart.Data.PostgreSql" />
<add name="Npgsql Data Provider" ...
2
votes
1answer
69 views
Remove all special characters from string
For example tableA contains two columns called prodid and product. productcolumn consists of more than 100 rows the rows may contain product names with some special characters like * , ' [ ( ] ) # ...
0
votes
0answers
21 views
Npgsql first connection takes a long time
I am using PostgreSQL 9.3 and npgsql 2.1.3 on Windows with .NET 4.0. I installed PostgreSQL with default settings and running as a service. I use Npgsql in a WPF project in order to test Binding the ...
0
votes
1answer
43 views
Connecting to POSTGRES database using DataSet for Simple Report in C#
I'm using Simple Reports in Visual Studio 2012, c# language, and when I try to connect my data from database using DataSet, I cannot find my postgres database (w/c is 64bit, version 9.3) in creating ...
0
votes
0answers
59 views
Entity Query in Query, is it possible
I'm not really sure how to ask this question. I need to create an object, I believe it is called a projection, that has the result of one query, plus from that need to query another table and get ...
0
votes
1answer
12 views
Adding Controller in Web.Config for MVC4 error
My project is a Web project for MVC4 and I am trying to add a controller after adding a connection string to the web.config folder, but every time i try to add it, i get the following message:
...
0
votes
2answers
51 views
Using ON UPDATE CASCADE when update causes duplicate values
In PostgreSQL, I have one master table, ICD9, that is intended to hold unique combinations of cicd9 and cdesc with the constraint of:
CONSTRAINT constraint_cdesc UNIQUE (cicd9, cdesc)
I have ...
0
votes
0answers
32 views
Error when trying to lookup database
I have a button that has code attached to it:
DataTable pieteikumu_tabula = new DataTable();
NpgsqlDataAdapter adapter = new NpgsqlDataAdapter();
adapter.SelectCommand = new ...
1
vote
1answer
149 views
How can I get output values into output parameters?
I am using C# in VS 2008 to retrieve data from a PostgreSQL stored procedure that has two input parameters and two output parameters. When I created the procedure, PostgreSQL told me that I had to ...
0
votes
0answers
55 views
WinForm PostgreSQL Notification Messaging
I built a simple C#/.Net console application a while ago that alerts me to when a table is updated in PostgreSQL. The following code is that working version. I get the messages without issue and ...
0
votes
3answers
85 views
Ugly time format in GridView ASP.NET C#
In my ASP.NET project I have a GridView to display times (among other things). I'm using Visual Studio 2012 and PostgreSQL and pgAdmin.
In the database times are stored in tbl_tid as:
This is also ...
0
votes
1answer
58 views
Additional statements in npgsql transactions
When profiling (on the database side) the communication between a client using Npgsql and our Postgres server, I see some additional statements being run during every transaction.
A sample log:
...
1
vote
1answer
79 views
How to use a serial field with Postgresql with Entity Framework Code First
I have a serial field (called displayID) that is not the key of the table in a postgresql database and I am working with entity framework code first. When I add new objects into the database through ...
0
votes
0answers
32 views
Alias Table in From Clause
I am trying to alias the table in the from clause of the query, using Simple.Data.
Below is an example (this is simplified, so please don't suggest other ways of running the query).
Simple.Data ...
0
votes
2answers
99 views
SQL in booking system
I'm building an asp.net application using C# and postgreSQL database. The application is a booking system for a doctors office.
I have the following table for booking appointments:
I have the ...
-1
votes
2answers
103 views
How to write SQL to display short date and time
I'm building a web application in asp.net using C# and postgreSQL database. The application is a booking system for appointments.
In a listbox I print the date, time and name of a certain ...
0
votes
1answer
74 views
Not able to get value from drop down list, c#
In page load I'm loading a drop down list with names from a postgreSQL database, using SQL.
Later in the code I want to save the selected value in the drop down list into a string variable.
That won't ...
2
votes
1answer
226 views
Create a dynamic alert box in ASP.net C# using a database listener which can be triggered without using a button click
I have a ASP.NET web site and i need to create a custom alert box which can be triggered without using a button click but using a database listener.(I'm using PostgreSQL database.) since I'm new to ...
0
votes
0answers
39 views
Convert from DB type to Model type
I am trying to get hstore from database and want to store it in dictionary.
So to simplify lets say I have a table with column named flag, which is of type string which will always contain only ...
0
votes
0answers
75 views
Dealing with Varying Data Types WIth C# Database.SqlQuery
I'm using .NET 4.5 and Entity Framework 6.
I have to use a pre-built SQL string and execute it against a PostgreSQL database. I'm currently using [DBContext].Database.SqlQuery() to pull these values, ...
1
vote
1answer
64 views
How to Backup/Restore PostgreSQL using code?
i have tried this method but it doesn't working anyone can correct it or share some tutorial for Backup/Restore PostgreSQL using VB.NET
and these methods are using to backup/restore
here commandType ...
1
vote
0answers
40 views
translate postgres sql to linq. Is it possible?
I need translate next sql to linq is it possible? That will have approximately the same speed
SELECT Count(tblcollectionimage.lngimageid),
tblcollectiontree.lngcollectionid,
...
0
votes
1answer
56 views
C# UUID Version 4 standalone generator and UUID validation
For my distributed storage keys I want to use UUID v4, and .NET Framework's System.Guid gives me exactly that. However, I cannot test right now if Mono gives the same v4? Is there a standalone v4 ...
0
votes
1answer
135 views
Entity Framework 6 Optimistic Concurrency with PostgreSQL
I'm using the Npgsql .Net data provider for PostgreSQL (version 2.1.0-rc1), Npgsql for Entity Framework (version 2.1.0-rc1) and EF (version 6.0.2) Code First migrations. In my entities I have:
public ...
0
votes
1answer
150 views
failed to connect postgres database running on heroku
i want to view data table on my postgres database running on heroku.i can view my table throw view.php which was included to same server.but when i try to connect pg database throw c# ,it gives me ...
0
votes
0answers
36 views
pg_notify not sending payload text while using Npgsql inside Visual Studio
This is what I am doing.
In my PostgreSQL database, When an INSERT is made into my table, I trigger the pg_notify with a payload. Here is the script:
This is the trigger-
CREATE TRIGGER ...
0
votes
0answers
49 views
Coalesce equivalent in Linq
I need to know what the PostgreSQL coalesce() equivalent is in Linq. I read that it was the ?? operator (source), but that doesn't seem to work.
I have a string query that will be run in linq. The ...
0
votes
0answers
22 views
NHibernate Mapping - No Persister For : [Class] [duplicate]
here i want to ask about my NHibernate in my .net program, i got an error, while i'm trying to save it to DB.
My DB is postgres, and here is my class
using System;
using System.Collections.Generic;
...