Skip to main content

Posts

Upload Image using code using c sharp dot net

This is example of c#.net code to Upload Image through image upload control and save image to table of database. using System.Data; using System.Data.SqlClient; public partial class ImageUpload : System.Web.UI.Page {     SqlConnection sqlcon=new SqlConnection(@"Server=SQLEXPRESS;database=abc;uid=xxxx;pwd=yyyy;");     SqlCommand sqlcmd=new SqlCommand();     String ImageName,ImageType;     protected void Button1_Click(object sender, EventArgs e)     {         if (FileUpload1.HasFile)         {             int len = FileUpload1.PostedFile.ContentLength;             byte[] picture = new byte[len];             ImageName = FileUpload1.FileName;             ImageType = FileUpload1.PostedFile.ContentType;             sqlcon.Open();             SqlCommand sqlcmd = new SqlCommand("insert into tesimage(ImgName,Img,ImgType) values (@Im, @Img, @ImgType)", sqlcon);             sqlcmd.Parameters.Add("@Im", ImageName);             sqlcmd.Parameters.Ad

MCA Colleges in Ahmedabad,Degree

Master of Computer Applications Rollwala Computer Center, Gujarat University, Ahmedabad GLS Institute of Computer Applications G.L.S. Campus, Opp : Law Garden, Ellisbridge, Ahmedabad H. L. Institute of Computer Applications H. L. Campus, Near Commerce Six Roads, Navrangpura, Ahmedabad L. J. Institute of Computer Applications Near Sanand Cross Road, S.G. Highway, Ahmedabad L. D. College of Engineering Near Gujarat University, Navrangpura, Ahmedabad Indira Gandhi National Open University – IGNOU Opp : Nirma University, S. G. Highway, Chharodi, Ahmedabad Shri Chimanbhai Patel Institute of Computer Applications Opp : Karnavati Club, S.G.Highway, Ahmedabad

An Introduction to RTSLink DLL

RTSlink DLL is a Dynamic Link Library (DLL) that allows Software developers to Integrate their Applications with Tally Accounting Software. Using RTSlink, developers can push or pull data from Tally Software in real-time. RTSlink is based on the Client/Server principles which are as follows:- The Client Application sends a Request to the Tally Server. The request may be either to Write data (Import data into Tally) or Read data (Export data from Tally). The Server processes the request and sends a response back to the client. RTSlink DLL - Functions Open() Checks whether Tally Software is running or not. If the connection is successful, a zero value is returned. If the connection fails, the error code number is returned. Send() Sends a request to the Tally Software in form of XML message/tags. SQLRequest() Retrieve Tally Software data (Masters or Vouchers) using SQL-SELECT statement. SQLDelete() Delete Tally Software data (Masters or Vouchers) using SQL-DELETE statemen

get Grand Total using query through stroed procedure

@AMTNUMERIC(9,2)=NULL, @TAX NUMERIC(9,2)=NULL, @DISCNUMERIC(9,2)=NULL, @G_TOTAL NUMERIC(9,2)=NULL ) AS SELECT @TOT_AMOUNT=SUM(AMOUNT) FROM TRANS WHERE TNO=@CNO SELECT @TAX=ISNULL(SUM(TAX_A),0) FROM TAX WHERE NO=@TCNO SELECT @TOT_DISC_A=ISNULL(SUM(DISC_A),0) FROM DISCOUNT WHERE NO=@CNO SET @G_TOTAL = (@AMT- @TOT_DISC_A) + @TAX UPDATE FOOT SET SUBTOTAL=@TOT_AMOUNT,TAX=@TAX,DISCOUNT=@TOT_DISC_A,G_TOTAL=@G_TOTAL WHERE CNO=@CNO

generate ID from any Table through stored procedure

You can write following code to generate ID from any Table through stored procedure. Here Generate_Id is parameter to pass Id field name. You may have different field name for your table so this stored procedure is common for all tables. This stored procedure may be very helpful for you. This is a Common code for all table just call this stored procedure and pass table Name, Criteria and Primary key column Name as parameter. set ANSI_NULLS OFF set QUOTED_IDENTIFIER OFF GO Create PROCEDURE [dbo].[Generate_ID] @TablePK CHAR(50), @Table CHAR(30), @Criteria VARCHAR(300)='' AS BEGIN IF @Criteria <> '' BEGIN EXEC('SELECT MAX(convert(int,RIGHT('+@TablePK+',5)))AS ID FROM '+@Table+' WHERE '+@Criteria+'') END ELSE BEGIN EXEC('SELECT MAX(convert(int,RIGHT('+@TablePK+',5)))AS ID FROM '+@Table+'') END END RETURN

Vb.Net Code to get Financial Year

Function GETFINYR(ByVal strDate) Dim strDt, strenddt, strstdt Dim strdd, strmm, stryy, strst_dt, strend_dt Dim date1, enddate, startdate strDt = Split(strDate, "/") strdd = strDt(0) strmm = strDt(1) stryy = strDt(2) If Right(stryy, 2) = "99" Then strend_dt = "31/03/" & Left(stryy, 2) + 1 & "00" Else If Right(stryy, 1) <> "9" Then strend_dt = "31/03/" & Left(stryy, 3) & Right(stryy, 1) + 1 Else strend_dt = "31/03/" & Left(stryy, 2) & Right(stryy, 2) + 1 End If End If strenddt = Split(strend_dt, "/") strst_dt = "01/04/" & stryy strstdt = Split(strst_dt, "/") date1 = CDate(CInt(stryy) & "/" & CInt(strmm) & "/" & CInt(strdd)) enddate = CDate(CInt(strenddt(2)) & "/" & CInt(strenddt(1)) & "/" & CInt(strenddt(0))) startdat