Answer Posted / santro
/*DrugNames DalCls.cs*/
using System;
using System.Data;
using System.Configuration;
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 MySql.Data.MySqlClient;
using System.Windows.Forms;
using System.IO;
using MedWare;
/// <summary>
/// Summary description for DrugNamesDalCls
/// </summary>
public class DrugNamesDalCls
{
MySqlConnection mysqlcon = new MySqlConnection
(System.Configuration.ConfigurationManager.AppSettings
["strDrugs"].ToString());
public DrugNamesDalCls()
{
//
// TODO: Add constructor logic here
//
}
public void ErrorMsg(string strError)
{
string strErrorPath =
HttpContext.Current.Server.MapPath("Errordetails.txt");
using (FileStream fs = File.Open(strErrorPath,
FileMode.Append, FileAccess.Write))
{
using (StreamWriter sw = new StreamWriter(fs))
{
sw.WriteLine
("..........................................................
............................");
//sw.WriteLine("ApplicationName:" +
strAppUrl);
sw.WriteLine("Error:" + strError);
sw.WriteLine("Creation Date:" +
DateTime.Now);
sw.WriteLine
("..........................................................
............................");
}
}
}
//FUNCTION FOR INSERT TRANSACTION.
public int InsertDrugName(string pstrDrugName)
{
int irec = 0;
string strDate=DateTime.Now.ToString();
//string strIns = "INSERT INTO DRUGNAME VALUES('" +
pstrDrugName + "')";
string strIns = "INSERT INTO DRUGNAME (DrugName)
values('" + pstrDrugName + "')";
try
{
irec = new DrugNamesDblCls().InsDelUpdate
(strIns);
}
catch (Exception ex)
{
ErrorMsg(ex.Message);
}
return irec;
}
//FUNCTION FOR UPDATE TRANSACTION.
public int UpdateDrugName(string strDrugName, string
DrugNameID)
{
int irec = 0;
string strUpdate = "UPDATE drugname SET DRUGNAME='"
+ strDrugName + "' WHERE DRUGNAMEID=" + DrugNameID;
try
{
irec = new DrugNamesDblCls().InsDelUpdate
(strUpdate);
}
catch (Exception ex)
{
ErrorMsg(ex.Message);
}
return irec;
}
// FUNCTION FOR DELETE TRANSACTION.
public int DeleteDrugName(string strDrugNameID)
{
int irec = 0;
string strDel = "DELETE FROM drugname WHERE
drugname='" + strDrugNameID + "'";
try
{
irec = new DrugNamesDblCls().InsDelUpdate
(strDel);
}
catch (Exception ex)
{
ErrorMsg(ex.Message);
}
return irec;
}
}
Is This Answer Correct ? | 1 Yes | 1 No |
Post New Answer View All Answers
Who has the power to write and change laws?
Many times,civil cases result in compromise and settlement agreements. When was the last time you successfully negotiated your stance?
Rowan offers to sell Graham his car for £500. They shake on it and Graham gives him the money in cash. En route to delivering it, Rowan crashes and the car is written-off. He refuses to give Graham his money back. What can Graham do next?
why there is a difference in depreciation rate as per companies act & as per income tax act? i know the treatment but want to know why there is a difference?
Hi i am shiva kumar, I have completed Graduation B.A through distance education (kakathiya university), i want to do law through distance, please suggest me best at hyderabad.
If we are taking Input credit on purchase on the basis of origal VAT Invoices,but party didn't pay the tax to the the sales tax department.Is there is any provision in VAT laws that our Input Tax will be disallowed on that basis. If there is any circulars or notification on this matter then pls give me the reference No. Thanking in Advance Navin Srivastava
How many form used in sales tax in u.p.
A cyclist is injured following a road traffic accident in the day. He was cycling in a car lane rather than the cycle lane. Who is liable- the cyclist or the motorist? How about if the accident occurred at night and the cyclist had no lights?
best way to claim compensation through slander false accusations
A doctor is asked by a patient's family member to kill the patient as they are in a lot of pain. Would this be murder?
What are the fundamental differences between US and British Law? What are the implications of this?
Name the president of constituent assembly ?
Can we apply IEC Certificate & professional tax certificate manually ? i.e. without online
can an outsider put a criminal case against members of the cooperative society on personal ground though matter of the society where each member is not paid by the society and does voluntary service , secondly can the police call each and every member after getting bail from the magistrate be called by the police at any time without any proper questions being asked by the police every now and then since in the bail it is written that the police can call the members at any time for interrogation, after going for interrogation one finds that there were no questions asked . thirdly have they to report to th epolice every time they go out of india
What is Sweat Equity