I have a simple problem with a not so simple solution… I am currently inserting some data into a database like this: kompenzacijeDataSet.KompenzacijeRow kompenzacija = kompenzacijeDataSet….
Tag: c#
SQL WHERE clause matching values with trailing spaces
In SQL Server 2008 I have a table called Zone with a column ZoneReference varchar(50) not null as the primary key. If I run the following query: select ‘”‘ + ZoneReference + ‘”‘ as …
How do I safely read from a stream in asp.net?
If: Reading from a stream in a single call to Read is very dangerous. You’re assuming all the data will be made available immediately, which isn’t always the case. You should always loop round, reading until there’s no more data. How should I change the above code to make it ‘less dangerous’? Answer Jon Skeet actually has a really good
c# Object obj’s value is {}. What is “{}”?
I’m using some old code that runs a sql query as a reference. At some point, it gets to something like: sqlDataAdapter.Fill(dataSet); DataRow dataRow = dataSet.Tables[0].Rows[0]; Object obj = …
SqlBulkCopy from a List
How can I make a big insertion with SqlBulkCopy from a List of simple object ? Do I implement my custom IDataReader ?
SQL/C# – Best method for executing a query
I need to execute a sql query from within a c# class. I have thought of 2 options Starting a process of sqlcmd. Using a SqlCommand object. My question is which would be the better way? It’s important that the solution only holds a connection to the server for a short time. I’m open to other ideas if the above
Make DataBase portable
I’m developing a local application with a DataBase in SQL Server 2008 and Visual Studio, C#, I created and connected to the Database in the application, but when I pass to work to another computer, copy the all solution files, the information that had been saved in it doesn’t exist, actually the entire Database doesn’t exist, so I ask: have
Is a Union Query needed
I need a little help writing a query. I have this data… I need to query the data and have an output something like this The idea here is to select the direction, the LowNum and then the nextNumber. Also when the direction changes to start over. (That’s why I think I need a Union, maybe get the North, then
Keep local MS SQL 2008 DB table and remote SQL Azure DB table in sync
I have a dedicated server which hosts a Windows Service which does a lot of very heavy load stuff and populates a number of SQL Server database tables. However, of all the database tables it populates and works with, I want only one to be synchronised with a remote SQL Azure DB table. This is because this table holds what
SQL Server Native Client API examples
I am writing a C++ application that needs to execute SQL queries in a SQL Server DB and I want to do it using SQL Server Native Client. The MSDN documentation has no a full reference on it and has a few examples so I am looking for some site having more information on how to connect, execute queries and