Skip to content
Advertisement

Tag: c#

Display a ConnectionString dialog

I’m trying to create a program in C# that should be able to create, backup and restore a SQL Server database. For this, the user needs to be able to setup a connection string to the desired SQL Server (and database). I would like to use the same dialog as for example Visual Studio for creating the connection string. Is

Database Data Types and their equivelants in Windows Forms

I’ve read in forums about people having issues with certain data types when accessing a database from their website and windows forms application. Mostly the decimal, float and datetime data types. My DB Table, for example, the Orders table consists of the following Columns. Below each column is the datatype I have chosen to use: My questions are: Is (in

Fastest Way of Inserting in Entity Framework

I’m looking for the fastest way of inserting into Entity Framework. I’m asking this because of the scenario where you have an active TransactionScope and the insertion is huge (4000+). It can potentially last more than 10 minutes (default timeout of transactions), and this will lead to an incomplete transaction. Answer To your remark in the comments to your question:

Generate class from database table

How can I generate a class from a SQL Server table object? I’m not talking about using some ORM. I just need to create the entities (simple class). Something like: Given some table like: Answer Set @TableName to the name of your table.

How to convert last insert id into string?

I have a create account page and on the page I have one button to insert all the details into two seperate tables one of the tables Pictures is dependant on the User table 1:1 relationship via UserID. I have written some code to try get the last insert id so I can insert into the pictures table: Not sure

SQL Server VARBINARY(max) to c# byte[]

I am querying the table (one of the columns is a VARBINARY(MAX)) which returns some records. Then I save that as .dat.csv then I parse through that .dat file and get that varbinary value into a string by splitting the file based on commas. Now I need to convert this varbinary to byte array. How can I do that? Answer

SQL UPDATE Command

Question. I’m trying to use SQL to update a listview in C#. Using the Query Builder I can do a select, update, insert and delete. Ive got my select but I’m trying to get my update to work with no luck.( I want to use the update button on the listview to update the record) I need some insight as

Advertisement