Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
O

Old Gun

@Old Gun
About
Posts
86
Topics
53
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • How to get System.Web.UI.WebControls.Calendar SelectedDate using JavaScript
    O Old Gun

    My Code does't work: var myDate = document.getElementById("Calendar1").getAttribute("SelectedDate");

    ASP.NET

  • Why OleDbCommand call oracle9i user function success,but OleDbCommand call failed.
    O Old Gun

    /* This is my oracle function */ create or replace function EngUnitConvert(sSrcEng in varchar2, sDstEng in varchar2) return number is AtLeastLostOneCoefficient exception; vSrcEng Number; vDstEng Number; vValue Number; BEGIN begin -- Get source SELECT Mult_Fctr INTO vSrcEng From ip_eng_unit t WHERE t.units = UPPER(sSrcEng); dbms_output.put_line('Source Coefficient :' || to_char(vSrcEng)); -- Get destination SELECT Mult_Fctr INTO vDstEng From ip_eng_unit t WHERE t.units = UPPER(sDstEng); dbms_output.put_line('Destination Coefficient :' || to_char(vDstEng)); if ((vSrcEng is null) or (vDstEng is null)) then dbms_output.put_line('At Least Lost One Coefficient!'); raise AtLeastLostOneCoefficient; else vValue := vDstEng / vSrcEng; dbms_output.put_line('Result Coefficient :' || to_char(vValue)); end if; dbms_output.put_line('Finished!'); return vValue; end; exception when AtLeastLostOneCoefficient then null; WHEN OTHERS THEN NULL; END; /* This is my OleDbCommand call,but it failed */ // here OleDbConnecton have opened OleDbCommand sqlcmd = new OleDbCommand(); sqlcmd.CommandText = "unitconvert"; sqlcmd.CommandType = CommandType.StoredProcedure; sqlcmd.Connection = olecn;// olecn -- OleDbConnecton OleDbParameter ps = new OleDbParameter("s_from_eng",System.Data.OleDb.OleDbType.VarChar,32); ps.Direction = System.Data.ParameterDirection.Input; ps.Value = sFromUnit; OleDbParameter pd = new OleDbParameter("s_from_eng",System.Data.OleDb.OleDbType.VarChar,32); pd.Direction = System.Data.ParameterDirection.Input; pd.Value = sToUnit; OleDbParameter pr = new OleDbParameter("vvalue",System.Data.OleDb.OleDbType.Numeric,16); pr.Direction = System.Data.ParameterDirection.ReturnValue; sqlcmd.Parameters.Add(ps); sqlcmd.Parameters.Add(pd); sqlcmd.Parameters.Add(pr); sqlcmd.ExecuteNonQuery(); string sValue = sqlcmd.Parameters["vValue"].Value.ToString(); /* The error messages is: */ ORA-06550: line 1, column 7:\nPLS-00201: identifier 'UNITCONVERT' must be declared\nORA-06550: line 1, column 7:\nPL/SQL: Statement ignored /* Here is OracleDbCommand call,it success */ OracleConnection orcn=new OracleConnection("user id=totalplant;data source=totalplant;password=totalplant"); OracleCommand cmd=new OracleCommand("unitconvert",orcn); cmd.CommandType=CommandType.StoredProcedu

    ASP.NET database oracle help

  • How to dynamic bind Listbox DataSource?
    O Old Gun

    I test your tips, it still does not work,my code is here. using System; using System.Collections; using System.ComponentModel; using System.Data; using System.Data.OleDb; using System.Drawing; using System.Web; using System.Web.SessionState; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.HtmlControls; using WinPbMove; namespace WebPbMove { /// /// public class WebProdSelect : MetaBuilders.WebControls.DialogPage { protected System.Web.UI.WebControls.TextBox TextBox1; protected System.Web.UI.WebControls.Label Label1; protected System.Web.UI.WebControls.ListBox ListBox1; protected System.Web.UI.WebControls.Button cmdFilter; protected System.Web.UI.WebControls.Button cmdReturn; private PbMove dl = null; const string MYSTRING = "-------"; private void Page_Load(object sender, System.EventArgs e) { string strSQL = ""; if (!Page.IsPostBack) { if (dl == null) dl = new PbMove(); if (dl.OpenConnection() == false) throw(new SystemException("Connect Oracle Failed!")); OleDbConnection cn = dl.Connection; if (TextBox1.Text == "") { strSQL = "Select t.prdct_name || '" + MYSTRING + "' || t.dscr From ip_prdct t"; } else { //TextBox1.Text = Session["UserFilterString"].ToString(); strSQL = "Select t.prdct_name || '" + MYSTRING + "' || t.dscr From ip_prdct t" + " Where t.dscr like '%" + TextBox1.Text + "%'"; } OleDbDataAdapter adpter = new OleDbDataAdapter(strSQL,cn); DataSet ds = new DataSet(); adpter.Fill(ds,"IP_PRDCT"); DataTable dtProdct = ds.Tables["IP_PRDCT"]; ListBox1.DataSource = dtProdct; ListBox1.DataTextField = dtProdct.Columns[0].ColumnName; ListBox1.DataValueField = dtProdct.Columns[0].ColumnName; ListBox1.DataBind(); } } #region Web override protected void OnInit(EventArgs e) { // // InitializeComponent(); base.OnInit(e); } /// /// private void InitializeComponent() { this.cmdFilter.Click += new System.EventHandler(this.cmdFilter_Click); this.cmdReturn.Click += new System.EventHandler(this.cmdReturn_Click); this.Load += new System.EventHandler(this.Page_Load); } #endregion private void cmdFilter_Click(object sender, System.EventArgs e) { if (dl == null) dl = new PbMove(); if (dl.OpenConnection() == false) throw(new SystemException("Connect Oracle F

    ASP.NET tutorial question

  • How to dynamic bind Listbox DataSource?
    O Old Gun

    I want to change my ListBox DataSource by a button event,but Where page reload ,The listbox is empty,How to do?

    ASP.NET tutorial question

  • How to develop a user control?
    O Old Gun

    Hi,edboe I read your tips,but I can't understand it well. Can you give me more tips why FixedDataGrid's DeleteCommand,EditCommand,InsertCommand,UpdateCommand and CancelCommand is not work? thanks

    ASP.NET tutorial design help question announcement

  • How to develop a user control?
    O Old Gun

    Hi,edboe I read your tips,but I can't understand it well. Can you give me more tips why FixedDataGrid is not work? thanks

    ASP.NET tutorial design help question announcement

  • How to develop a user control?
    O Old Gun

    Thank you!I'll try it.

    ASP.NET tutorial design help question announcement

  • How to develop a user control?
    O Old Gun

    I get a example of FixedDataGrid Written by Alexander Zeitler.His example work well.It is fixed datagrid row height.I want to add some other function to it,such as highlight entire row,The highlight row work well,but the delete ,edit ,update command work failed! the all code is here,Can anyone give some help? using System; using System.IO; using System.Web; using System.Web.SessionState; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.HtmlControls; //using CustomControls; namespace WinDataGrid { public class FixedHeightGrid : System.Web.UI.WebControls.DataGrid { private bool _mergePaddingColumns; private TableItemStyle _paddingItemStyle = new TableItemStyle(); private int _RowHeight = 22; private string _sRowForColor = "white"; private string _sRowBackColor = "lightblue"; public FixedHeightGrid() { this.ShowFooter=false; this.ShowHeader=true; this.AllowPaging=true; } public bool MergePaddingColumns { get {return _mergePaddingColumns;} set {_mergePaddingColumns = value;} } public TableItemStyle PaddingItemStyle { get {return _paddingItemStyle;} set {_paddingItemStyle = value;} } public int RowHeight { get { return _RowHeight;} set {_RowHeight = value;} } public string RowForColor { get { return _sRowForColor;} set {_sRowForColor = value;} } public string RowBackColor { get { return _sRowBackColor;} set {_sRowBackColor = value;} } protected override void OnPreRender(EventArgs e) { base.OnPreRender(e); AddPaddingItems(); } protected override void OnItemCreated(DataGridItemEventArgs e) { base.OnItemCreated(e); if (e.Item.ItemType == ListItemType.AlternatingItem || e.Item.ItemType == ListItemType.Item) { e.Item.Attributes.Add("OnMouseOver", "this.style.backgroundColor = '" + _sRowBackColor + "';"); e.Item.Attributes.Add("OnMouseOut", "this.style.backgroundColor = '" + _sRowForColor + "';"); } } private void AddPaddingItems() { int indexCount; int indexStop = this.PageSize; int indexStart = 1; if(this.AllowPaging==true) { indexStart++; indexStop++; } Table myTable = (Table)this.Controls[0]; for(indexCount=indexStart+this.Items.Count;indexCount<=indexStop;indexCount++) { myTable.Controls.AddAt(indexCount,PaddingItem()); } } private DataGridItem PaddingItem() { DataGridItem myItem = new DataGridItem(0,0,ListItemType.Item)

    ASP.NET tutorial design help question announcement

  • ASP.NET DataGrid DropDownList edit problem
    O Old Gun

    Ok,Thank you.I will try this way right now.

    ASP.NET csharp asp-net database help

  • ASP.NET DataGrid DropDownList edit problem
    O Old Gun

    Thanks for your help. I just want to set a default dropdownlist selectedindex,not use the default zero. I tried in OnItemDataBound event at edit mode ,but I can't get dropdownlist control.Could you give me more tips? thank you

    ASP.NET csharp asp-net database help

  • ASP.NET DataGrid DropDownList edit problem
    O Old Gun

    I use DropDownList edit DataGrid data, There have 4 columns using DropDownList for edit data. Generally I only want to change one column data. But when I enter editing mode, the all DropDownList’s index change to zero, only I want to change one column! How I set all DropDownList Index default to right value.

    ASP.NET csharp asp-net database help

  • How to get a DataTable from StoreProcedure?
    O Old Gun

    My Oracle SoreProcedue return a table.How Can I get it from c#?

    C# question csharp oracle tutorial

  • Does AJAX can get ColumnName at client?
    O Old Gun

    I want to get DataTable value by column index,not by specical column name,So I must get column name,I test many way to get it,it is always failed.this is my code. 1. alert(ds.Tables[0].Columns[0].Name); 2. alert(ds.Tables[0].Columns[0].Item[0]); 3. alert(ds.Tables[0].Columns[0].FieldName); 4. alert(ds.Tables[0].Columns[0].ColumnName); Can you help me?

    ASP.NET database help question

  • Javascript Merge Excel Cells
    O Old Gun

    I got a answer from one of my friends. oSheet.Range("A1:B2").Merge(); It works. I don't know what wrong with this: oSheet.Range(Cells(1, 1), Cells(2, 2)).Merge();

    ASP.NET javascript help

  • Javascript Merge Excel Cells
    O Old Gun

    I use Javascript merge ms excel cells,my code is : oSheet.Range(Cells(1, 1), Cells(2, 2)).Merge(); It report errors, pls help me,Thank you!

    ASP.NET javascript help

  • Make Friends
    O Old Gun

    It is my mistake,Yes ,There are many friends here who help me improve my technical,In fact,I post that to make friends chat in english,I post it in wrong place.

    Get-Togethers csharp asp-net com lounge

  • Make Friends
    O Old Gun

    I want to make some friends who spoken english and like asp.net,c#.we can chat sometime by msn. I am chinese man,35 years old. My msn wenty@lzsh.com.cn -- modified at 13:30 Thursday 18th May, 2006

    Get-Togethers csharp asp-net com lounge

  • How to get ProcessId From Hinstance?
    O Old Gun

    In my application, I get excel' HINSTANCE,I want to get it's ProcessID,So I can right control that excel instance that I created.

    C / C++ / MFC csharp tutorial question

  • How to get ProcessId From Hinstance?
    O Old Gun

    I have asked in c# forum,but nobody answer me. Does anyone here can give me a tips? Thank you.

    C / C++ / MFC csharp tutorial question

  • How to get process ID by instance ID?
    O Old Gun

    Please help,Thank you!

    C# help tutorial question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups