C# .NET - help me ....

Asked By pardeep ravesh
20-Nov-09 05:24 AM
 var cell0 = row.insertCell(0);
            var element0 = document.createElement("label");
            element0.innerHTML = newRow;
            element0.setAttribute("size", "3");
            
            element0.setAttribute("name", "lblRownumber" + newRow.toString());
            element0.setAttribute("id", "lblRownumber" + newRow.toString());
            cell0.appendChild(element0)



not working in both browers only working in one browser

use textContent instead innerHtml for FF browser  use textContent instead innerHtml for FF browser

20-Nov-09 07:25 AM
Find which browser then use innerHtml & textContent based on it.

Ex:
var browserName=navigator.appName; 
if (browserName=="firefox")
{
//use textContent
}
else if (browserName=="Microsoft Internet Explorer")
{
//use innerHtml
}

Hope this helps u... :-)
Create New Account
help
FindControl("dropdownlist1"); DataRow[] rows = ds.Tables[0].Select(expression); foreach (DataRow row in rows) { DataRow newrow = mytable.NewRow(); newrow["productid"] = row["productid"]; newrow["productname"] = row["productname"]; mytable.Rows.Add(newrow); } ddl.DataSource = mytable; ddl.DataTextField = "productname"; ddl.DataValueField = "productid"; ddl.DataBind(); } } Hi, check here. . . http FindControl( "Efficiency" ); DataRow [] rows = ds.Tables[0].Select(expression); foreach ( DataRow row in rows) { DataRow newrow = mytable.NewRow(); newrow[ "empid" ] = row[ "empid" ]; newrow[ "Technology" ] = row[ "Technology" ]; newrow[ "SkillLevel" ] = row[ "SkillLevel" ]; newrow[ "Efficiency" ] = row[ "Efficiency
j = 0; j < SetData.Rows.Count; j++) { string str = SetData.Rows[j][i].ToString(); DataRow newrow = FieldTable.NewRow(); newrow[columnname] = str.ToString(); FieldTable.Rows.Add(newrow); } k++; } break ; } but m getting ouput as column1 column2 column3 qwe cvd qwer 2 4 0; k < FieldTable.Columns.Count;) { for ( int i = 0; i < SetData.Rows.Count; i++) { DataRow newrow = FieldTable.NewRow(); for ( int j = 0; j < SetData.Columns.Count; j++) { DataColumn columnname = FieldTable.Columns [i]; string str = SetData.Rows[i][j].ToString(); newrow[columnname] = str.ToString(); } FieldTable.Rows.Add newrow); } break ; } Hi, Please try the following code / / If you do not have the columns in
Add( "vYear" , typeof ( DateTime )); / / if (pbVPicture.Image ! = null) / / dt.Columns.Add("vPicture", typeof(byte[])); DataRow newRow = dt.NewRow(); newRow[ "vNo" ] = this .No; newRow[ "vName" ] = this .Name; newRow[ "vCode" ] = this .Code; newRow[ "vExplanetion" ] = this .Explanation; newRow[ "vTaxDepartment" ] = this .Depatment; newRow[ "vTaxDeptNo" ] = this .DeptNo; newRow[ "vYear" ] = this .Year; / / if (pbVPicture.Image ! = null) / / { / / FileStream fs = new FileStream
code doesn’t bug out, but it is passing nulls to the stored procedure. The ‘newrow’ has data in it, and when it is passing the dataset to the UpdateTable function private void UpdateData() { Int64 source; DataHelper dh = new DataHelper (); ReportDataSet dsNew = new ReportDataSet (); ReportDataSet . Table2Row newrow; try { newrow = dsNew.Table2.NewTable2Row(); newrow.BeginEdit(); newrow.txtClientName = this .txtClientName.Text; if ( this .ddlCountry.Value.Length > 0) { newrow.sysCountryId = Int64 .Parse( this .ddlCountry.Value); newrow.txtCountry = this .ddlCountry.Text; } else newrow.SetsysCountryIdNull(); newrow.sysClientId = UserSession .ClientId; newrow.txtBill = this .txtBill.Text; newrow.sysBillID = UserSessions .BLId; newrow
System.EventArgs) Handles btnAddReq.Click 'Add request Dim dt As DataTable = ds.Tables("tblRequests") Dim newRow As DataRow Dim cb As New OleDb.OleDbCommandBuilder(da) 'If cboTech.Text = "" Or cboName.Text type fields have been selected!", MsgBoxStyle.Critical) 'Exit Sub 'End If Try ' add a row newRow = dt.NewRow() 'Catch ex As Exception 'MessageBox.Show(ex.Message) 'End Try 'newRow("ReqID") = newRow("Status") = txtStatus.Text newRow("DateDue") = IIf(DateTimePicker1.Text = "", System.DBNull.Value, DateTimePicker1.Text) newRow("Priority") = IIf(cboPriority.Text = "", System.DBNull.Value, cboPriority.Text newRow("Technician") = IIf(cboTech.Text = "", System.DBNull.Value, cboTech.Text) newRow("Mode") = IIf(cboMode.Text = "", System