Skip to content
Advertisement

Tag: c#

Insert a list using dapper.NET C#

I’d like to insert a list of objects in an SQL table. I know this question here but I don’t understand. Here is my class : I’d like to know how could I insert my list using Dapper, I don’t want to iterate on the list and save them one by one, I would like to insert all of them

Custom String Conversion

I want to convert a string that can have two formats. Example 1090512300 to 9.5.123 1090501300 to 9.5.13 The first string (1090512300) will always have the same length but the second(9.5.123) string won’t. The conversion logic is as follows 1 xx yy zzz 00 So string 1 will be 1xxyyzzz00 and string 2 xx.yy.zzz where all zeros have been removed.

Create SQL Server table from user-defined class [closed]

Closed. This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed last month. Improve this question I am creating a mini-ORM to learn reflection better in C#. Also I want to use Native & Pure C# and do

C# win forms app hangs

The following code is for reading from an Access DB and transferring to a SQL DB. Can anyone tell me why this code just hangs after it is run ? I have a label that should change telling me the row that is being processed but the Form just sits and becomes unresponsive once I have clicked the button. Everything

Executing a SQL query with C#

I would like to add some information to my database. I searched for some tutorials, but none of them work. NonQuery can do what he needs to do, because the messagebox returns “Success” (1). But it does not update my database. If I put the same query to “Add New Query”, directly to my database, it works. Can someone help

Generic repository with Dapper

I’m trying to build a generic repository with Dapper. However, I have some difficulties to implement the CRUD-operations. Here is some code from the repository: As you can see, my delete-method takes a TEntity as parameter which is a parameter of type class. I call my Delete-method from my UserRepository like this: The thing is that I can’t write entity.Id

Advertisement