Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Drug names

Answer Posted / santro

/*pgDrugnames.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.Data.SqlClient;

public partial class pgDrugnames : System.Web.UI.Page
{
string strConnectionstring;
SqlConnection con;
SqlDataAdapter da;

protected void Page_Load(object sender, EventArgs e)
{
strConnectionstring =
ConfigurationManager.AppSettings["strSample"];
con = new SqlConnection(strConnectionstring);
if (!IsPostBack)
{
BindDrugDetails();
}
Button2.Attributes.Add
("onclick", "javascript:return ConfirmDelete();");

Button5.Attributes.Add("onclick", "window.open
('ReportViewer.aspx','newwindow','width=800,height=600,resiz
able=1,scrollbars=1'); return false");
}
protected void ListBox1_SelectedIndexChanged(object
sender, EventArgs e)
{
TextBox1.Text = ListBox1.SelectedItem.Text.ToString
();
}
protected void Button1_Click(object sender, EventArgs e)
{
ListBox1.Visible = false;
Label1.Text = "Edit Mode";
TextBox1.Text = string.Empty;
TextBox1.Focus();
Button2.Enabled = false;
Button3.Enabled = true;
Button5.Enabled = false;
Button4.Text = "Cancel";
}
protected void Button4_Click(object sender, EventArgs e)
{
if (Button4.Text == "Cancel")
{
ListBox1.Visible = true;
Label1.Text = "view mode";
Button2.Enabled = true;
Button5.Enabled = true;
Button3.Enabled = false;
Button4.Text = "Close";
TextBox1.Text =
ListBox1.SelectedItem.Text.ToString();

}
else if (Button4.Text.ToUpper().ToString()
== "CLOSE")
{
Response.Redirect("Default.aspx");
}
}
protected void Button3_Click(object sender, EventArgs e)
{
con.Open();
string strmax;
int intMaxId;
strmax = "select max(drugid)+1 from drugmaster";
SqlCommand cmdmax = new SqlCommand();
cmdmax.CommandText = strmax;
cmdmax.CommandType = CommandType.Text;
cmdmax.Connection = con;
intMaxId=int.Parse(cmdmax.ExecuteScalar().ToString
());
con.Close();
con.Open();
SqlCommand cmdInsert = new SqlCommand();
cmdInsert.CommandText = "INSERT INTO DRUGMASTER
VALUES("+ intMaxId+",'"+TextBox1.Text.ToString() +"',1)";
cmdInsert.CommandType = CommandType.Text;
cmdInsert.Connection = con;
cmdInsert.ExecuteNonQuery();
BindDrugDetails();
TextBox1.Text = string.Empty;

}
protected void BindDrugDetails()
{
DataSet ds = new DataSet();
da = new SqlDataAdapter("select * from drugmaster
order by drugname", con);
da.Fill(ds, "drugname");
ListBox1.Visible = true;
ListBox1.DataSource = ds;
ListBox1.DataTextField = "drugname";
ListBox1.DataValueField = "drugID";
ListBox1.DataBind();
ListBox1.SelectedIndex = 0;
TextBox1.Text = ListBox1.SelectedItem.Text.ToString
();
}
protected void Button2_Click(object sender, EventArgs e)
{

string strDel;
int intDrugId = int.Parse
(ListBox1.SelectedValue.ToString());
strDel = "delete from drugmaster where drugid=" +
intDrugId + "";
SqlCommand cmdDel = new SqlCommand();
cmdDel.CommandText = strDel;
cmdDel.CommandType = CommandType.Text;
con.Open();
cmdDel.Connection = con;
cmdDel.ExecuteNonQuery();
Page.RegisterStartupScript("OnClick", AlertScript
("Record Deleted Successfully"));
BindDrugDetails();

}
string AlertScript(string message)
{
string strScript = "";
strScript = "<script>";
strScript = strScript + "alert( '" + message
+ "');";
strScript = strScript + "</script>";
return strScript;
}
}
/*pgDrugnames.aspx - source
<head runat="server">
<title>Untitled Page</title>
<script type="text/javascript" language="javascript">
function ConfirmDelete()
{
if(confirm('Are You Sure You Want to Delete?'))
{
return true;
}
return false;
}
</script>
</head>*/

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

i m from engineering background and now i want to go banks....if the question will asked that why u prefer the bank job while u r from technical background?

1882


Hi i have a problem.I have been completing my graduation & p.g from correspondence universities.Now for sbi interview i want character certificate from this universities.but these universit. do not issue characeter certificate.But in sbi it is required.Now what can i do?Please help me.My interview is on 29th april.

1826


How did you go about planning for a recent event/project you handled?

1828


What is mean by CRT interview????

8282


Order Management Questions on the Oracle applications. ================================================= A)Explain the basic flow of Order Management Regular Sales order cycle. B)Explain the difference between the pick release and Ship Confirm process. c)Explain the Credit Check functionality. d)Explain the Ship Confirm Rule e)Explain how the price can be given to an item. f)Explain how can we Generate an invoice once we booked the order for a shippable item. g)Explain the Pricing Entities 1)Modifiers 2)Qualifiers. h)If the Ship Confirm button is Greyed out from the Shipping Transactions form what could be the reason. i)Explain the KFF’s in Order management Inventory a)Explain types of move orders b)Explain the Planning Methods c)Explain the Difference between Purchasable and purchased attributes. d)Explain KFF’s In Oracle inventory. e)Explain the Lead times concept. f)What is cumulative lead time and Cummulative Mfg Lead time. g)Explain Standard Costing and Average Costing. h)How can the Lead times be setup in the Item Master. i)Explain how many levels of reservation can be done. Purchasing a)Explain the document types. b)Explain the KFF’s in Purchasing. c)Explain the balancing segment. d)Explain the returns on Purchase order concept. e)Explain the attributes used for the purchasing.

2791


Bhagwan budh got enlightment under the tree of Banyan (But briksh)then why there are a peepal tree in Bodh Gaya as a Bodhibriksh?

2271


Is there any minimum marks to be given in SBI clerk interview? My interview was very bad..was able to ans only 10% of questions.I know to read and write the local language.Written have done well. Pls ans if anybody knows the cut off

1824


what is core banking?

2214


what si the age limit for the voice

2555


i want thanx my brother so i need nice wording

1994


what is capability and capability based systems?

1915


what are the things to be looked after for marketing,purchase and sale?

1883


We are a manufacturing organisation , the product produced are batch detemined ( every day we have a different Batch No day wise). Part of the finished product produced is taken by another department to manufacture thier final product . We transfer material from one storage location to another and have activtaed the back flush indicator for manufacturing the finished product of department 2. The transfer of the product from dept 1 to dept 2 is of different batches . will the system do automatic back flushing for the final product of dept 2. If yes please let me know.

1758


I am BSc. Maths. I gave written test for SBI clerical postand I am selected for interview. I am about to join Times group as an executive with a salary of 18000. Some people are telling me to consider SBI job as it is secured. What should I do? Please help me.

1893


Ang elepante na ba po ang susunod na mawawala sa ating daigdig?

1893