Tagged Questions
0
votes
1answer
18 views
Can I extract postgresql stored procedure metadata with c#
I want to pass a string containing stored procedure name and retrieve (the metadata) the parameters of that procedure (and/or the body if possible) using c# (the Npgsql dot net provider required)
...
1
vote
1answer
54 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
0answers
17 views
Foreign Key Generation Attributes
About ForeignKey Attribute will it be possible to add an Attribute to make FK constrain deferrable. PostGreSQL support this feature...
[Alias("Registrations")]
public class Registration : BaseFields
...
0
votes
1answer
21 views
EF DataContext, set schema name programmatically
I am currently using EF DataContext with class like this :
[Table(Name = "schema.tablename")]
public class Table
{
[Column(Name = "id", DbType = "serial", IsPrimaryKey = true, IsDbGenerated = ...
0
votes
0answers
17 views
npgsql function that returns “create table” “query string”
instead of copying manually, Is there an npgsql or c# method/function that returns "create table" "query string" of an existing table like the one that displays on sql pane of pgAdmin when you ...
0
votes
1answer
49 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 ...
1
vote
1answer
28 views
Connecting to a Postgres database using Windows Phone 8
I've got a remote database (specifically, PostgreSQL) that I need to connect to and do work on from Windows Phone 8. I tried installing npgsql.dll in my solution for the project, but as it turns out, ...
0
votes
0answers
57 views
How to get Bytea Data in string from Postgres Database
Is there a way to get the actual encoded string saved in the Database of column with DataType Bytea.Because when the record is fetched in C# it returns as System.Byte[] which i don't want. I want the ...
0
votes
2answers
43 views
Generate .NET DataSet file from a query?
I use a Postgres database for my backend for multiple web applications. These applications are hosted on a third party server that I have limited access to. I currently use npgsql and nhibernate for ...
2
votes
1answer
50 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 ...
0
votes
1answer
30 views
Server library could not be loaded and the dynamic link library LIBPQ.dll
Please i have a serious problem here. When i want to debug my application in visual studio i have this message box error : "The ordinal 133 could not be located in the dynamic link library ...
0
votes
0answers
27 views
Postgresql connection error
I am having a problem with my code. The problem is, it always throws the exception when I am trying to connect to Postgres. I am 99% sure that the variables are right, like the variables: table, ...
0
votes
1answer
37 views
Using non-latin characters in connection string UserID for PostgreSQL
I have a project in C# using DavArt dotConnector to connect to PostgreSQL database.
In database I can add role to use it in connection string.
CREATE ROLE "Z111222333";
ALTER ROLE "Z111222333" ...
1
vote
0answers
71 views
Is it possible to use Linq with OrmLite?
We have a system with several apps written in C# under .Net 4.0. One of the apps is a server that handles object persistence to a Ms SQL Server Express Db by sending objects to/from the other apps via ...
0
votes
0answers
59 views
Npgsql and update data in gridview
I'm trying to create my new asp.net website using npgsql. My database looks like this:
[oid, countyname, status]
Using npgsql I've already connected and displayed data in gridview. I've done this ...
0
votes
3answers
60 views
Read a (bad?) id field in hibernate/ nhibernate
I am writing to a database log for my application. One of the fields in the table is userprofile_id which references a username. This is a nullable field, as some stuff gets written to the log ...
1
vote
0answers
84 views
Connect to PostgreSQL from F# using Entity Framework
I'm very new to .Net and F#, so please keep that in mind....
I'm trying to connect to a PostgreSQL with F#, using the Npgsql EF provider. There have been a few posts about the same thing, but none of ...
0
votes
0answers
32 views
NpgsqlException Failed to establish a connection to server
I am using postgreSQL in my application, But some times it throws NpgsqlException after a fixed interval of time.
Below is the stack trace of the exception :
Exception message: Failed to establish a ...
0
votes
1answer
45 views
Return Data Row after Insert with ODBC
I am trying to figure out how to return row from an insert command using c# and ODBC when updating a postgresql database. The table I'm inserting into has a user_id field that uses a sequence to ...
0
votes
1answer
68 views
Connection to PostgreSQL DB failure
I am currently working on a 3.5 .NET C# Project. it uses an external program that takes an argument when I build and run it. The external program goes to index a structured or an unstructured source ...
0
votes
2answers
73 views
Using EF with database first on a remote and secured database
I am wondering if it's possible to use Entity Framework to scan a database and build an EDMX model in the following scenario:
(It's actually a PostgreSQL database and I'll probably use dotConnect, ...
1
vote
1answer
91 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
2answers
193 views
What chars represents new line in postgresql?
I exported data from mySQL and imported them to
PostgreSQL.
Everything went fine except one thing.
Lots of text fields in mySQL had newline in it and now they are imported in PostgreSQL as \r\n. ...
0
votes
2answers
107 views
Postgresql/npgsql cant write when useing danish letters
I get this error when i try to write to my postgresql DB.
NpgsqlException: ERROR: 22021: invalid byte sequence for encoding
"UTF8": 0xe5 0x27 0x2c
It only happen when i use danish letters (æ ø ...
1
vote
1answer
65 views
Analyzing, pre-processing, or post-processing of a log file
I'm trying to do some data mining on log file. It's a flat file that has a massive list of events per line. The file itself can reach upwards of 500MB as well. Each line is a comma-separated variable ...
1
vote
1answer
70 views
NpgsqlProvider and ExecuteStoreQuery
using npgsql provider and entityframework i am trying to write a simple ExecuteStoreQuery like this :
var result = BusinessContextManager.Instance.ExecuteQuery(x => ...
1
vote
1answer
205 views
Delete multiple rows in PostgreSQL with Entity Framework using WHERE IN clause
I have a postgresql database and what I am trying to do is remove a bunch of rows from a table in as few queries as possible. So looping is not a good option. I am using NPGSQL for the postgres ...
0
votes
1answer
44 views
how to add constraint dynamically in postgresql table using c#
I am cloning database table in postgresql using c#.now I also want to add constraints to newly created table.
can anyone suggest way to add constraints dynamically?
I want to add all constraints ...
2
votes
1answer
87 views
Update Command Requires a Valid insertCommand when passed DataRow
I am having problem while executing the following code. Using Ngpsql Data Adapter. The function takes the datatable creates and update query
Parameter string values are dynamically generated update ...
0
votes
1answer
134 views
Can I define custom type mapping for parameters and fields in PetaPoco?
I'm currently trying to pick a C# ORM to use with my PostgreSQL database, and I'm interested in the micro-ORMs, since they allow me to better utilize the power of Postgres(and since full blown ORMs ...
0
votes
1answer
176 views
Insert DataTable Directly to PostGres Database through ODBC
I have a problem I am an average developer of .net applications as I was working in PHP earlier.
I want to insert a populated DataTable directly to Database through ODBC in .net language is C#
Can ...
2
votes
2answers
175 views
PostgreSQL: Inserting High Quantity in Multi Tables with Foreign Keys
So, I'm working on a project that involves inserting a huge amount of data over the course of a day into three main tables. The three tables are all linked to each other.
Here are the tables:
event
...
1
vote
2answers
65 views
NHibernate: Oracle & PostgreSql
I have an application that stores data in database (oracle)
I have simple model
public class FileTemplate
{
public string Xml { get; set; }
...
}
and class map
public class FileTemplateMap ...
1
vote
2answers
194 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
731 views
Postgresql - Create Database & Table dynamically
This code is not working. Can anyone direct me where I can find examples of creating a Postgresql database and table on the fly with C#?
const string connStr = "Server=localhost;Port=5432;
...
4
votes
1answer
126 views
Linq and Entity Migrations with specific schemas in PostgreSQL
With PostgreSQL I can perform queries against tables in a specific schema, or across multiple schemas at once. I'm wondering how to handle two scenarios:
How do you specify either multiple schemas ...
0
votes
1answer
105 views
Reference to lookup table in C# LINQ using PostgreSQL
Good day everyone.
I have several tables in PostgreSql.
Main table
CREATE TABLE main_table
(
main_table_id serial NOT NULL,
... some data fields ...
table_type integer, <--- ...
4
votes
1answer
90 views
Getting Messages back from postgres
I am initiating a vacuum process in postgres from a C# executable. I want the message to be returned back to my executable, but i I'm not able to get the message back from output window.
In short, ...
1
vote
2answers
115 views
Save NpgsqlPoint (Postgresql Point) With Entity Framework
I am trying to save a Point Type into Postgresql
I have tried this way.
(Db table Model definition)
public NpgsqlPoint Position { get; set; }
I set the Object with this method
posData.Position ...
1
vote
0answers
185 views
Update and delete queries in a transaction [closed]
I have two queries (update and delete) in a transaction. The queries are open queries. I am using SQL server to connect to postgresql by creating a linked server.
here is my code:
cn_pg.Open();
...
0
votes
1answer
73 views
connect with postgresql and use query
I want to connect to a postgresql database and use an insert query.
I have done some research but i have no clue what i am doing.
So i don't even know if i am connected with the postgresql.
here is ...
0
votes
1answer
122 views
Running batch script from windows service to dump database
I have a .cmd file with content:
pg_dump -h localhost -p 5432 -U postgres --create --format=plain --encoding=UTF8 --file="D:\temp.snapshot.sql" database_name
That script runs from CMD well without ...
0
votes
1answer
155 views
C# OdbcDataReader.GetBoolean InvalidCastException In IF-Statement
Please forgive my broken English first.
Well,antiduh's method of debug helps me to know what happen on my code,thanks everyone who join discuss.
When I use OdbcDataReader.GetBoolean single,it's OK ...
0
votes
2answers
406 views
The type initializer for 'NHibernate.Cfg.Configuration' threw an exception. Unit Testing
I have UnitTesting project with one TestMethod which calls repository and repository creates new record in PostgreSQL
When I run this test its throws exception:
Message: The type initializer for ...
0
votes
1answer
61 views
Double saved as int in PostgreSql Database using CASE-WHEN
I have a problem updating a table. The number 3,25 is saved as 325. This happens only if i use this UPDATE:
using(var con = new Npgsql.NpgsqlConnection(constr))
{
var UpdCmd = "UPDATE ...
1
vote
1answer
192 views
SSL errors when using Npgsql and SSL certificate authentication
I'm having trouble establishing a connection to a PostgreSQL database that is configured only to accept a valid SSL certificate. I can connect using pgAdmin III with the appropriate certificate and ...
1
vote
1answer
149 views
incremental export and import postgresql C#
I have a PostgreSQL Database, with one table. Each day, I want to export the data WHERE date='whatever' so it ONLY dump the data I've managed TODAY.
Then, I go to another Database, and import that ...
1
vote
3answers
116 views
Manually increment values in database
I have a table structure
id | col1 | col2
1 | 1 | val1
2 | 2 | val2
3 | 3 | val3 --
4 | 4 | val4
5 | 5 | val1
6 | 6 | val6
I want to perform a delete action to delete one ...
0
votes
1answer
81 views
Postgresql multi-row insert using command parameters
I need to insert large amounts of data into postgresql using multi-row inserts.
I am currently doing this by constructing the sql query using a stringbuilder and appending the values but I was ...
0
votes
5answers
97 views
Is there a way to check if one or more rows of a result set sum up to a specific value?
This is kind of a complicated question to phrase so bear with me. Let's say I have a query that return a set of integers.
2387
3357
3471
4885
5867
6170
8170
9777
12970
13190
17670
20470
160159
...