|
hi
You get query string value like this
String str=REquest.querystring("id")
Known Is Drop.Unknown Is Ocean
|
|
|
|
|
hi
Code behind:
Dim dgitem As DataGridItem
For Each dgitem In Dgdisplay.Items
If cacheRankingName = "cumulativeranking" Then
'If dgitem.ItemType.Item = ListItemType.Header Or dgitem.ItemType.Item = ListItemType.AlternatingItem Or dgitem.ItemType.Item = ListItemType.Item Then
Dim dt As New DataTable
qrytoExecute = "select playerid, firstname , lastname, scores.points as leaderboarddisplay from scores " & qrytoAdd
qrytoExecute &= "group by scores.playerid order by leaderboarddisplay desc, playerid limit 30 "
dt = DBManager.GetDataTable(qrytoExecute)
For i = 0 To dt.Rows.Count - 1
Dim id As String = dt.Rows(i)("playerid").ToString()
Dim Query As String = "select concat(p.firstname,p.lastname) as Name from player p join scores s on s.playerid=p.userid where s.playerid=" & id
Dim retVal = DBManager.GetScalar1(Query)
Dim lbl As Label
Dim intCounter As New Integer
Dim str As String = DirectCast(dgitem.Cells(0).Controls(0), Label).Text
'If txtHNGet.Text = retVal Then
' 'flag = True
' dgitem.Cells(1).BackColor = System.Drawing.Color.DarkRed
'End If
Next
End If
'End If
Exit For
Next
End If
Html:
<asp:datagrid id="Dgdisplay" EnableViewState="False" Runat="server" PageSize="50" GridLines="None"
AutoGenerateColumns="False" Width="65%" AllowPaging="True">
<Columns>
<asp:TemplateColumn HeaderStyle-Font-Bold="True" HeaderText="Rank">
<ItemTemplate>
<asp:Label ID="lblrank" Runat="server">
<%#getRank%>
</asp:Label>
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderStyle-Font-Bold="True" HeaderText="Playername">
<ItemTemplate>
<a href='DisplayPlayerBioData.aspx?ids=<%#Container.DataItem("playerid")%>'>
<%#getPlayerName(Container.DataItem("firstname"),Container.DataItem("lastname"))%>
</a>
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderStyle-Font-Bold="True" HeaderText="Count#">
<ItemTemplate>
<asp:Label ID="lblcount" Runat="server">
<%#DataBinder.Eval(Container.DataItem,"leaderboarddisplay")%>
</asp:Label>
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn Visible="False">
<ItemTemplate>
<asp:Label ID="lbl1" Runat="server">
<%#getPlayerName(Container.DataItem("firstname"),Container.DataItem("lastname"))%>
</asp:Label>
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
<PagerStyle Mode="NumericPages" ForeColor="#003300" PageButtonCount="2" HorizontalAlign="Right"
VerticalAlign="Top" Font-Bold="True"></PagerStyle>
</asp:datagrid>
i need to get datagrid cell value in codebehind..
here
Dim str As String = DirectCast(dgitem.Cells(0).Controls(0), Label).Text
//error displayed Specified cast is not valid.
Datagrid contain in webusercontrol
how can i get cell value...
Known Is Drop.Unknown Is Ocean
|
|
|
|
|
hi try this,
Dim str As String= CType(dgi.Cells(0).Controls(0), Label).Text
and be sure that control(0) of cell(0) is text field
|
|
|
|
|
I am trying to start/stop a windows service in the code from a web application.The web application runs as IUSR_ComputerName, but this account does not have enough access rights to star/stop the service.
How do I impersonate the local system account, so that I can stop/start the service?
|
|
|
|
|
|
Hi...
I am trying have a dropdownlist which displays a calendar when the drop down arrow is clicked. I am having hard time in figuring it out. Plz tell me hw to achieve it.
Thanks in advance...
|
|
|
|
|
|
You can use the AjaxControlToolkit
With it you can assign a calendar to a textbox with almost no code at all
Alexei Rodriguez
|
|
|
|
|
Please Help Me Out :
I Want to Control The Client Browser i.e When ever a Specific URL Appears in the Client Browser Then The User Must be Redirected To Specified URL.
|
|
|
|
|
what is the problem with this.
If you programmatically want to do, just in your handler, try to transfer your response to the page if certain request occurs.
To get IP use
Request.Servervariables("REMOTE_ADDR")
You can get the absolute URI from this
Request.Url.AbsoluteUri
Now use Server.Transfer to the page.
Otherwise you can also use
<urlMappings enabled="true">
<add url="~/Info/Copyright.aspx" mappedUrl="~/Help/Copyright.aspx" />
<add url="~/Support/Contacts.aspx" mappedUrl="~/Help/Contacts.aspx" />
</urlMappings>
in Web.Config if you want this automatically.
|
|
|
|
|
My Websites are hosted, some times i got error as
Compiler Error Message: CS1056: Unexpected character ''
Error Reported is as
Source Error:
Line 1:
Line 2: áO浦浙á°潥
Line 3: 卤
Line 4: áO浦浙á°†捡ュュ潥
Show Detailed Compiler Output:
c:\windows\system32\inetsrv> "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\csc.exe" /t:library /utf8output /R:
"C:\WINDOWS\assembly\GAC_MSIL\System.Configuration\2.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll" /R:
"C:\WINDOWS\assembly\GAC_MSIL\System\2.0.0.0__b77a5c561934e089\System.dll" /R:
"C:\WINDOWS\assembly\GAC_MSIL\System.Web.Services\2.0.0.0__b03f5f7f11d50a3a\System.Web.Services.dll" /R:
"C:\WINDOWS\assembly\GAC_32\System.Data\2.0.0.0__b77a5c561934e089\System.Data.dll" /R:
"C:\WINDOWS\assembly\GAC_MSIL\System.ServiceModel.Web\3.5.0.0__31bf3856ad364e35\System.ServiceModel.Web.dll"
/R:
"C:\WINDOWS\assembly\GAC_MSIL\System.Xml\2.0.0.0__b77a5c561934e089\System.Xml.dll" /R:
"C:\WINDOWS\assembly\GAC_MSIL\System.Drawing\2.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll" /R:
"C:\WINDOWS\assembly\GAC_32\System.EnterpriseServices\2.0.0.0__b03f5f7f11d50a3a\System.EnterpriseServices.dll" /R:
"C:\WINDOWS\assembly\GAC_MSIL\System.WorkflowServices\3.5.0.0__31bf3856ad364e35\System.WorkflowServices.dll"
/R:
"C:\WINDOWS\assembly\GAC_MSIL\System.ServiceModel\3.0.0.0__b77a5c561934e089\System.ServiceModel.dll"
/R:"
C:\WINDOWS\assembly\GAC_MSIL\System.Runtime.Serialization\3.0.0.0__b77a5c561934e089\System.Runtime.Serialization.dll"
/R:
"C:\WINDOWS\assembly\GAC_MSIL\System.Web.Mobile\2.0.0.0__b03f5f7f11d50a3a\System.Web.Mobile.dll" /R:
"C:\WINDOWS\assembly\GAC_32\System.Web\2.0.0.0__b03f5f7f11d50a3a\System.Web.dll" /R:
"C:\WINDOWS\assembly\GAC_MSIL\System.IdentityModel\3.0.0.0__b77a5c561934e089\System.IdentityModel.dll" /R:
"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\a7fd3a8e\282a6669\
assembly\dl3\a75afeae\db46742f_f447c901\SMSDLL.DLL" /R:
"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\mscorlib.dll"
/out:
"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\a7fd3a8e\282a6669\App_Code.ckhtcfi8.dll"
/debug- /optimize+ /w:4 /nowarn:1659;1699;1701
"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\a7fd3a8e\282a6669\App_Code.ckhtcfi8.0.cs"
"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\a7fd3a8e\282a6669\App_Code.ckhtcfi8.1.cs"
Microsoft (R) Visual C# 2005 Compiler version 8.00.50727.3053
for Microsoft (R) Windows (R) 2005 Framework version 2.0.50727
Copyright (C) Microsoft Corporation 2001-2005. All rights reserved.
This is frequent Issue with webserver, the same code works fine with local testing servers.
When the error is reported, it is fixed in few mintues by host.
Can anybody tell me, what is the exact issue behing this
|
|
|
|
|
something tells me it has to do with text Encodings.
Char '' is ASCII another value than in other ISO-languages.
In Word you can only store 2 bytes. That is why I use Writer.
|
|
|
|
|
Dear All,
Sorry for the repeat post, but i want the solution for this problem.
I have created a web application which includes crystal report for reports. Now the problem is that my reports were not working on the webserver.
The Application works Perfectly on my local machine in IIS and in .net environment but if i upload the same application on the web server it shows the error.
<per>
An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.
Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "Off".
What could be the solution
Thanks and Regards
Yogesh Agarwal
|
|
|
|
|
yogesh_kumar_agarwal wrote: What could be the solution
Enable error reporting and see the error message. Once you fix it, disable the error reporting.
|
|
|
|
|
Hi, Thanks for the reply, I set the mode to off then i get the follwoing error message. Which is my actual problem that crystal report is not working on server.
Parser Error Message: Could not load file or assembly 'CrystalDecisions.Web, Version=10.5.3700.0, Culture=neutral, PublicKeyToken=692fbea5521e1304' or one of its dependencies. The system cannot find the file specified.
Source Error:
Line 73: </customErrors>
Line 74: -->
Line 75: <httpHandlers><add verb="GET" path="CrystalImageHandler.aspx" type="CrystalDecisions.Web.CrystalImageHandler, CrystalDecisions.Web, Version=10.5.3700.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/></httpHandlers></system.web>
Line 76: <system.webServer><handlers><add name="CrystalImageHandler.aspx_GET" verb="GET" path="CrystalImageHandler.aspx" type="CrystalDecisions.Web.CrystalImageHandler, CrystalDecisions.Web, Version=10.5.3700.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" preCondition="integratedMode"/></handlers><validation validateIntegratedModeConfiguration="false"/></system.webServer></configuration>
Source File: f:\inetpub\vhosts\aiivt.com\subdomains\market\httpdocs\web.config Line: 75
Yogesh
|
|
|
|
|
Copy the following files to the BIN folder of your application.
crystaldecisions.crystalreports.engine.dll.
crystaldecisions.reportsource.dll
crystaldecisions.shared.dll
crystaldecisions.web.dll
|
|
|
|
|
Hi, Thanks for the reply. Now the following error comes into the picture.
Parser Error Message: Could not load file or assembly 'CrystalDecisions.ReportAppServer.ClientDoc, Version=10.5.3700.0, Culture=neutral, PublicKeyToken=692fbea5521e1304' or one of its dependencies. The system cannot find the file specified.
Source Error:
Line 31: <add assembly="CrystalDecisions.Shared, Version=10.5.3700.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
Line 32: <add assembly="CrystalDecisions.Web, Version=10.5.3700.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
Line 33: <add assembly="CrystalDecisions.ReportAppServer.ClientDoc, Version=10.5.3700.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
Line 34: <add assembly="CrystalDecisions.Enterprise.Framework, Version=10.5.3700.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
Line 35: <add assembly="CrystalDecisions.Enterprise.InfoStore, Version=10.5.3700.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/></assemblies></compilation>
Source File: f:\inetpub\vhosts\aiivt.com\subdomains\market\httpdocs\web.config Line: 33
Previousally i tried the same i got the same error message. and i upload the same code on to different server then i got the message for
"Required Permission not Acquired"
Thanks
Yogesh
|
|
|
|
|
Make sure the versions specified in your config file exist in the server. This error may come when versions are not matching.
|
|
|
|
|
i hosted my website on a shared hosting server. Now how could i check the same. My vendor ask that we are not providing the CR support on the server.
But i made some google R&D and found that there is no requirment to install the crystal report separately on the server the support is included with in the .net framework which is available on my server bcoz application without CR is working good on my server.
So plz suggest what could i do to run CR on my server.
Regards
Yogesh Agarwal
|
|
|
|
|
I use nodaddy, oops, i mean godaddy (shared hosting), and i couldnt use CR, i asked them, and they said they had no support for CR, i guess they disable it in shared hostings, because they want you to pay more $$$ for a dediated server
Alexei Rodriguez
|
|
|
|
|
ha ha ha ha.....
Thanks for the reply buddy, i think you are right bcoz,
One of my friend gave me the details for his dedicated server, and i just install the CR redistributable runtime on that server and my reports start working there.
So i came to the results that the server must have atleast the redist. package to run CR. But now the another doubt is,
the redist is available free of cost from Business Object's website and from Microsoft also. So Is there is some license is required if we install that on our server
Yogesh
|
|
|
|
|
Use of prepared statement for displaying data in gridview
|
|
|
|
|
Prepared???
Alexei Rodriguez
|
|
|
|
|
Prepared statements are JAVA's method for writing parametrized SQL, right? In .NET, you call it as parameterized queries. You write it like
string query = SELECT * FROM SomeTable WHERE SomeId = @id;
......
yourCommand.Parameters.AddWithValue("@id",someid); For more information, read SQL Injection Attacks and Some Tips on How to Prevent Them[^]
|
|
|
|
|
Are you talking about JDBC.
If so look into this...
http://java.sun.com/docs/books/tutorial/jdbc/basics/prepared.html[^]
If you are talking about ASP.NET
it will be similar, just you need to replace the ? marks with appropriate names.
Thus instead of
PreparedStatement updateSales = con.prepareStatement(
"UPDATE COFFEES SET SALES = ? WHERE COF_NAME LIKE ? ");
updateSales.setInt(1, 75);
updateSales.setString(2, "Colombian");
updateSales.executeUpdate():
We write
SqlCommand cmd = new SqlCommand("UPDATE COFFEES SET SALES = @psales WHERE COF_NAME LIKE @pconfname",connection);
cmd.Parameters.add("@psales",SqlDbType.Int);
cmd.Parameters("@psales").Value = 75;
cmd.parameters.add("@pconfname",SqlDbType.Varchar);
cmd.Parameters.add("@pconfname").Value = "Colombian";
cmd.ExecuteNonQuery();
Hope you get this.
|
|
|
|