Questions tagged [petapoco]

PetaPoco is a tiny and fast micro-ORM for .NET and Mono.

PetaPoco is a tiny and fast single-file or library referenced micro-ORM for .NET and Mono. It prides itself on being an easy to use and no fuss. Support for all the common databases engines are included (SQL Server, SQL Server CE, MS Access, SQLite, MySQL, MariaDB, PostgreSQL, and Oracle databases).

Single file

PetaPoco is available as a single file nuget package, with or without T4 templates to generate POCOs from an existing database schema. In the single file form PetaPoco has zero dependencies.

Speed

PetaPoco benchmarks done by the author can be found here. (Note that there have been several performance improvements made in the code since these benchmarks.)

Frans Bouma's benchmarks can be found here


See the PetaPoco website for a full list of features.

429 questions
0
votes
1 answer

Petapoco and parameters

Is there a way to use parameters for Insert queries? I get the following error when I try. /// /// Set active survey /// public int SetSurveyActive(int brandId, int surveyId) { Sql sql = new Sql() …
chobo
  • 31,561
  • 38
  • 123
  • 191
0
votes
1 answer

showing exception on declaring new data member in class file using petapoco data access framework

I am using petapoco dataaccess framework, after declaring one new parameter in class file according to database table i am getting the exception below mentioned, in windows service at starting the service. Service cannot be started.…
dotnetexpert
  • 145
  • 2
  • 16
0
votes
0 answers

Petapoco nullable date return null even if table have value

I am using petaPoco as my ORM. Can you please tell me why this returns a null for a nullable date field even though it holds a valid date in the table. I am new to ORM and C# employee emp = db.SingleOrDefault( "SELECT * FROM…
Biju Soman
  • 428
  • 4
  • 19
0
votes
1 answer

PetaPoco transaction isolation level

I have a c# windows service which updates data in my database using PetaPoco, all wrapped into a transaction. However, I need the database to be available for queries while the transaction runs (web app, running queries through an ODBC connection),…
hazard
  • 418
  • 5
  • 10
0
votes
2 answers

PetaPcoro T4 template compilation error

I am running PetaPoco template T4 on my database and it generates the following error: Running transformation: System.InvalidOperationException: Sequence contains more than one matching element Reported from the file 'database.tt My database is…
Liron Harel
  • 10,819
  • 26
  • 118
  • 217
0
votes
1 answer

PetaPoco complex types posting to controller

As per a question that I asked yesterday I was trying to find a way to dynamically create more text boxes and have those map to my view's model so upon post to the server it will grab all the dynamically(js) generated text boxes and post that to an…
jhartzell
  • 283
  • 1
  • 3
  • 12
0
votes
2 answers

What's wrong with this Oracle query?

Below is a query generated by the PetaPoco ORM for .NET. I don't have an Oracle client right now to debug it and I can't see anything obviously wrong (but I'm a SQL Server guy). Can anyone tell me why it is producing this…
Terry
  • 14,099
  • 9
  • 56
  • 84
0
votes
1 answer

Starting with DDD pattern in business layer

I have separated the various layers (Class Library Projects) in my solution explorer like this: I want to use PetaPoco micro-ORM and someone suggested me to add PetaPoco in the Repository layer. As suggested, I added PetaPoco to the Repository…
RKh
  • 13,818
  • 46
  • 152
  • 265
0
votes
1 answer

In which project to add reference to PetaPoco?

I am new to Design Patterns and referring to a book by Scott Millet : Professional ASP.NET Design Patterns. In the chapter where it discusses "Separation of Concerns", I have added projects accordingly in the Solution Explorer: Though the book…
RKh
  • 13,818
  • 46
  • 152
  • 265
0
votes
2 answers

Multiple joins to the same type in PetaPoco

Question: I'm trying to use PetaPoco to join more than four tables to populate an object of type A with five members of type B (very similiar to this question: https://stackoverflow.com/a/11275334/296296). From what I've read it would be possible to…
Mitch99
  • 353
  • 1
  • 4
  • 6
0
votes
3 answers

PetaPoco sample application for Windows forms

I came accross PetaPoco and decided to give it a try Did anyone come accross a sample WindowsForms app with this? So far I only found sample web application. I understand the concept of PetaPoco that is similar to NHibranate but I failed to find an…
Jester
  • 3,069
  • 5
  • 30
  • 44
0
votes
1 answer

How to loop through var to populate a DropDown?

I am using ASP.NET/C# 4.0 with PetaPoco Micro ORM. PetaPoco code retrieves a list of Years in a var. Now I want to populate an ASP.NET DropDown Control with the items in this var. Does PetaPoco provide something to do this in less code?…
RKh
  • 13,818
  • 46
  • 152
  • 265
0
votes
1 answer

How to update PetaPoco model from the database?

I am using PetaPoco Micro-ORM with my ASP.NET 4.0 project. PetaPoco T4 template (Database.tt) generated a file Database.cs. I want to change the name and location of this auto-generated file containing mappings to the database tables. I therefore,…
RKh
  • 13,818
  • 46
  • 152
  • 265
-1
votes
2 answers

Connect to Navision with Petapoco or Dapper using ODBC

I'm trying to connecto to Navision 2.60 using ODBC. I have a static class to manage the odbc connection. I want to use a ORM for mapping entities like Petapoco or Dapper, does anyone have an example of doing so?
danywalls
  • 709
  • 1
  • 10
  • 27
-1
votes
1 answer

Procedure deleterecord has no parameters and arguments were supplied

I wrote a stored procedure for delete record in SQL server database But I Can not send parameters with stored procedures. This is my stored procedure: ALTER PROCEDURE [dbo].[DeleteRecord] AS DECLARE @id INT DELETE FROM Student1 WHERE id =…
Maysam Razzaghi
  • 338
  • 3
  • 18
1 2 3
28
29