Ir al contenido principal

Entradas

Mostrando entradas de noviembre, 2013

Asp - Send a popup message

 To send a message follow the next steps: Add the reference:  using AjaxControlToolkit;  Build the message through an alert using JQuery Use the method RegisterClientScriptBlock   The function should look like this:         StringBuilder sb = new StringBuilder();         sb.Append("<script type=\"text/javascript\">alert('");         sb.Append(mensaje.Replace("'", ""));         sb.Append("'); ");         sb.Append("window.location.href='");         sb.Append(url);         sb.Append("';</script>");        ToolkitScriptManager.RegisterClientScriptBlock(this, typeof(Button), "Mensaje", sb.ToString(), false);

SQL - User-Defined Type (DataTable)

How to create a User-Defined  in your database and use it in C# like DataTable Create the data type and refresh the DB [ty pe _ name ] - The name for the new data type [ parameter ] - The name of your paramenter int - The data type NULL - Declare if the parameter has to be null or not   CREATE TYPE [ relProjectDS ] AS TABLE(       [idProject] int NOT NULL ,     [ idCatDomain ] int NULL,     [catSubdomain ] [nvarchar]  (50) NULL ) Create the Store procedure CREATE PROCEDURE  [dbo].[insertProject]     @ myDataType relProjectDS readonly AS BEGIN       insert into [dbo].[Table] select * from @ myDataType END Create and fill the DataTable in C# idProject - Name of the parameter according with data type from the DB typeof(int) - The type definition according with the DB Rows.Add(param1, param2) - The method to add each row to the DataTable DataTable projectsTable = new DataTable(); proje...