Tag: asp.net

create one insert stored for multiple tables

I had applicant project with multiple pages as the user will go through these pages to complete his applicant data then at the last page he will find submit the data. My problem is that, I have multiple tables and when the user submit his data the data will inserted into it’s table , so […]

Trying to extract image from SQL Server in .NET, getting UnauthorizedAccessException

I am trying to extract a byte string in .NET from a SQL Server database and convert it to an image. My Code looks something like this Dim strqry As String = “SELECT preview FROM dbo.AmazonS3FilePreview WHERE fileKey ='” + incomingKey + “‘” Dim myComm As SqlCommand = New SqlCommand(strqry, myConn) Dim resultReader As SqlDataReader […]

Parse SQL statement

How can I parse a SQL statement (for SQL Server) to extract columns and parameters info (Name, DataType) without using ActiveQueryBuilder. Regards

Connecting to a remote database using Visual studio

I have domain , database name, database user and password I want to connect to my database remotely using visual studio 2010, How can I do this ? thanks in advance

How to Store a User-defined Class Object in Sql Server 2008 using C#?

Possible Duplicate: Save byte[] into a SQL Server database from C# I have a class named LeaveDetails.cs using System; using System.Collections.Generic; using System.Linq; using System.Web; namespace LeaveMgmt_14dec { [Serializable] public class LeaveDetails { public string date; public string leave_type; } } Then a created a List of Objects of LeaveDetails Class. List<LeaveDetails> Details = new […]

Convert TextBox value to DateTime SQL Server

I made a date picker from the calendar control in ASP.net using C#. The date format in the TextBox is 08/01/2012. When I try to do an insert I get this error: Message: Input string was not in a correct format. here is my code: cmd.Parameters.Add(“@date”, SqlDbType.DateTime).Value = Convert.ToDateTime(txtDateins.Text); How do I get that fixed […]

Set write permission on folder create

Hi I have been trying to properly configure IIS 6 to give write permisiosn for about 2 days now and I can’t seem to find any good resource on this.I am a bit new to ASP.NET and until now I never had to work with IIS. What I am trying to do is upload a […]

Entity framework – history table

I have the following 2 tables defined in a SQL Server database: create table Project ( Id int, Name varchar(100) IdIdentity int ) create table ProjectHistory ( Id int, Name varchar(100) IdIdentity int, DtChange datetime ) When I updated “Project” I would like to insert new record to table ProjectHistory with setting DtChange to actual […]


I have a SQL Server with a roster/information. I would like to update the table with situps, pushups, and Id. I know how to insert information into a table, but having trouble with the Update part of it. Here is my code: SqlConnection conns = new SqlConnection(ConfigurationManager.ConnectionStrings[“TestDBConnectionString1”].ConnectionString); SqlCommand cmd = new SqlCommand(“UPDATE test SET SitUps […]

Write Null in Database if the TextBoxes are Empty

All I want to do is to insert Null with the database when the textbox is empty. –ACCOUNT AS BEGIN — SET NOCOUNT ON added to prevent extra result sets from — interfering with SELECT statements. SET NOCOUNT ON; SET IDENTITY_INSERT account ON INSERT INTO dbo.account ( AccntID , managedby , AccountHolder , Description , […]

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