Tag: asp.net

Field NULL in SQL

I have a table in DB: REGULAR(num(bigint) not allow null, title(nvarchar(10)), content(nvarchar(500)), path(nvarchar(50)) allow null) with some data: 1.REGULAR1(1|title1|content1|path1) 2.REGULAR2(2|title2|content2|)–> path is not inputed (null) I excute some query in SQL DB server 2008: 1. select PATH from REGULAR where num=’2′; -> result is PATH:NULL But 2. select count(*) from REGULAR where PATH = NULL; […]

Updating records in SQL Server 2005 with ASP.NET 3.5 – HOW TO?

I have ALWAYS used the SQLDataSource to update my records in my SQL Server 2005 database, so i am not really sure how this would be done in normal code. I am using VB.NET but if you are a C# developer and want to show me some code that is more than welcome as well. […]

Example of a very insecure ASP.NET application

I am looking for a very insecure ASP.NET application. Ideally i’m looking for an application that was written by a noob who has made a lot of security mistakes. If the app has a MS-SQL back-end that would be a bonus. I know of two cool projects for PHP and J2EE which fill my needs. […]

How can I insert a variable number of records in one go?

I need to run a variable amount of insert statements. Is it best to run through a loop and execute the query one at a time? Or, is there a way to send all the inserts in one go?

Getting All the record of particular month – Building SQL Query

I need some help to build SQL Query. I have table having data like: ID Date Name 1 1/1/2009 a 2 1/2/2009 b 3 1/3/2009 c I need to get result something like… 1 1/1/2009 a 2 1/2/2009 b 3 1/3/2009 c 4 1/4/2009 Null 5 1/5/2009 Null 6 1/6/2009 Null 7 1/7/2009 Null 8 […]

How to increase my Web Application's Performance?

I have a ASP.NET web application (.NET 2008) using MS SQL server 2005. I want to increase the performance of the web site. Does anyone know of an article containing steps to do that, step by step, in SQL (indexes, etc.), and in the code?

Store very large numbers in scientific notation form in SQL

We have an application which returns result of large calculations in exponent to base form like 1.8e+6. We need to save this value in database. Can we store this in database as integer or it should be converted to a number first ? please help

OR LIKE sql query boolean error

I’m trying to search an employee record but i’m getting this error message: An expression of non-boolean type specified in a context where a condition is expected, near ‘OR’. This is the code I’m using: sConn = new SqlConnection(sStr); daEmp2 = new SqlDataAdapter(” SELECT employee.*, department.Department FROM tblEmployee employee INNER JOIN tblDepartment department ON employee.DeptID=department.DeptID […]

Does SQL Server 2005 pass error message numbers back to the asp.net application?

I’d like to get the message number and severity level information from SQL Server upon execution of an erroneous query. For example, when a user attempts to delete a row being referenced by another record, and the cascade relationship is “no action”, I’d like the application to be able to check for error message 547 […]

Why am I getting “specified cast not valid” here?

I have a column MyColumn of type INT and I am retrieving some rows with that column string selectQuery = $@” SELECT [MyColumn] FROM [dbo].[MyTable] WHERE [Id] IN (‘{testid_1}’,'{testid_2}’,'{testid_3}’) ORDER BY [MyColumn]”; var vals = mydb.ExecuteQuery<int?>(selectQuery).ToList(); where db is of type DataContext. Any idea why this is giving me an invalid cast exception?

MS SQL Server is a Microsoft SQL Database product, include sql server standard, sql server management studio, sql server express and so on.