|
Yes u need to take data from XML File therefore file should be exist already and u just need to give path and rest all u know how to do. If still u have problem then post a new message.
|
|
|
|
|
hello i am new to this active reports i need to design a page in active report .I dont know how to design a page in active report can any one give me some links .I need links from scratch so that i can understand how to design the page in active report.I am using asp . I need to design one fax cover sheet in active report(i.e pdf format ) . I dont know how to design can any one help me out .
|
|
|
|
|
Hi,
How to add new row dynamic into dataset.
thanks
|
|
|
|
|
ds.Tables[0].Rows.Add();
Ramana
|
|
|
|
|
Hi,
thanks for reply.
I am doing like this
Suppose i am inserting two records.then
first it's insert blank row then insert the next record.
i am getting why?
My Code:-
DataRow dr = dsCostAdminDetails.Tables[0].NewRow();
dr.Table.Columns["date"].DefaultValue = Convert.ToString(
dtDate.AddDays(-lngTotalDays).ToShortDateString());
dsCostAdminDetails.Tables[0].Rows.InsertAt(dr, bteCounter);
|
|
|
|
|
i want code for forms authentication ,where multiple users are accessing the site i want the code in c#.net
please forward the code to me as soon as possible
sai S/W Developer DATA MONITOR
|
|
|
|
|
|
see i had done the coding for login using forms authentication in web.config file but when i put home page as startup page it is not displaying ----the error is "the page cannot be displayed"
please help me
sai
|
|
|
|
|
Hi
I have a windows application i am calling webserivce, the first webservice calling another webservice there i am getting an error
The request failed with the error message:
--
<html><head><title>Object moved</title></head><body>
<h2>Object moved to <a href="/webservuce2/service.asmx?AutoDetectCookieSupport=1">here</a>.</h2>
</body></html>
--.
kesavan
|
|
|
|
|
Hi
I have created a user control which inherits from UserControl amd implements ITemplate. I am setting my datalist's item template to this external resource using Page.LoadControl. But when the datalist is bound to a datasource, I don't see the data displayed in the expected way. Only the last item in the datasource is displayed by the datalist for the item template colum.
Here is my class.
UserControl code behind
========================
<br />
public partial class StateListTemplate : System.Web.UI.UserControl, System.Web.UI.ITemplate<br />
{<br />
private bool _bDisplayStateName = false;<br />
<br />
public bool DisplayStateName<br />
{<br />
set {_bDisplayStateName = value;}<br />
get { return _bDisplayStateName;}<br />
}<br />
<br />
public void InstantiateIn(System.Web.UI.Control container)<br />
{<br />
container.Controls.Add(this);<br />
}<br />
....<br />
protected string GetStateDisplayString(string sStateCode, string sStateName)<br />
{<br />
if (DisplayStateName)<br />
return new System.Text.StringBuilder(sStateCode.Trim()).Append("-").Append(sStateName.Trim()).ToString();<br />
else<br />
return sStateCode;<br />
}<br />
<br />
User Control .ascx
==================
<br />
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="StateListTemplate.ascx.cs" Inherits="EtaxWeb.UserControls.StateListTemplate" %><br />
<asp:Label runat="server" Text="Test1"></asp:Label><br />
<%# GetStateDisplayString((string)DataBinder.Eval(((DataListItem)Container).DataItem, "Value"), (string)DataBinder.Eval(((DataListItem)Container).DataItem, "Text"))%><br />
Code where the datalist's itemtemplate is set to the above user control and datbound.
<br />
StateListTemplate stlist = (StateListTemplate)LoadControl("../UserControls/StateListTemplate.ascx");<br />
stlist.DisplayStateName = false;<br />
dlStates.ItemTemplate = stlist;<br />
dlStates.DataSource = states;<br />
dlStates.DataBind();<br />
I could have just used a class with ITemplate interface, but just wanted to see if this is possible as it would help to code the controls declaritively in the user control and add it to the container in the InstantiateIn method rather than having to declare eacha nd every control and adding it to the container.
Any Help is appreciated!
|
|
|
|
|
W.R.T .Net 2.0
1>Is there any way i can remove the space between the outer border of the checkbox and the actual check box.
2>I have a fileupload control, how can i apply style to the browse button.
|
|
|
|
|
Is there some way the requests can be made to operate at the same time?
i have one button. everytime user clicks the button a call to database is made Asynchronously and the results are shown in the grid on completion. For every database result there is a new row in the grid. The problem is, every asynchronous call executes after the previous one is completed showing a behaviour of queues. However i need pure asynchronous tasks that is the results of less time consuming should appear first even if it was started at later. for more clarity here is code for both aspx and aspx.cs. before executing this code please make sure the connection string is ok for your machine. on execution click the button immidiately more than one times and see the start and end times.
Thanks in advance.
Regards,
Ishfaq Hussain
-----------------------------Sample.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Sample.aspx.cs" Inherits="_sample" %>
<title>Untitled Page
<asp:scriptmanager id="ScriptManager1" runat="server">
<asp:updatepanel id="UpdatePanel1" runat="server">
<contenttemplate>
<asp:label id="Label1" runat="server" text="Label">
<asp:button id="Button1" runat="server" onclick="Button1_Click" text="Button">
<asp:gridview id="gridTasks" runat="server">
<asp:updateprogress id="UpdateProgress1" runat="server" associatedupdatepanelid="UpdatePanel1"
displayafter="0">
<progresstemplate>
<asp:updatepanel id="UpdatePanel2" runat="server">
<contenttemplate>
<asp:label id="Label2" runat="server" text="Label" visible="False">
<asp:button id="Button2" runat="server" onclick="Button2_Click" text="Button" visible="False">
<asp:updatepanel id="UpdatePanel3" runat="server">
<contenttemplate>
<asp:label id="Label3" runat="server" text="Label" visible="False">
<asp:button id="Button3" runat="server" onclick="Button3_Click" text="Button" visible="False">
<asp:updateprogress id="UpdateProgress3" runat="server" associatedupdatepanelid="UpdatePanel3"
displayafter="0">
<progresstemplate>
Updating panel3
<asp:updateprogress id="UpdateProgress2" runat="server" associatedupdatepanelid="UpdatePanel2"
displayafter="0">
<progresstemplate>
Updating panel2
Sys.Application.add_load(ApplicationLoadHandler)
function ApplicationLoadHandler(sender, args)
{
var prm = Sys.WebForms.PageRequestManager.getInstance();if (!prm.get_isInAsyncPostBack())
{
prm.add_initializeRequest(InitializeRequest);
prm.add_endRequest(CompleteRequest);
}
}
// initialize a queue
var myQueue = new Array();
function CompleteRequest(sender, args)
{
if(myQueue.length > 0)
{// fire correspond event again of the item cached
$get(myQueue[0].id).click();
Array.removeAt(myQueue, 0);
}
}
function InitializeRequest(sender, args)
{
var prm = Sys.WebForms.PageRequestManager.getInstance();
if (prm.get_isInAsyncPostBack())
{// if it's working on another request, cache the current item that cause the request
args.set_cancel(true);
Array.add(myQueue, args.get_postBackElement());
}
}
if(typeof(Sys) !== "undefined") Sys.Application.notifyScriptLoaded();
-----------------------------Sample.aspx.cs
using System;
using System.Data;
using System.Data.SqlClient;
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;
public partial class _sample : System.Web.UI.Page
{
DataTable dt = new DataTable();
private SqlConnection conn;
private SqlCommand command;
private SqlDataReader _reader;
private int ThreadCount=0;protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
dt.Columns.Add("Task ID");
dt.Columns.Add("Order ID");
dt.Columns.Add("Start Time");
dt.Columns.Add("End Time");
dt.Columns.Add("Order Amount");
ViewState["dt"] = dt;Session["ThreadCount"] = ThreadCount;
}
dt = (DataTable)ViewState["dt"];
ThreadCount =(int) Session["ThreadCount"];
}
protected void Button1_Click(object sender, EventArgs e)
{
ThreadCount++;
Session["ThreadCount"] = ThreadCount;
//Response.Write(Request.QueryString["values"]);
//Response.Write("Request No" + ThreadCount.ToString() + " ");
Label1.Text = ThreadCount.ToString();
Random rand = new Random();
int n = rand.Next(10000, 11077);
//Guid taskId = Guid.NewGuid();
int taskId = ThreadCount;
string stime = System.DateTime.Now.TimeOfDay.ToString();
Tasks task = new Tasks();
//task.guid = taskId;
task.TaskID = taskId;
task.OrderID = n.ToString();
task.StartTime = stime;
//AddListViewItem(task.guid, int.Parse(task.OrderID), task.StartTime);
AddListViewItem(task.TaskID, int.Parse(task.OrderID), task.StartTime);PageAsyncTask asynctask = new PageAsyncTask(BeginAsyncOperation, EndAsyncOperation, EndTimeOutInvoke, task);
RegisterAsyncTask(asynctask);
}
IAsyncResult BeginAsyncOperation(object sender, EventArgs e, AsyncCallback cb, object state)
{
Tasks task = (Tasks)state;
conn = new SqlConnection("Data Source=localhost;Initial Catalog=Northwind; Integrated Security=true; Asynchronous Processing=true");
command = new SqlCommand();
command.CommandText = "WAITFOR DELAY '0 " + new Random().Next(1, 9) + "' SELECT isnull(sum((UnitPrice * Quantity)-Discount),0) from [Order Details] WHERE OrderID = " + int.Parse(task.OrderID);
//command.CommandText = "SELECT isnull(sum((UnitPrice * Quantity)-Discount),0) from [Order Details] WHERE OrderID = " + n;
command.Connection = conn;
conn.Open();
//SqlDataReader dr = command.ExecuteReader();
//etime = System.DateTime.Now.TimeOfDay.ToString();
//DataTable dt = new DataTable();
//dt.Load(dr);
return command.BeginExecuteReader(cb, task);
}
void EndAsyncOperation(IAsyncResult ar)
{
_reader = command.EndExecuteReader(ar);
string etime = System.DateTime.Now.TimeOfDay.ToString();DataTable tempdt = new DataTable();
tempdt.Load(_reader);
UpdateListViewItem((Tasks)ar.AsyncState, float.Parse(tempdt.Rows[0][0].ToString()), etime);
}
public void EndTimeOutInvoke(IAsyncResult result)
{
//if (cnx != null && cnx.State != ConnectionState.Closed)
// cnx.Close();
Response.Write("TimeOut");
Response.End();
}
protected void Page_PreRenderComplete(object sender, EventArgs e)
{
//gridTasks.DataSource = dt;
//gridTasks.DataBind();
}
private void AddListViewItem(
//Guid guid,
int taskID,
int testNumber,
string sTime)
{
DataRow drow = dt.NewRow();
//drow["Task ID"] = guid.ToString();
drow["Task ID"] = taskID.ToString();
drow["Order ID"] = testNumber.ToString();
drow["Start Time"] = sTime;
drow["End Time"] = "---";
drow["Order Amount"] = "---";
dt.Rows.Add(drow);
gridTasks.DataSource = dt;
gridTasks.DataBind();
}
private void UpdateListViewItem(
Tasks task,
float Amount,string eTime
)
{
try
{
int i = 0;foreach (DataRow drow in dt.Rows)
{
//if ((Guid)lvi.Tag == guid)
//Guid g = new Guid(drow["Task ID"].ToString());
int tid = int.Parse(drow["Task ID"].ToString());if (tid == task.TaskID)
{
//drow["End Time"] = eTime;
//drow["Order Amount"] = Amount.ToString();
dt.Rows[i]["End Time"] = eTime;dt.Rows[i]["Order Amount"] = Amount.ToString();
dt.AcceptChanges();
break;
}
i++;
}
gridTasks.DataSource = dt;
gridTasks.DataBind();
}
catch (Exception ex)
{
}
}
protected void Button2_Click(object sender, EventArgs e)
{
System.Threading.Thread.Sleep(2000);Label2.Text = DateTime.Now.ToLongTimeString();
}
protected void Button3_Click(object sender, EventArgs e)
{
System.Threading.Thread.Sleep(2000);
Label3.Text = DateTime.Now.ToLongTimeString();
}
}
|
|
|
|
|
Hi All,
I need to use AJAX CascadingDropDown and AutoCompleteExtender together, i mean I have to combine these two controls but I am not getting how to do this.
My code is works fine if I use these two controls separately but when I combine these 2 controls, I dont get the proper result.
Please help me...
Thanks in advance...
|
|
|
|
|
AutoCompleteExtender Control is used for Textbox.It returns result of string on KeyChange event of TextBox. CascadingDropDown Control is used for multiple DropdownList.
I combine these 2 controls
Can U tell me How did u combine these two controls.?
Best regard
Pathan
---------------------------------------------------
|
|
|
|
|
Some what like this:
"
<code>
<ajaxToolkit:CascadingDropDown ID="CascadingDropDown4" runat="server" TargetControlID="ddlCompany"
ParentControlID="ddlSubIndustry" Category="Company" PromptText="Select Company"
ServicePath="AutoComplete.asmx" ServiceMethod="GetTicker" />
<asp:DropDownList ID="ddlCompany" runat="server" Width="222px"
OnSelectedIndexChanged="ddlCompany_SelectedIndexChanged">
</asp:DropDownList>
<asp:TextBox runat="server" ID="myTextBox" Width="234px" autocomplete="off" Style="font-size: 9pt"
CssClass="blue-text" Height="14px" />
<ajaxToolkit:AutoCompleteExtender runat="server" ID="autoComplete1" TargetControlID="myTextBox"
ServicePath="AutoComplete.asmx" ServiceMethod="GetCompletionList1" MinimumPrefixLength="0"
CompletionInterval="1000" EnableCaching="true" CompletionSetCount="12"
CompletionListElementID="ddlCompany" /> </code> "
|
|
|
|
|
What is CompletionListElementID in AutoCompleteExtender?.and Why did u use dropdownlist 'ddlCompany' in AutoCompleteExtender?
Can I see GetCompletionList1 Method?
Best Regard
Pathan
---------------------------------------------------
|
|
|
|
|
As I want to show it in list formate so I use this "CompletionListElementID"
and the code for GetCompletionList1 is below:
public string[] GetCompletionList1(string prefixText, int count)
{
conn.ConnectionString = cs.connectionDBcentral();// new SqlConnection("server='192.168.11.7'; user id='cd'; password='cd'; database='DbCentralData'");
DataTable dtReturn = new DataTable();
conn.Open();
SqlCommand cmd = new SqlCommand("SELECT Top 10 Ticker,coname FROM tbCompMaster where (Ticker like @searchterm or coname like @searchterm )ORDER BY coname ", conn);
SqlParameter param = new SqlParameter();
param.ParameterName = "@searchterm";
prefixText.Trim().Replace("'", "''");
prefixText += "%";
param.Value = prefixText;
cmd.Parameters.Add(param);
SqlDataAdapter adpt = new SqlDataAdapter(cmd);
adpt.Fill(dtReturn);
//Random random = new Random();
List<string> items = new List<string>(count);
for (int i = 0; i < dtReturn.Rows.Count; i++)
{
string c1 = (string)dtReturn.Rows[i]["Ticker"];
string c2 = "-";
string c3 = (string)dtReturn.Rows[i]["coname"];
items.Add(c1 + c2 + c3);
}
conn.Close();
return items.ToArray();
}
Actually I have return another fuunction which fills Company Combo and it is:
public CascadingDropDownNameValue[] GetTicker(string knownCategoryValues, string category)
{
string[] SectorValues = knownCategoryValues.Split(';');
string[] cou = SectorValues[0].Split(':');
Session["Country"] = cou[1];
string[] sec = SectorValues[1].Split(':');
string[] subindustry = SectorValues[2].Split(':');
Session["SubindustryID"] = subindustry[1];
string key = "Category" + subindustry[1];
DataSet ds = (DataSet)HttpContext.Current.Cache[key];
ds = new DataSet();
SqlConnection myConnection = new SqlConnection();
if (ds != null)
{
switch (Convert.ToInt16(Session["Country"]))
{
case 1:
conn.ConnectionString = cs.connectionUS();
break;
case 2:
conn.ConnectionString = cs.connectionUK();
break;
case 3:
conn.ConnectionString = cs.connectionJP();
break;
default:
conn.ConnectionString = cs.connectionUS();
break;
}
conn.Open();
SqlCommand cmd = new SqlCommand();
cmd.Connection = conn;
string strcomp = sec[1] + "______";
cmd.CommandText = " SELECT Top 10 Ticker,coname FROM tbCompMaster where GICSCode =" + Session["SectorID"] + " or GICSCode=" + Session["SubindustryID"] + " ORDER BY coname";
SqlDataAdapter adpt = new SqlDataAdapter(cmd);
adpt.Fill(ds);
DateTime t =DateTime.Now.AddHours(24);
HttpContext.Current.Cache.Insert(key, ds);
conn.Close();
}
else
{
ds = (DataSet)HttpContext.Current.Cache[key];
}
List<ajaxcontroltoolkit.cascadingdropdownnamevalue> values = new List<ajaxcontroltoolkit.cascadingdropdownnamevalue>();
foreach (DataRow row in ds.Tables[0].Rows)
{
values.Add(new AjaxControlToolkit.CascadingDropDownNameValue(row["coname"].ToString(), row["Ticker"].ToString()));
}
return values.ToArray();
}
But I am not getting how to combine these two function so that it works fine.
Please help me...
Thanks again...
|
|
|
|
|
I have designed one form where there is a datagrid having included all the generation operations like edit, delete data.I have used sql server 2005 to bring data to the datagrid.Now when i dont include the master page in this form and try to run this form alone,it gives flawless output.But when i include the master page in this form and try to run this form, it gives error like:
Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that <machinekey> configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster.
Anybody can tell me why such error generally occurs and how to debug this ???Where to give this machine key ??
suchitamanandhar@hotmail.com
|
|
|
|
|
For my website i'm using the login controls from the toolbox of visual web developer.
When a staff gets validated he/she gets directed to the staff page instantly
When a Manager gets validate he/she gets directed to the manager page instantly.
Anyone has any clue as to how to do this.
I hate using a code based login.
|
|
|
|
|
just check the credentials Put one Home page or any page after login in that check the type of user from database or where you are storing then have if or switch statement check the credentials then just transfer to that page
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
|
follow the steps
1.create two folders one.Manager and other Staff
2.Put all MAnager related pages in manager folder and all Staff related in staff folder.
3.create two roles.one for manager and other staff.
4.On login check role of the user and redirected to respective page.
5.in web.config file under location tag specify allow roles for each folder.
any problem ?
satyaki mishra
|
|
|
|
|
Hi all,
When i change any file in my project i got the the message as access denied
and i have checked and given the permission for those folders, still i am getting the access denied problem for particular files.But i can add,update and delete new files.I am getting the error for some of the Files only. what is the reason?
and how to solve those problems?
Thanks,
Ramesh A.
|
|
|
|
|
Files should be Read only or in Used.Check out property of file
Best Regard
Pathan
---------------------------------------------------
|
|
|
|
|
I have checked that one also,the files are not read only.But the files that was added now are working very well and we have given full access to the folder also.But the same error is coming in the online.
|
|
|
|