SQL
create function[dbo].[book_id](@id int)
return char(12)
as
begin return 'bkooID'+right('00000'+convert(varchar(10),@id),5)
endi want to insert this value in column book_id using asp.net on button click..
please write sqlcommand for this.
please write sqlcommand for this.
C#
this is my sqlconnection code
SqlConnection con;
SqlCommand cmd;
string str = ConfigurationManager.ConnectionStrings["connect"].ConnectionString;
protected void btnSubmit_Click(object sender, EventArgs e)
{
SqlConnection con = new SqlConnection(str);
}

Manikavelu VelayuthamRank #413 · 6K reputationPosted Nov 24, 2013, 5:33 AM EST
so that it will be automatically inserted in to that column.
Computed Column
CREATE FUNCTION udf_compcol(@contents XML) RETURNS nvarchar(255) WITH SCHEMABINDING BEGIN RETURN @contents.value('(/item/description/text())[1]', 'nvarchar(255)') END Go ALTER TABLE Books ADD summary_compcol AS udf_compcol(Contents) PERSISTED Go CREATE INDEX ix_Books_summary ON Books(summary_compcol) GoAmit Kumar115 reputationPosted Nov 24, 2013, 7:20 AM EST
can you write your steps for doing this