|
Someone to help me please.
I want a checkbox as part of my gridview and also use the checkbox to select the rows that are checked.
How do know the rowindex of the checked row and iterate thru the checked rows?
t.aransiola
|
|
|
|
|
Depending on the size of the GridView you could try:
foreach(row in gridview)
checkbox = row.findcontrol(check box id);
if(checkbox.checked)
this row is checked
endforeach
Obviously the above will need some interpretation (and off the top of my head I'm not sure whether its the row or the cell that is the INamingContainer?)
|
|
|
|
|
I have an application which communicates with WebServcie.I installed the application and the WS on a srever of test,i've got all the results i'm waiting for.But when I installed the Web site and the WS on the WEBFARM, the Web site did no longer communicate with the WS. The site can communicate with the WS installed on the server of test.And another site installed on a site different from the WEBFARM can communicate with the WS installed on the WEBFARM.
The problem is that the Web site installed in WEBFARM cannot communicates with the WS installed on the same WEBFARM. What to do!
Here is a snapshot of the debugging window showing the emerged errors:
A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[SocketException (0x274c): A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond]
System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress) +1002066
System.Net.Sockets.Socket.InternalConnect(EndPoint remoteEP) +33
System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception& exception) +431
[WebException: Unable to connect to the remote server]
System.Net.HttpWebRequest.GetRequestStream() +1504445
System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) +103
PTF2_EVALTA.InfoAgent.test(String chaine) in d:\BuildAreas\mk_build\PTF2_EVALTA\V0.013\PROJECTS\PTF2_EVALTA\Web References\PTF2_EIDS_WebService\Reference.cs:90
PTF2_EVALTA.WebForm1.Page_Load(Object sender, EventArgs e) in d:\BuildAreas\mk_build\PTF2_EVALTA\V0.013\PROJECTS\PTF2_EVALTA\PTF2_EVALTA_APP\WebForm1.aspx.cs:34
System.Web.UI.Control.OnLoad(EventArgs e) +99
System.Web.UI.Control.LoadRecursive() +47
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1061
mouadh trabelsi
|
|
|
|
|
It is working fine on Development Server Cassini but doesn't work on IIS5.0 and 5.5
|
|
|
|
|
How do you define your custom handler? How do you configure that handler?
|
|
|
|
|
Hi Sandeep,
Please check the code and let me know.
Imports System.Data
Imports System.Data.SqlClient
Imports Microsoft.Reporting.WebForms
Partial Class Member_Members
Inherits System.Web.UI.Page
Protected Sub btnSearchMember_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSearchMember.Click
Dim con As DataAccess = New DataAccess()
Dim conLessons As SqlConnection = con.SQLConnnect()
Dim cmd As SqlCommand = New SqlCommand()
Dim _DataReader As SqlDataReader
Dim _DataSet As DataSet = New DataSetMember()
Dim _ReportDataSource As ReportDataSource = New ReportDataSource()
Try
conLessons.Open()
cmd.CommandType = CommandType.Text
cmd.Connection = conLessons
cmd.CommandText = "Select AutoID, ForeName, SurName From Members Where AutoID=" & TextBox1.Text & ""
_DataReader = cmd.ExecuteReader()
_DataSet.Tables(0).Load(_DataReader)
_DataReader.Close()
conLessons.Close()
ReportViewerMembers.LocalReport.ReportPath = Server.MapPath("~/Member/ReportMembers.rdlc")
_ReportDataSource.Name = "DataSetMember_Members"
_ReportDataSource.Value = _DataSet.Tables(0)
ReportViewerMembers.LocalReport.DataSources.Add(_ReportDataSource)
ReportViewerMembers.LocalReport.Refresh()
Catch ex As Exception
If conLessons.State = ConnectionState.Open Then
conLessons.Close()
End If
End Try
End Sub
End Class
First Time Im getting the report on particular Member but the Second time code is working but cant get the particular member details, its remain same.
1stTime : textbox1 = 5 getting customer details whose id is 5
2ndTime : textbox1 = 6 cant get the details of customer id 6 , reportviewer cant change the customer details, its again showing the customer id = 5
Sarfarj Ahmed
|
|
|
|
|
hi guys..
can anyone provide me some info. on e-billing..i m developing a website which requires credit card transactions online..
|
|
|
|
|
You need PayPal or a Merchant Account from Verisign or your local financial institution like Icici PaySeal in India.
|
|
|
|
|
thanks for ur prompt reply deepak..
i wud try ur suggestions..
|
|
|
|
|
in one crystal report i have one formula field
my formula contains no errors but the answer is not coming.
plse correct the following
local numbervar hours;
local numbervar minutes;
local numbervar seconds;
hours := hour({tbl_jip.start_time}) * 3600;
minutes := minute({tbl_jip.start_time}) * 60;
seconds := second({tbl_jip.start_time});
local numbervar start=hours + minutes + seconds;
local numbervar hours1;
local numbervar minutes1;
local numbervar seconds1;
hours1 := hour({tbl_jip.end_time}) * 3600;
minutes1 := minute({tbl_jip.end_time}) * 60;
seconds1 := second({tbl_jip.end_time});
local numbervar end=hours1 + minutes1 + seconds1;
local numbervar tot=end-start;
local numbervar RemainingSeconds;
local numbervar Hours ;
local numbervar Minutes;
local numbervar Seconds;
Hours := truncate(tot / 3600);
RemainingSeconds := tot - (Hours * 3600);
Minutes := truncate(RemainingSeconds/60);
Seconds := tot - (Hours * 3600) - (Minutes * 60);
totext(Hours,"00") + ":" + totext(Minutes,"00") +":" + totext(Seconds,"00")
where start_time & end_time are the 2 fields in tbl_jip table
Regards
yaso
|
|
|
|
|
What do you want to achieve with this formula? so that we will know what you are expecting to display
t.aransiola
|
|
|
|
|
hi friends
i have three table
one is category with catid and catname
second is product with catid,proid and proname
third is item with proid,itemid,item name,price,...etc
now i want to bind it in below format
category name2
product name
item name1 price ..... .... .... ... ...
item name2 price ..... .... .... ... ...
.
.
category name2
product name2
item name price . . . . .
.
.
i think all of u understand my problem
but i cant get any idea which control i have to use.
plz give me some idea
thanks
pathan
|
|
|
|
|
Are you trying to say that "want to combine one query which conatains data of three tables related with them: Categories with Product , Item with Product"
something like this:
select C.*,P.*,I.*
from Categories as C,Products as P, Items as I
where P.IDCategory = C.ID and I.IDProduct = P.ID
|
|
|
|
|
No.i have no query problem i have a problem that which control is used to bind in this format
pathan
|
|
|
|
|
HI Imran i have ddone this its better to create custom control than using DataGrid or Repeater any thing create a custom control and develop logic you can do any thing with as you are going to write all those controls in render method ?
|
|
|
|
|
Thanks for ur reply sandeep
i will try to create custom control
pathan
|
|
|
|
|
DataGrid with TemplateColumn will solve your problem. Inside the TemplateColumn use a table to structure the data the way you want.
Thanks,
Pradipta Basu
|
|
|
|
|
I need to pass a variable to the controlid of a ControlParameter so i can tell a Gridview which row the dropdownlist im editing belongs to.
What would be the best moethod for setting the control id?
Thanks.
|
|
|
|
|
Basically, the ControlParameter does not support the DataBinding event so you cannot use a data binding expression to set the ControlID property of the parameter, and your choice is to do this in code. Also, you need to be aware that the ControlID property needs to be updated before it is used to populate the value, if it happens after then you'll get an error as the specified control is not found. Normally, the ControlParameter uses its ControlID property to evaluate the parameter value in the overridable Evaluate method which occurs in the LoadComplete event of the Page instance. So you can put your code to update the ControlID in the events (of the data source control or the Page instance) that happens before the Page_LoadComplete and of cource after the data source control is built. For example, you can use the Load event of the data source control:
protected void SqlDataSource1_Load(object sender, EventArgs e)
{
ControlParameter para = SqlDataSource1.UpdateParameters[0] as ControlParameter;
para.ControlID = "GridView1$ctl0" + (GridView1.EditIndex + 2) + "$DropDownList1";
}
where the EditIndex property of the GridView control will give you the index of the row being edited, this is a zero-based value, however the index used in the UniqueID of the dropdownlist is a one-based value and it is counted from the header row. Therefore, you have to add 2 to the EditIndex to get the correct number used in the UniqueID.
|
|
|
|
|
Hi,
I have used below code (asp.net 2.0) to Save the Table (GridView 'GrdDynamic') in Webpage into a microsoft WORD file(.doc). But the below code Writes the Entire Web Page into Word file. How can I Save only the Portion (few Controls) of the page?
Response.Clear()
Response.ClearHeaders()
Response.ContentType = "application/msword"
Response.BufferOutput = False
'Response.Charset = ""
'tw.WriteLine("Weekly Report")
GrdDynamic.RenderControl(tw)
'Response.AppendHeader("Content-Disposition", "Attachment; Filename=demo.doc")
Me.EnableViewState = False
Response.Write(sw.ToString())
Dim fileToDownload As FileInfo = New FileInfo(strFileName)
Response.Flush()
Response.WriteFile(fileToDownload.FullName)
Response.End()
Regards,
Jay
|
|
|
|
|
protected void GV_account_RowDataBound(object sender, GridViewRowEventArgs e)<br />
{<br />
DataSet ds =new DataSet();<br />
ds=(DataSet)Session["ds"];<br />
Label lbl_title=new Label();<br />
lbl_title = (Label)e.Row.FindControl("lbl_title")<br />
lbl_title.Text =Convert.ToString(ds.Tables[0].Rows[0]["sex"]);<br />
<br />
'<br />
'<br />
'<br />
'<br />
'<br />
'<br />
'<br />
'<br />
<br />
<br />
}
Object reference not set to an instance of an object.
error line:--lbl_title.Text = Convert.ToString(ds.Tables[0].Rows[0]["sex"]);
Pathan
|
|
|
|
|
imrankhanpathan wrote: Label lbl_title=new Label();
This line is pointless it has no effect other than to create an object that is never used. It should be merged next line in your code which retrieves the actual Label that you want.
imrankhanpathan wrote: lbl_title.Text = Convert.ToString(ds.Tables[0].Rows[0]["sex"]);
There are many possibilities here
* lbl_title is null
* ds is null
These are also possibilities, but they'll probably give a different exception:
* ds.Tables[0] is null (i.e. there are no tables)
* ds.Tables[0].Rows[0] is null (i.e. the table has no rows)
* ds.Tables[0].Rows[0]["sex"] is null (i.e. There is no column called "sex")
|
|
|
|
|
use break point itis good tool, to trace errors... press F11 to trace line by line... u will autometcally get whats the problem...
|
|
|
|
|
blue_arc wrote: use break point itis good tool, to trace errors... press F11 to trace line by line... u will autometcally get whats the problem...
Good advice, but when he has big long lines like this
lbl_title.Text =Convert.ToString(ds.Tables[0].Rows[0]["sex"]); then breakpoints become less useful. It is better to refactor the line out into several lines like this
DataTable table = ds.Tables[0];
DataRow row = table.Rows[0];
object sexColumnValue = row["sex"];
string text = sexColumnValue.ToString();
lbl_title.Text = text;
|
|
|
|
|
Colin Angus Mackay wrote: then breakpoints become less useful.
True, but the quick watch window will do partial evaluations - i.e. highlight ds.Tables, QW, and it will show the details of the tables collection. You can then work your way down the command till one returns an error in QW
"Now I guess I'll sit back and watch people misinterpret what I just said......"
Christian Graus At The Soapbox
|
|
|
|