Skip to main content

Posts

Showing posts from March, 2011

Insert EO grid view data into the database

using System; using System.Configuration; using System.Data; using System.Linq; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.HtmlControls; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Xml.Linq; using System.Data.SqlClient; using System.Data.Sql; using System.Data; using EO.Web; using EO.Web.Internal; public partial class _Default : System.Web.UI.Page { public static string connectionString = @"Data Source=.\SQLEXPRESS;AttachDbFilename=Data Source=.\SQLEXPRESS;AttachDbFilename=C:\Documents and Settings\mshamanna\My Documents\Visual Studio 2010\WebSites\EOTest2\App_Data\Database.mdf;Integrated Security=True;User Instance=True"; protected void Page_Load(object sender, System.EventArgs e) { string sql = @"select * from Temp"; SqlConnection conn = new SqlConnection(connectionString); SqlDataAdapter da = new SqlDataAdapter(); SqlCommand cmd

how to convert binary data to string

hi, i want to know how to convert binary data to string by using memory stream.here i specify my codings Binaryreader br=new binaryreader(fileupload1.postedfile.inputstream); byte[] resume=br.readbytes(fileupload1.postedfile.contentlength); now the variable resume contains the large amont of binary data how can i convert it.

DataGridViewComboBoxColumn

Hi You can use this below code to solve the issue of DataGridViewComboBoxColum.It will help you. private void dataGridView1_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e) { if (dataGridView1.CurrentCell.ColumnIndex == 0) { // Check box column ComboBox comboBox = e.Control as ComboBox; comboBox.SelectedIndexChanged += new EventHandler(comboBox_SelectedIndexChanged); } } void comboBox_SelectedIndexChanged(object sender, EventArgs e) { int selectedIndex = ((ComboBox)sender).SelectedIndex; MessageBox.Show("Selected Index = " + selectedIndex); } If you want to more detail about code than just go for below link. http://generally.wordpress.com/2007/12/07/datagridview-get-selectedindex-of-datagridviewcomboboxcolumn/

Creating Master-Detail GridView Using jQuery

Abstract: In the year 2005 we published an article about creating master-detail GridView control. JQuery was not a first class citizen during that time and most of the work was performed by either plain old vanilla JavaScript or the server side code. With the advent of JQuery we can now create cool master-detail effects easily in less time and less code. This article explains how to spice up master-detail using JQuery. Data Source: For the sake of simplicity we have used collections as the data source instead of the database. The scenario revolves around Category and Product classes. The implementation below is used to populate the categories collection and return it to the user interface. view sourceprint? 01 public class DataAccess 02 { 03 public static List GetCategories() 04 { 05 var categories = new List (); 06 07 for(var i = 1; i<=10;i++) 08 { 09 var category = new Category(); 10 categor

Creating Master-Detail GridView Using jQuery

Abstract: In the year 2005 we published an article about creating master-detail GridView control. JQuery was not a first class citizen during that time and most of the work was performed by either plain old vanilla JavaScript or the server side code. With the advent of JQuery we can now create cool master-detail effects easily in less time and less code. This article explains how to spice up master-detail using JQuery Data Source: For the sake of simplicity we have used collections as the data source instead of the database. The scenario revolves around Category and Product classes. The implementation below is used to populate the categories collection and return it to the user interface. public class DataAccess 02 { 03 public static List GetCategories() 04 { 05 var categories = new List (); 06 07 for(var i = 1; i<=10;i++) 08 { 09 var category = new Category(); 10 category.Name = "Category

DrawBarGraph

Sub DrawBarGraph(ByVal strTitle As String, _ ByVal aX As ArrayList, ByVal aY As ArrayList) Const iColWidth As Integer = 60, iColSpace As Integer = 25, _ iMaxHeight As Integer = 400, iHeightSpace As Integer = 25, _ iXLegendSpace As Integer = 30, iTitleSpace As Integer = 50 Dim iMaxWidth As Integer = (iColWidth + iColSpace) * aX.Count + iColSpace, _ iMaxColHeight As Integer = 0, _ iTotalHeight As Integer = iMaxHeight + iXLegendSpace + iTitleSpace Dim objBitmap As Bitmap = New Bitmap(iMaxWidth, iTotalHeight) Dim objGraphics As Graphics = Graphics.FromImage(objBitmap) objGraphics.FillRectangle(New SolidBrush(Color.White), _ 0, 0, iMaxWidth, iTotalHeight) objGraphics.FillRectangle(New SolidBrush(Color.Ivory), _ 0, 0, iMaxWidth, iMaxHeight) ' find the maximum value Dim iValue As Integer For Each iValue In aY If iValue > iMaxColHeight Then iMaxColHeight = iValue

sql

SqlConnection con = new SqlConnection("Server=VIJAY\\DATASERVER; database=employees;user id=sa;pwd=vb_123"); con.Open(); //Response.Write("connected successfully"); SqlCommand cmd = new SqlCommand("select count(*) from employee",con); cmd.CommandType = CommandType.Text; object obj = cmd.ExecuteScalar(); Response.Write(obj); con.Close(); }

graph.aspx.cs

using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using System.Drawing; using System.Drawing.Imaging; namespace WebApplication1 { public partial class _Default : System.Web.UI.Page { public Bitmap bmp = null; public Font f = null; protected void Page_Load(object sender, EventArgs e) { bmp= new Bitmap(250, 250); Graphics gph =Graphics.FromImage(bmp); Pen p = new Pen(Color.Black); Font littletext = new Font("Times New Roman", 6); gph.DrawLine(p, 10, 10, 10, 240); gph.DrawLine(p, 10, 240,240,240); gph.DrawString("2000", littletext, Brushes.Black, 23, 240); gph.DrawString("2001", littletext, Brushes.Black, 46, 240);

File upload

FIleUPLOAD;;; // string FilePath = FileuploadTxt.PostedFile.FileName; // string FileName = Path.GetFileName(FilePath); // string text = Path.GetExtension(FilePath); // string contenttype = String.Empty; // //Set the contenttype based on File Extension // switch (text) // { // case ".doc": // contenttype = "application/vnd.ms-word"; // break; // case ".txt": // contenttype = "application/vnd.ms-word"; // break; // } // if (contenttype != String.Empty) // { // Stream fs = FileuploadTxt.PostedFile.InputStream; // BinaryReader br = new BinaryReader(fs); // Byte[] bytes = br.ReadBytes((Int32)fs.Length); // Raya.API.Mailupload objmail = new Raya.API.Mailupload(); // //objmai

Dotnet IMP

Dot Net Project Code 1) Table Creation CREATE TABLE [dbo] . [Batches] ( [Bat Publish Post chId] [bigint] IDENTITY ( 1 , 1 ) NOT NULL, [BatchNo] [varchar] ( 20 ) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, [FromTiming] [datetime] NULL, [ToTiming] [datetime] NULL, [EnteredBy] [bigint] NULL, [EnteredDate] [datetime] NULL, [UpdatedBy] [bigint] NULL, [UpdateDate] [datetime] NULL, [IsActive] [bit] NULL, CONSTRAINT [PK_Batches] PRIMARY KEY CLUSTERED ( 2) Stored Procedure: create procedure [dbo] . [USP_IDFU_Baches] ( @Type char ( 1 )=null, @Batchid bigint =null, @BatchNo varchar ( 20 )=null, @FromTiming datetime =null, @ToTiming datetime =null, @EnteredBy bigint =null, @EnteredDate datetime =null, @UpdatedBy bigint =null, @UpdateDate datetime =null, @IsActive bit =null) as if ( @type =