15,892,161 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by gani7787 (Top 138 by date)
gani7787
23-Jan-20 23:30pm
View
Dear All,
pls. give us the correct direction to follow and print the data table values in appropriate cells in excel column based on my reference table...
gani7787
23-Jan-20 23:28pm
View
ok.i understood..can you pls. suggest me how to print in particular column values...?
gani7787
23-Jan-20 6:16am
View
int TotRows = dtMaster.Rows.Count; ==> This will count total number of data rows. ==> I think, this is not required.
TotRows = 12 + TotRows; ==> I want to print the data from Row no : 12
You can remove the above two steps also.
The aim is, data table values should start print from row.no:12 in the appropriate columns....
gani7787
23-Jan-20 5:56am
View
Thanks for your help...
getting error in the line as below
var tmp = dt.Rows[i][0].ToString();
Error : An unhandled exception of type 'System.IndexOutOfRangeException' occurred in System.Data.dll
Additional information: There is no row at position 3.
Ps : Can i print all the column values in the approriate excel column..?
pls. refer below screen shot for your reference.
https://1drv.ms/u/s!AiSRcgO5FUmNdcjWYVAuQiC8yuY?e=Y5fbJh
gani7787
29-Apr-19 3:23am
View
Below is my Request XML.
Request xml :
<s:envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:header>
<servicecontext token="temporary/127.0.0.1-1205239338115-25203285"
xmlns="http://context.core.datamodel.fs.documentum.abc.com/">
<identities xsi:type="RepositoryIdentity"
username="*****"
password="*****"
repositoryname="Test"
domain=""
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<runtimeproperties>
<s:body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<execute xmlns="http://core.services.fs.documentum.abc.com/">
<query xsi:type="q1:PassthroughQuery"
querystring="select Emp_id from employee where emp_number ='A-10101-SEC-A'" //passing emp_number
xmlns=""
xmlns:q1="http://query.core.datamodel.fs.documentum.abc.com/">
<q1:repositories>Test
<execution startingindex="0"
maxresultcount="100"
maxresultpersource="50"
cachestrategytype="DEFAULT_CACHE_STRATEGY"
xmlns="">
gani7787
4-Jan-19 5:42am
View
yes. ofcourse.
gani7787
21-Feb-18 1:03am
View
Thanks. great help...
it's working.
gani7787
21-Feb-18 0:47am
View
Deleted
Thanks for your help.
how to remove selected items from listview2
gani7787
13-Oct-17 8:46am
View
Thanks. it's working...
gani7787
13-Oct-17 8:08am
View
In my table some of the columns has null values.
when i am executing i getting error
Error : Object cannot be cast from DBNull to other types.
for (int colIndex = 5; colIndex <= 35; colIndex++)
{
double str1 = Convert.ToDouble(row[colIndex]); // Error : Object cannot be cast from DBNull to other types.
if (str1 == Score)// compare maxvalue
{
ColName = dt.Columns[colIndex].ColumnName;
break; // if matching the value then get the columnname and then exit the loop
}
}
How to handle null values if the column and rows has null values...
gani7787
13-Oct-17 7:13am
View
Deleted
below is my code...
dt ==> datatable
DataRow[] result = dt.Select(sqlcmd);
foreach (DataRow row in result)
{
}
gani7787
12-Oct-17 2:48am
View
Yes. i debugg and found the solution.
we need to enclose '(single quotes) before and after of A1.
Thanks buddy...
gani7787
12-Oct-17 2:17am
View
Yes. it tried different logic and code.
Thanks..this also will be helpful definitely..
but, what is the error.
i'm giving correct column name and it's value. then why it's showing the error.
Actually [A1] is not a column. it is a value..???
gani7787
12-Oct-17 1:39am
View
my complete code is below..tested and getting error in column not found.
DataTable dt = new DataTable();
dt.Columns.AddRange(new[] { new DataColumn("Studentno",typeof(int)),new DataColumn("GRADE"),new DataColumn("SUB B",typeof(int)),
new DataColumn("SUB C(MIN)",typeof(int)), new DataColumn("SUB C(MAX)",typeof(int)),new DataColumn("SUB D(MIN)",typeof(int)) ,
new DataColumn("SUB D(MAX)",typeof(int)), new DataColumn("FROM"),new DataColumn("TO"),new DataColumn("SUB E(MIN)",typeof(int)),
new DataColumn("SUB E(MAX)",typeof(int)),new DataColumn("Dept",typeof(string)) });
dt.Rows.Add(101, "A", 100, 80, 200, 200, 550, 20, 100, 200, 500,"A1");
dt.Rows.Add(101, "B", 100, 90, 300, 270, 200, 20, 100, null, null,"B1");
dt.Rows.Add(101, "B", 100, 200, 300, 100, 250, 20, 100, 100, 100,"C1");
dt.Rows.Add(101, null, 100, 200, 300, 100, 200, 20, 100, null, null,"D1");
List<string> AllColumns1 = new List<string>() { "GRADE", "SUB B" };
string[] AllColumns = AllColumns1.ToArray();
string string2 = "SUB C=100#SUB D=250#SUB E=300";
string[] paras = string2.Split('#');
List<datarow> list = new List<datarow>();
string sqlcmd = "";
for (int i = 0; i < paras.Length; i++)
{
string[] par = paras[i].Split('=');
string mixpar = par[0] + "(MIN)";
string maxpar = par[0] + "(MAX)";
int mvalue = Convert.ToInt32(par[1]);
sqlcmd += " ( [" + mixpar + "] < " + mvalue + " and [" + maxpar + "] > " + mvalue + " ) ";
if ((i + 1) != paras.Length)
{
sqlcmd += " and ";
}
}
// For From and To comparison
string FrS = "From";
string ToS = "To";
double msize = 20;
sqlcmd += " and ( [" + FrS + "] < " + msize + " and [" + ToS + "] > " + msize + " ) ";
// For dept
string strdeptvalue = "A1";
string strdept = "Dept";
sqlcmd += " and ( [" + strdept + "] = " + strdeptvalue + ") ";
DataRow[] result = dt.Select(sqlcmd);
List<string> result1 = new List<string>();
for (int i = 0; i < AllColumns.Length; i++)
{
foreach (DataRow row in result)
{
result1.Add(AllColumns[i] + "=" + row[AllColumns[i]]);
}
}
gani7787
12-Oct-17 1:02am
View
Thanks for your excellent code..
is it possible to add where condition in that for each loop.
i want to more filter like below.. (using linq is used earlier)
where
let FrS = Convert.ToDouble(row.Field<double>("FROM"))
let ToS = Convert.ToDouble(row.Field<double>("TO"))
row.Field<string>("GRADE") == grd &&
val >= FrS && val <= ToS
Note : What happened if the column value is null. how to handle the null condition..??
I have tried the below code. i'm getting error. cannot find column A1.
// For From and To comparison
string FrS = "From";
string ToS = "To";
double msize = 20;
sqlcmd += " and ( [" + FrS + "] < " + msize + " and [" + ToS + "] > " + msize + " ) ";
// For dept
string strdeptvalue = "A1";
string strdept = "Dept";
sqlcmd += " and ( [" + strdept + "] = " + strdeptvalue + ") ";
How to change your code like above conditions...?????
below is my updated datatable..
DataTable dt = new DataTable();
dt.Columns.AddRange(new[] { new DataColumn("Studentno",typeof(int)),new DataColumn("GRADE"),new DataColumn("SUB B",typeof(int)),
new DataColumn("SUB C(MIN)",typeof(int)), new DataColumn("SUB C(MAX)",typeof(int)),new DataColumn("SUB D(MIN)",typeof(int)) ,
new DataColumn("SUB D(MAX)",typeof(int)), new DataColumn("FROM"),new DataColumn("TO"),new DataColumn("SUB E(MIN)",typeof(int)),
new DataColumn("SUB E(MAX)",typeof(int)),new DataColumn("Dept",typeof(string)) });
dt.Rows.Add(101, "A", 100, 80, 200, 200, 550, 20, 100, 200, 500,"A1");
dt.Rows.Add(101, "B", 100, 90, 300, 270, 200, 20, 100, null, null,"B1");
dt.Rows.Add(101, "B", 100, 200, 300, 100, 250, 20, 100, 100, 100,"C1");
dt.Rows.Add(101, null, 100, 200, 300, 100, 200, 20, 100, null, null,"D1");
gani7787
11-Oct-17 8:08am
View
The code is not filtering properly.
i want to convert into linq in the above code.
because i have more where condition..
that's why...??
gani7787
18-Jul-17 2:43am
View
How to apply the formula.
For example,Input Parameter is
A=200
B=400
C=90
D=80
E=70
F=100
G=200
So the student1 like below.
string student1 = "Sub1 = A+B-C,Sub2=D+E-A,Sub3=F-B+G";
Sub1,Sub2,Sub3,etc value it may change in some other name in future. that's why i want to store as it is the name of left hande side variable.
So the final output is
String[] Subjects; // So subjects should be below value
So the final result should be for the subjects.
Sub1[0] = 510
Sub2[1] = -50
Sub3[2] = 500
gani7787
18-May-17 2:13am
View
Thanks for your result.
My query like below in LINQ without lambda expression.
Tempvalues1 = "S1","S2"; ==> For contain value
Tempvalues2 = "Fi","k"; ==> for doesn't contain value
qry = (from r in tbl1.AsEnumerable()
where r.Field<int>("EmpNo") == Emp && r.Field<string>("Temp").Contains(TempValues1)
&& !(r.Field<string>("Temp").Contains((TempValues2)))
select new
{
}).Count();
how to get the count of the filter recrods..?
gani7787
18-May-17 2:13am
View
what about the does not contain value like "Fi" and "K"..?
whaere we need to add in the query..?
gani7787
24-Apr-17 1:27am
View
Thanks.
Now i solved the rowindex error.
But, mainly i have two important points to discuss.
Scenario : when i selected the row in gridview1, then it should bring all the employee records in gridview2 based on gridview1 index selection.
Problem_1 : In gridview i have "n" number of rows. when i select then it should maintain the same position even if scrolling the rows. the below code is working for selected rows maintain the same postion. But, SeletedIndex Changed Event not Firing
e.Row.Attributes("onmouseover") = String.Format("RowMouseOver({0});", e.Row.RowIndex)
e.Row.Attributes("onmouseout") = String.Format("RowMouseOut({0});", e.Row.RowIndex)
e.Row.Attributes("onclick") = String.Format("RowSelect({0});", e.Row.RowIndex) (event not Firing)
Problem_2 : Suppose selected row not maintain the same position,but, it will bring all the records in gridview2. It means selectedIndexchanged is firing. The below code is working for that.
e.Row.Attributes("onmouseover") = String.Format("RowMouseOver({0});", e.Row.RowIndex)
e.Row.Attributes("onmouseout") = String.Format("RowMouseOut({0});", e.Row.RowIndex)
'e.Row.Attributes("onclick") = String.Format("RowSelect({0});", e.Row.RowIndex) (event not Firing)
e.Row.Attributes.Add("onclick", Page.ClientScript.GetPostBackEventReference(grdSearchResult, "Select$" + e.Row.RowIndex.ToString())) (event firing).
My scenario is, i want to maintain selected row in the same position also it should fire the selectedIndexchanged event (both scenario).
Below is the common script
var gridviewID = "<%=grdSearchResult.ClientID%>";
var gridview = null;
var selectedRowIndex = -1;
$(document).ready(function () {
gridview = $('#' + gridviewID);
});
function RowMouseOver(rowIndex) {
if (selectedRowIndex == rowIndex) return;
var gridviewID = "<%=grdSearchResult.ClientID%>";
$('#' + gridviewID)[0].rows[rowIndex + 1].className = 'GridviewScrollItemHover';
}
function RowMouseOut(rowIndex) {
if (selectedRowIndex == rowIndex) return;
var gridviewID = "<%=grdSearchResult.ClientID%>";
$('#' + gridviewID)[0].rows[rowIndex + 1].className = 'GridviewScrollItem';
}
function RowSelect(rowIndex) {
if (selectedRowIndex == rowIndex) return;
RowReset(selectedRowIndex);
selectedRowIndex = rowIndex;
var gridviewID = "<%=grdSearchResult.ClientID%>";
$('#' + gridviewID)[0].rows[rowIndex + 1].className = 'GridviewScrollItemSelected';
}
function RowReset(rowIndex) {
var row = $('#' + gridviewID)[0].rows[rowIndex + 1]
if (row != null) {
row.className = 'GridviewScrollItem'
}
}
where is the problem....?
gani7787
21-Apr-17 9:08am
View
Thanks for your reply,
but, gridview_selectedIndexchanged not firing after using this code...
gani7787
16-Sep-16 0:58am
View
getting Error : "cannot download the information you requested".
gani7787
14-Sep-16 9:29am
View
Thanks for your great help.
your suggestions is great. can you pls. give one example to open http link using asp.net hyperlink in excel file. (http://sas02.sanet.sam.intranet/D2/servlet/Download?auth=basic&event_name=d2_view&_docbase=uatprjarea&id=09139&version=CURRENT) --> URL as empno like "1001"
gani7787
29-Jun-16 5:51am
View
Thanks for your reply.
i am using sitemap path menu and this will be enable based on the roles.
i have mentioned my role which is defined in web.config below.
<location path="Searchpage.aspx">
<system.web>
<authorization>
<allow roles="ADM">
<deny users="*">
<location path="user1.aspx">
<system.web>
<authorization>
<allow roles="ADM,USER1">
<deny users="*">
<location path="Home.aspx">
<system.web>
<authorization>
<allow roles="ADM,USER1,USER2">
<deny users="*">
Role "ADM" can able to access all the pages.
Role "User1" can able to access only "user1.aspx" and "Home.aspx"
Role "User2" can able to access only "Home.aspx"
like the above i want allow/deny pages based on the roles.
gani7787
14-Jun-16 0:19am
View
Any solution for this...waiting for reply from anyone...
gani7787
6-May-16 5:20am
View
Deleted
Any clue pls....
gani7787
26-Feb-16 7:38am
View
yes with clear questions...
gani7787
21-Feb-16 23:58pm
View
Thanks for Excellent clues...i used char instead of varchar..
it occupies two additional empty spaces..now i changed to varchar.
Now its working.
Thanks for your valuable solution.
gani7787
21-Feb-16 4:42am
View
Thanks for your reply.
I am passing just session value into array. Session value maintaining from login page and passing the value in to httpcontext. but, still the menu will not be appearing.
gani7787
21-Feb-16 4:39am
View
it contains string("Stu"). Session value maintain properly. But,when it holds the value with httpcontext then menu will not be appearing.
gani7787
20-Feb-16 1:15am
View
session value coming from the database.
Getting the role from database in the login page and assign the value to session.
by default,session values are coming. but, not displaying the menu.
Database Table
------------------
Stu-number Role
----------- -----------
101 Adm --> Administrator
102 Stu --> Student
103 Oth --> Others
gani7787
20-Feb-16 0:32am
View
session value coming from the database.
Getting the role from database in the login page and assign the value to session.
by default,session values are coming. but, not displaying the menu.
Database Table
------------------
Stu-number Role
----------- -----------
101 Adm --> Administrator
102 Stu --> Student
103 Oth --> Others
gani7787
11-Feb-16 0:27am
View
Hi,
I am struggling to highlight the parent and child menu same using css.
For example,
1. when i select parent menu that will be working perfect.
2. But, when i select parent manu followed by child menu then, parent menu will not be highlighting. rather than child menu only high lighting. some of them i tried below code. but, still not working...
master page code :
Parent menu
<div id="top_menu">
<ul>
<li>
Home
</li>
<li id="li1" runat="server" visible="false">
Administrator
</li>
<li id="li2" runat="server" visible="false">
Student
</li>
<li id="li3" runat="server">
Schools
</li>
<li>
About us
</li>
<li>
Contact
</li>
</ul>
</div>
Child Menu
<div id="Tab">
<ul>
<li>
Admin1
</li>
<li>
Admin2
</li>
<li>
Admin3
</li>
<li>
Admin4
</li>
</ul>
</div>
CSS Code
<style type="text/css">
#top_menu
{
width: 96%;
height: 45px;
padding: 3px 25px;
background: url(images/top_menu.png) no-repeat;
}
#top_menu #home_menu a
{
float: left;
display: block;
width: 46px;
height: 46px;
margin-right: 40px;
background: url(images/top_home.png) no-repeat;
position: relative;
}
#top_menu #home_menu a:hover
{
background: url(images/top_home_hover.png) no-repeat;
}
#top_menu ul
{
margin: 0;
padding: 7px 0 0 0;
list-style: none;
position:absolute;
left:150px;
}
#top_menu ul li
{
padding: 0px;
margin: 0px;
display: inline;
}
#top_menu ul li a
{
float: left;
line-height: 30px;
text-decoration: none;
text-align: center;
display: block;
width: 110px;
height: 30px;
border: thin solid #999;
color: #FFF;
background-color: #D20054;
-webkit-transition: all 0.3s ease-out;
-moz-transition: all 0.3s ease-out;
-o-transition: all 0.3s ease-out;
/*transition: all 0.3s ease-out;
transition: display 0s linear 0.5s,opacity 0.5s linear;*/
}
#top_menu ul li a:hover, #top_menu ul li .current
{
background-color: #0C3;
}
</style>
<style type="text/css">
#Tab
{
width: 96%;
height: 45px;
padding: 3px 25px;
}
#Tab a:hover
{
background: -webkit-gradient( linear, left top, left bottom, color-stop(0.05, #ffab23), color-stop(1, #ffec64) );
background: -moz-linear-gradient( center top, #ffab23 5%, #ffec64 100% );
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffab23', endColorstr='#ffec64');
background-color: #ffab23;
}
#Tab ul
{
margin: 0;
padding: 7px 0 0 0;
list-style: none;
position: absolute;
left: 150px;
}
#Tab ul li
{
padding: 0px;
margin: 0px;
display: inline;
}
#Tab ul li a
{
float: left;
line-height: 30px;
text-decoration: none;
text-align: center;
display: block;
width: 110px;
height: 30px;
border: thin solid #999;
color: #FFF;
background-color: #D20054;
-webkit-transition: all 0.3s ease-out;
-moz-transition: all 0.3s ease-out;
-o-transition: all 0.3s ease-out; /*transition: all 0.3s ease-out; transition: display 0s linear 0.5s,opacity 0.5s linear;*/
}
#Tab ul li a:hover, #Tab ul li .current
{
background-color: #0C3;
}
#Tab ul li a.active
{
background: #
gani7787
20-Mar-13 10:18am
View
10000 rows....also searching every columns contains bulk of employee data's.
we will have alternate option. such that FullTextSearch...
But, this is disable. i need a simple query to getting the n number of results...
gani7787
5-Mar-13 0:22am
View
Thanks for your great help..
The result is coming....But, it is taking too much time to get the results...for example it is taking 1 Minutes 05 Seconds.
Can we modify the query to reduce the time to get the immediate results....?
pls.help....
.
gani7787
21-Jan-13 7:00am
View
Any help....
gani7787
1-Oct-12 9:08am
View
Yes. i wanted to insert bulk excel data into SQL table. before uploading it should check the duplication values from excel.
gani7787
26-Sep-12 2:05am
View
Can anyone give exact code or answers which is related to my questions.?
My Question is : before uploading bulk data to excel, i eant to check the duplication.
if duplication exists then it should insert the next record.
i am struggling last two weeks regarding this issue. pls. help.
gani7787
13-Sep-12 3:53am
View
ASPX Code
----------
<AjxTool:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<contenttemplate>
<div style="position: absolute; top: 140px; z-index: -100; left: 350px;">
<div class="big-block grid">
<div class="big-block-top">
</div>
<div class="big-block-content clearfix">
<div>
<div align="center">
<div align="left">
<table style="border-width: 0px; width: 100%; border-style: none" cellpadding="1"
cellspacing="15">
<tr>
<td>
<asp:Label ID="Label13" runat="server" Text="Provider Name" CssClass="Labels">
</td>
<td>
<AjxTool:ComboBox ID="ComboProviderName" runat="server" AutoPostBack="False" DropDownStyle="DropDownList"
AutoCompleteMode="SuggestAppend" CaseSensitive="False" CssClass="AjaxToolkitStyle"
ItemInsertLocation="OrdinalValue" EnableTheming="true">
<asp:ListItem Text="--Select--" Value="-1" Selected="True">
</td>
</tr>
</table>
</div>
</div>
<div class="blog-more clearfix">
</div>
</div>
</div>
<div class="big-block-bottom">
</div>
</div>
</div>
CSS Code
---------
.big-block {
width:950px;
margin:0 auto 20px;
}
.big-block-top {
height:25px;
background:url(images/big-top.png) no-repeat center bottom;
}
.big-block-bottom {
height:25px;
background:url(images/big-bottom.png) no-repeat center top;
}
.big-block-content {
padding:15px 0;
min-height:280px;
background:url(images/big-middle.png) repeat-y center top;
}
.block-left {
width:565px;
float:left;
margin:0 10px 0 30px;
}
.block-right {
width:290px;
float:left;
margin-left:30px;
}
.blog-entry {
margin-bottom:25px;
}
.blog-title {
padding-bottom:5px;
background:url(images/dots.png) repeat-x left bottom;
margin-bottom:5px;
font-weight:bold;
}
.blog-meta {
font-size:0.85em;
margin-bottom:15px;
height:17px;
line-height:17px;
}
.blog-thumb {
margin-bottom:10px;
}
.blog-more {
margin:10px 0 40px;
}
.blog-more .round {
float:left;
text-transform:none;
}
.blog-share {
line-height:28px;
float:right;
text-align:right;
}
.blog-share a {
position:relative;
top:4px;
margin:0 1px;
}
.blog-content h1,
.blog-content h2,
.blog-content h3,
.blog-content h4,
.blog-content h5,
.blog-content h6,
.blog-content ul,
.blog-content ol,
.blog-content p
{margin-bottom:13px;}
.blog-content h1,
.blog-content h2,
.blog-content h3
{padding-top:7px}
.blog-content p,
.blog-content ul li,
.blog-content ol li
{line-height:1.5em;}
.blog-content ul,
.blog-content ol
{margin-left:20px;}
.blog-content ul li,
.blog-content ol li
{margin-bottom:4px}
.blog-content blockquote {
padding-left:60px;
background:url(images/blog-quote.png) no-repeat left top;
}
.wp-c
gani7787
27-Aug-12 5:56am
View
can you give more example on this...?
gani7787
27-Jun-12 2:24am
View
what will be the next solution.?
I have already configured in IIS.
Do we have any other option with client Outlook and IIS Server...?
gani7787
12-Jun-12 8:21am
View
Deleted
I have used iTextSharp also. But,In the PDF, control is not displaying. it will display as empty row. i want to display including page controls in the pdf.
see my code:
ASPX Code:
<%@ Page Title="Home Page" Language="C#" AutoEventWireup="true"
CodeBehind="Default.aspx.cs" Inherits="pdf" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<table border="1">
<tr>
<td>
<asp:Button ID="Button1" runat="server" Text="Button" />
</td>
<td>
<asp:Button ID="Button2" runat="server" Text="Button" />
</td>
</tr>
<tr>
<td colspan="2">
<asp:Button ID="Button3" runat="server" Text="Button" />
</td>
</tr>
</table>
</div>
</form>
</body>
</html>
ASPX.CS Code :
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.IO;
using System.Text.RegularExpressions;
using iTextSharp.text;
using iTextSharp.text.pdf;
using iTextSharp.text.html;
using iTextSharp.text.xml;
using System.Xml;
using iTextSharp.text.html.simpleparser;
public partial class pdf : System.Web.UI.Page
{
protected override void Render(HtmlTextWriter writer)
{
MemoryStream mem = new MemoryStream();
StreamWriter twr = new StreamWriter(mem);
HtmlTextWriter myWriter = new HtmlTextWriter(twr);
base.Render(myWriter);
myWriter.Flush();
myWriter.Dispose();
StreamReader strmRdr = new StreamReader(mem);
strmRdr.BaseStream.Position = 0;
string pageContent = strmRdr.ReadToEnd();
strmRdr.Dispose();
mem.Dispose();
writer.Write(pageContent);
CreatePDFDocument(pageContent);
}
public void CreatePDFDocument(string strHtml)
{
string strFileName = HttpContext.Current.Server.MapPath("test.pdf");
// step 1: creation of a document-object
Document document = new Document();
// step 2:
// we create a writer that listens to the document
PdfWriter.GetInstance(document, new FileStream(strFileName, FileMode.Create));
StringReader se = new StringReader(strHtml);
HTMLWorker obj = new HTMLWorker(document);
document.Open();
obj.Parse(se);
document.Close();
ShowPdf(strFileName);
}
public void ShowPdf(string strFileName)
{
Response.ClearContent();
Response.ClearHeaders();
Response.AddHeader("Content-Disposition", "inline;filename=" + strFileName);
Response.ContentType = "application/pdf";
Response.WriteFile(strFileName);
Response.Flush();
Response.Clear();
}
}
gani7787
12-Jun-12 7:43am
View
Deleted
I have tried the above link. but it is not working..
gani7787
28-May-12 9:13am
View
How we can write query based on my condition in sql server...?
gani7787
20-Apr-12 6:18am
View
I want to get total sum of both table1 and table2..?
gani7787
18-Apr-12 1:56am
View
Thanks for your help.
I converted into vb.net. but, i am getting error which is highlighted in BOLD.
Error getting in key,month and year fields.
Dim calendar As New TimeCalendar(New TimeCalendarConfig() With { Key.YearBaseMonth = YearMonth.April, Key .YearType = YearType.FiscalYear })
Dim countOnlyFullWeeks As Boolean = True
Dim year As New Year(2012, Calendar)
For Each month As Month In year.GetMonths()
Dim nextMonth As Month = month.GetNextMonth()
Dim week As New Week(month.Start.[Date])
Dim weekCount As Integer = 0
While week.Start.[Date] < nextMonth.Start.[Date]
If countOnlyFullWeeks Then
If month.HasInside(week) Then
weekCount += 1
End If
Else
weekCount += 1
End If
week = week.GetNextWeek()
End While
Console.WriteLine("Month: " & month & ", Tot Weeks : " & weekCount)
Next
End Sub
gani7787
3-Apr-12 6:31am
View
no..it's not working.
it will come as below.
Emp_id Name Tot Count
101 NULL 1
101 A 2
102 NULL 1
102 B 3
103 NULL 1
103 C 4
But, i want 101 --> 2+1 = 3
102 --> 3+1 = 4
103 --> 4+1 = 5
like below o/p..
Emp_id Name Tot Count
101 A 3
102 B 4
103 C 5
gani7787
13-Mar-12 8:10am
View
Actually this is classic ASP coding.
When i am trying to open in ms-excel 2010 it's opening and displaying the with the data.
But, when i am trying to opening in ms-excel 2003, excel will be opeing with out any data..
i don't know why...
gani7787
17-Feb-12 5:30am
View
i am using Ajax combobox and asp label in Gridview
my location text values and ID is available in the dropdown itself.
when i stored in the DB i used to store the values of Dropdown ID,
while i am bounding the row, just i want to display the text values which is correspondingly stored in DB as ID.
see my code
-----------
<asp:TemplateField HeaderText="Cabin">
<edititemtemplate>
<cc1:ComboBox ID="ddlLocation" runat="server" DropDownStyle="DropDownList" SelectedValue='<%# Bind("Location") %>' Width="60px" AutoPostBack="true" CaseSensitive="false" AutoCompleteMode="SuggestAppend" CssClass="WindowsStyle" ItemInsertLocation="OrdinalText">
<asp:ListItem Text="--Select--" Value="">--Select--
<asp:ListItem Value="1" Text="A">
<asp:ListItem Value="2" Text="B">
<asp:ListItem Value="3" Text="C">
<asp:ListItem Value="4" Text="D">
<itemtemplate>
<asp:Label ID="lblLocation" runat="server" Text='<%# Eval("Location") %>'>
For the above example,
I have stored ddlvalue = "2" and stored in DB.
while i'm bounding the row i want to display the text as ="B" in the labelcabin.
How to do this..?
.
gani7787
16-Feb-12 3:38am
View
Deleted
I have the data in the dropdown itself. i don't have any code in code behind.
see my data in the dropdown
<asp:ListItem Text="--Select--" Value="">--Select--
<asp:ListItem Value="1" Text="Ramesh">
<asp:ListItem Value="2" Text="Raghu">
<asp:ListItem Value="3" Text="Raj">
<asp:ListItem Value="4" Text="Albert">
and my label field is
<asp:Label ID="lblLocation" runat="server" Text='<%# Eval("EmpID") %>'>
and the dropdown field is
<cc1:ComboBox ID="ddlEmp" runat="server" DropDownStyle="DropDownList" SelectedValue='<%# Bind("EmpID") %>' Width="60px" AutoPostBack="true" CaseSensitive="false" AutoCompleteMode="SuggestAppend" CssClass="WindowsStyle" ItemInsertLocation="OrdinalText">
gani7787
9-Feb-12 6:09am
View
I have removed onmouseout. But, onclick select all the rows.
Just i want to select only one rows when i cilck...?
gani7787
9-Feb-12 5:29am
View
I tried below simple code.
The color should highligh selected when i click the row. but it is not selected.
what is the problem ?
see my simple code below.
<tr onmouseover="this.style.cursor='hand';this.style.background='#f4ffcc';" önmouseout="this.style.background='#f4f4f4';" önclick="this.style.cursor='hand';this.style.background='#f4ffcc';">.
gani7787
9-Feb-12 5:24am
View
Deleted
I tried. It should selected when i click. but it is not working.
what is the problem.
see my simple code below.
<tr onmouseover="this.style.cursor='hand';this.style.background='#f4ffcc';" onmouseout="this.style.background='#f4f4f4';" önclick="this.style.cursor='hand';this.style.background='#f4ffcc';">
gani7787
9-Feb-12 4:48am
View
thanks for your reply.
But, when i click the row, it should highlight permenantly in that row. same as when i click another row, previous row make it is as visible false color then the current row should highlight if i click..
how it is porssible and how to do this...?
gani7787
7-Feb-12 6:10am
View
i am getting error if i add "j" in childitems..?
gani7787
7-Feb-12 6:04am
View
can you pls. give me the example. i tried ur solution. but, still not working...
gani7787
2-Feb-12 3:23am
View
getting total number of weeks in between two dropdown date values..
example:
drop1 values : 20-2011 (20th week and 2011 year)
drop2 values : 3-2012 (2nd week and 2012 year)
How to get total weeks in between the drop1 and drop2 values..
gani7787
17-Jan-12 7:50am
View
what about x-axis range..?
How to handle x-axis range...?
gani7787
17-Jan-12 5:44am
View
both are integer data type
gani7787
17-Jan-12 0:30am
View
While loading left div values showing in the mid of the screen with overlapping div2.
Why...?
see my code
-----------
<div class="divbody">
<div id="div1" class="leftdiv">
<table>
<tr>
<td class="Labels">1.Employee</td >
</tr>
<tr>
<td class="Labels">Select Emp :
<asp:DropDownList ID="drpEmp" runat="server" class="controltext" Width="250px" AutoPostBack="true">
<asp:ListItem Value="" Selected="True">Select Project
</td>
</tr>
<tr>
<td class="Labels">
From Wk:
<asp:DropDownList ID="drpFrmWk" runat="server" class="controltext" Width="40px" AutoPostBack="true">
<asp:ListItem Value="" Selected="True"><-->
From Year:
<asp:DropDownList ID="drpFrmYr" runat="server" class="controltext" Width="70px" AutoPostBack="true">
<asp:ListItem Value="" Selected="True"><-->
</td>
</tr>
<tr>
<td class="Labels">
To Wk:
<asp:DropDownList ID="drpToWk" runat="server" class="controltext" Width="40px" AutoPostBack="true">
<asp:ListItem Value="" Selected="True"><-->
To Year:
<asp:DropDownList ID="drpToYr" runat="server" class="controltext" Width="70px" AutoPostBack="true">
<asp:ListItem Value="" Selected="True"><-->
</td>
</tr>
<tr align="center">
<td class="Labels">
<asp:Button ID="btnResult1" CssClass="Btn" runat="server" Text="View Chart" ToolTip="Click Here to Get Chart" width="80px"/>
</td>
</tr>
</table>
</div>
<div id="div2" class="rightdiv">
<asp:Chart ID="Chart1" runat="server" TextAntiAliasingQuality="High" ImageType="Jpeg" Visible="True"
BackColor="CornflowerBlue" BackSecondaryColor="FloralWhite" BackGradientStyle="TopBottom">
<Titles>
<asp:Title Name="ChartTitle" Font="Arial, 8pt" >
</Titles>
<borderskin skinstyle="Emboss">
<series>
<asp:Series Name="ColChart" ChartType="Column" IsValueShownAsLabel="True">
<chartareas>
<asp:ChartArea Name="ChartArea1" BorderColor="64, 64, 64, 64" BorderDashStyle="Solid" BackSecondaryColor="White" BackColor="AntiqueWhite"
ShadowColor="Transparent" BackGradientStyle="TopBottom" >
<area3dstyle Enable3D="True" />
gani7787
16-Jan-12 6:51am
View
Thanks for your code..
But, my left screen position overriding with right screen.
Also, left screen displaying in center position. so right screen overriding with left screen.
what is the problem in below code.
ASPX Code
---------
<div class="divbody">
<div id="left" class="leftdiv">
<table>
<tr>
<td class="Labels">1.Employee</td >
</tr>
<tr>
<td class="Labels">Select Emp :
<asp:DropDownList ID="drpEmp" runat="server" class="controltext" Width="250px" AutoPostBack="true">
<asp:ListItem Value="" Selected="True">Select Project
</td>
</tr>
<tr>
<td class="Labels">
From Wk:
<asp:DropDownList ID="drpFrmWk" runat="server" class="controltext" Width="40px" AutoPostBack="true">
<asp:ListItem Value="" Selected="True"><-->
From Year:
<asp:DropDownList ID="drpFrmYr" runat="server" class="controltext" Width="70px" AutoPostBack="true">
<asp:ListItem Value="" Selected="True"><-->
</td>
</tr>
<tr>
<td class="Labels">
To Wk:
<asp:DropDownList ID="drpToWk" runat="server" class="controltext" Width="40px" AutoPostBack="true">
<asp:ListItem Value="" Selected="True"><-->
To Year:
<asp:DropDownList ID="drpToYr" runat="server" class="controltext" Width="70px" AutoPostBack="true">
<asp:ListItem Value="" Selected="True"><-->
</td>
</tr>
<tr align="center">
<td class="Labels">
<asp:Button ID="btnResult1" CssClass="Btn" runat="server" Text="View Chart" ToolTip="Click Here to Get Chart" width="80px"/>
</td>
</tr>
</table>
</div>
<div id="right" class="rightdiv">
<asp:Chart ID="Chart1" runat="server" TextAntiAliasingQuality="High" ImageType="Jpeg" Visible="false" Width="1200px"
BackColor="CornflowerBlue" BackSecondaryColor="FloralWhite" BackGradientStyle="TopBottom">
<Titles>
<asp:Title Name="ChartTitle" Font="Arial, 8pt" >
</Titles>
<borderskin skinstyle="Emboss">
<series>
<asp:Series Name="ColChart" ChartType="Column" IsValueShownAsLabel="True">
<chartareas>
<asp:ChartArea Name="ChartArea1" BorderColor="64, 64, 64, 64" BorderDashStyle="Solid" BackSecondaryColor="White" BackColor="AntiqueWhite"
ShadowColor="Transparent" BackGradientStyle="TopBottom" >
<area3dstyle Enable3D="True" />
<axisx linecolor="64, 64, 64, 64" title="Week-Year" islabelautofit="true">
<LabelStyle Font="Arial, 8pt" />
<majorgrid linecolor="64, 64, 64, 64">
<axisy linecolor="64, 64, 64, 64" title="Allocation Value">
<LabelStyle Font="Arial, 8pt" />
<majorgrid linecolor="64, 64, 64, 64">
gani7787
9-Jan-12 6:37am
View
I want to display 3rd value in the top of the xaxis points.
How to do this....?
gani7787
6-Jan-12 1:19am
View
Any help pls...
gani7787
3-Jan-12 5:50am
View
Deleted
My requirement is below.
I want to display month-year in the dropdown(atleast fifteen years).
While loading, by default it should bind current month and year. For example. this month and year (Jan-2010).
Dropdown values as below.
Jan-2006
Feb-2006
Mar-2006
----
----
----
----
Jan-2012 -->Selected value while loading.(This is current month and year)
Feb-2012
Mar-2012
----
----
----
Dec-2020
gani7787
3-Jan-12 5:46am
View
Deleted
Current month and year is "Jan-2012"
gani7787
3-Jan-12 4:37am
View
Deleted
How to bind the current month-year if i use the below code..
Dim months As [String]() = {"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"}
drpFromMth.Items.Add(New ListItem(months(System.DateTime.Now.Month - 1) + "-" + System.DateTime.Now.Year))
For index As Integer = 2006 To 2020 For month As Integer = 0 To 11
drpFromMth.Items.Add(New ListItem(months(month) + "-" & index.ToString()))
Next
Next.
gani7787
3-Jan-12 3:24am
View
Deleted
I want to display from 2006 to 2020 in same dropdown...
Dropdown values like below.
Jan-2006
Feb-2006
-----
-----
Nov-2020
Dec-2020
gani7787
30-Dec-11 2:41am
View
the same is working in the local system. but, not working properly in server..
gani7787
28-Dec-11 9:19am
View
function ViewAllted() {if(document.forms[0].Emp.value!=''){
//var sel = document.getElementById("Emp");
var sel = document.forms[0].elements("Emp").value; alert(sel);
var strValue = sel.options[sel.selectedIndex].value;
alert('Sselected Value is: ' + strValue + ' and Index is: ' + sel.selectedIndex);
var optText = sel.options[strValue ].text;
document.forms[0].EmpName.value = optText; }
document.forms[0].action="FORMEMP.aspx?M=V" document.forms[0].submit();}else{
alert("Select an Employee!")}}
<input type="button" önclick="Javascript: ViewAlloted()" value="View Existing Allocation" />
gani7787
28-Dec-11 8:28am
View
My sel values will be "null" when i use var sel = document.getElementById("Emp");
and also same error i am getting ""Microsoft JScript runtime error: 'options' is null or not an object "
gani7787
27-Dec-11 6:23am
View
Deleted
I have selected 3 values in the listbox.
The prjtype will not store any values.
The prjtype should contain and store like '1','3','4'
nothing will come now..why..
ASPX Code
----------
<asp:ListBox ID="lstprojtype" CssClass="Labels" runat="server" SelectionMode="Multiple" Height="110px" width="200px" AppendDataBoundItems="true"> <asp:ListItem Selected="True" Value="">Select Project Type <asp:ListItem Value="1">A <asp:ListItem Value="2">B <asp:ListItem Value="3">C <asp:ListItem Value="4">D <asp:ListItem Value="5">E
ASPX.VB Code
------------
Dim index() As Integer = lstprojtype.GetSelectedIndices()
For i As Integer = 0 To index.Length - 1
PrjType = PrjType & "'" & lstprojtype.Items(i).Value & "',"
Next
If PrjType <> "" Then
PrjType = Left(PrjType, Len(PrjType) - 1)
End If
Output
------
I have selected A,C,D Values.So the PrjType values should be '1','3','4' only..How we can do this...
gani7787
23-Dec-11 4:24am
View
Thanks Griff..
gani7787
21-Dec-11 9:28am
View
Thanks Varun.
But, this should happen when i press every textbox in gridview, it should automatically change in the total textbox.
How it is possible...?
gani7787
15-Dec-11 1:53am
View
I am using css style. based on that i have set the width for every menu.
But, if i remove one more menu items then also i want to display the menu width fixed..
li
{
border:1px solid black;
padding:2px 2px 2px 2px;
width:210px;
background-color:#82C0FF;
color:black;
cursor:pointer;
}
a { color:black; font: bold 11px Verdana; }
gani7787
23-Nov-11 4:59am
View
Still i'm struggling with validation.
My scenario is below.
I have the grid view and it contain startdate dropdown and "End Date" dropdown.
I have one grid column as Link "Edit" Button.
Dropdown1 values is "01-2010" (1st week & 2010 year)
Dropdown2 values is "20-2012" (20th week & 2012 year).
When i click the "Edit" Link button, then it should validate the dropdown values either JavaScript or Server side...?
what event should use when i click the Gridview "Edit" button for displaying the pop up alert...?
pls. help
gani7787
24-Oct-11 8:44am
View
Sorry. I didn't understand this logic.
my question is simple and simple SQL statement.
I want the query as simple SQL Statement...
How to dot this....?
gani7787
13-Oct-11 1:29am
View
Hi,
In my solution folder there will be BIN Folder.
It contains AJAX.DLL.
Should i copy System.Web.DataVisualization.dll and paste in this folder..?
gani7787
4-Oct-11 5:28am
View
Deleted
First sheet of A column every value should check with second sheet of B column all the rows.
1 (First sheet of every values) * Many rows (second sheet all values) checking
gani7787
28-Sep-11 4:53am
View
ok..thanks...
gani7787
22-Sep-11 2:32am
View
What will happen if i use float...?
gani7787
8-Sep-11 5:54am
View
Hi,I have checked in the code one by one.
if the record > 64, then it will not update anything in the excel file. When i 'am trying to open it say's "Unable to read File"
If the Record Less than < 60, then it will append the data in the Excel File and has displaying the data..
gani7787
11-Aug-11 8:58am
View
Thanks...
gani7787
11-Aug-11 3:29am
View
This will help us...
Bind Nested Gridview[^]
gani7787
11-Aug-11 2:39am
View
I got the solution...thanks...
gani7787
7-Aug-11 13:05pm
View
Good and thanks....
gani7787
5-Aug-11 6:13am
View
I found solution. just i bind the value in the checked event. now it's working. thanks alot.
gani7787
5-Aug-11 4:29am
View
Removed very large code block from comment and put in your original question...at the end. -- Slacker007
gani7787
5-Aug-11 3:03am
View
I understood your problems...I will take care hereafter the tag questions..
As a developer, we can ask many questions. if we are not able to get the proper answer, we are in a position to get this in many ways..
Your answer may be the wrong. it will hurt me
Thank You!
gani7787
4-Aug-11 8:36am
View
what is the syntax to set particular row color in gridview..?
gani7787
4-Aug-11 8:36am
View
what is the syntax to set particular color in gridview..?
gani7787
3-Aug-11 10:05am
View
ASPX Code
---------
<asp:GridView ID="GridView1" runat="server" align="center" AllowPaging="true" DataKeyNames="PrNo,RevisionNo"
AutoGenerateColumns="False" class="tabulardata"
HorizontalAlign="Center" Width="100%">
<columns>
<asp:TemplateField HeaderText="Sl.No" ItemStyle-HorizontalAlign="Center"
ItemStyle-Width="4%">
<itemtemplate>
<%# Container.DataItemIndex + 1%>
<%-- <asp:TemplateField HeaderText="CheckAll">
<HeaderTemplate>
<asp:CheckBox ID="chkSelectAll" runat="server" AutoPostBack="true" OnCheckedChanged="chkSelectAll_CheckedChanged"/>
</HeaderTemplate>
<itemtemplate>
<asp:CheckBox ID="chkSelect" runat="server" AutoPostBack="true" OnCheckedChanged="chkSelect_CheckedChanged"/>
--%>
<%-- --%>
<asp:BoundField HeaderText="PrNo" Visible="true" DataField="PrNo"
ItemStyle-HorizontalAlign="center" ReadOnly="true" SortExpression="PrNo">
<itemstyle horizontalalign="Center" width="15%">
<asp:TemplateField HeaderText="PrNo" Visible="false" HeaderStyle-HorizontalAlign="Center" ItemStyle-Width="10%">
<itemtemplate>
<asp:Label ID="lblPrNo" runat="server" Text='<%# Eval("PrNo") %>'>
<HeaderStyle HorizontalAlign="Center" />
<asp:BoundField HeaderText="RevisionNo" Visible="true" DataField="RevisionNo"
ItemStyle-HorizontalAlign="center" ReadOnly="true" SortExpression="RevisionNo">
<itemstyle horizontalalign="Center" width="10%">
<asp:TemplateField HeaderText="RevisionNo" Visible="false" HeaderStyle-HorizontalAlign="Center" >
<itemtemplate>
<asp:Label ID="lblRevisionNo" runat="server" Text='<%# Eval("RevisionNo") %>'>
<HeaderStyle HorizontalAlign="Center" />
<asp:TemplateField HeaderText="Edit" ItemStyle-HorizontalAlign="Center">
<itemtemplate>
<asp:HyperLink ID="hyperlink1" onclick="" BorderStyle="None" runat="server" Height="15"
ImageUrl="~/images/EditImage.png"
Width="50%" >
<itemstyle horizontalalign="Center" width="6%">
gani7787
3-Aug-11 8:32am
View
Thanks...Fantastic....
gani7787
2-Aug-11 10:21am
View
Thanks...i added before postback and after selected the menu...it's working...
gani7787
2-Aug-11 8:30am
View
Superb...thanks...it's working....
Can you give me one more idea..?
How to highlight the particular tab in diff. color..?
gani7787
2-Aug-11 8:16am
View
Value will be there...
Then what else...?
gani7787
2-Aug-11 7:39am
View
any help pls...
gani7787
2-Aug-11 7:18am
View
menuitem...
gani7787
2-Aug-11 6:06am
View
sorry..
I should't display the menuitem...
gani7787
2-Aug-11 5:44am
View
If rdr("Home") = "Y" then
'''Adding the Menu
Else
'''I don't want to display the menu
gani7787
2-Aug-11 4:31am
View
Hi,
Can you give me a solution as per my code...where i need to bind and how?
because, i am new for the menu creation..?
gani7787
28-Jul-11 9:29am
View
Can you tell me the steps...?
gani7787
28-Jul-11 5:41am
View
Can i have Multiview Tab images from website...?
gani7787
27-Jul-11 9:01am
View
I have more than 2 pages.
gani7787
25-Jul-11 1:00am
View
Thanks. it's working. I have given autopostback=true.
gani7787
22-Jul-11 10:09am
View
Any help pls.
gani7787
18-Jul-11 7:48am
View
Hi,
I have used below code. but, it says error.
Error : mailmessage not defined.
see code.
----------
Dim mail As New MailMessage()
'set the addresses
mail.From = New MailAddress("me@mycompany.com")
mail.To.Add("you@yourcompany.com")
'set the content
mail.Subject = "This is an email"
mail.Body = "this is a sample body"
'send the message
Dim smtp As New SmtpClient("127.0.0.1")
smtp.Send(mail)
gani7787
14-Jul-11 7:03am
View
Hi,
I am getting error as below if i use 'li' in place of 'li.Text'
Error : "Collection was modified; enumeration operation may not execute."
What is this...?
gani7787
12-Jul-11 5:18am
View
the Ecact Error is "Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index"
gani7787
12-Jul-11 5:08am
View
I will fire two times. in the second time the EmpNo is field getting error. because i deleted the record. again it will read the same record when coming inside.
gani7787
12-Jul-11 0:17am
View
Hi,
Can anyone tell me what is the problem in update command not working when i pass dropdown values.
gani7787
11-Jul-11 8:47am
View
Hi,
Still i am unable to read dropdwon values while updating.
what is the problem. pls. update immediately.
See my code.
ASPX Code
----------
<asp:GridView ID="grdDeptEmp" runat="server" AutoGenerateColumns="False"
DataKeyNames="emp_number,FromPeriod,ToPeriod" Cssclass="tabulardata" DataSourceID="dsOtherDept1"
class="tabulardata" width="100%" HorizontalAlign="Center" OnRowCancelingEdit="grdDeptEmp_RowCancelingEdit"
OnRowDataBound="grdDeptEmp_RowDataBound" OnRowEditing="grdDeptEmp_RowEditing" OnRowUpdating="grdDeptEmp_RowUpdating"
OnRowCommand="grdDeptEmp_RowCommand" ShowFooter="True"
OnRowDeleting="grdDeptEmp_RowDeleting" AllowPaging="True">
<columns>
<asp:TemplateField HeaderText="Sl.No" ItemStyle-HorizontalAlign="Center"
ItemStyle-Width="2%">
<itemtemplate>
<asp:Label ID="Sno" runat="server">
<itemstyle horizontalalign="Center">
<asp:TemplateField HeaderText="EmpNumber" HeaderStyle-HorizontalAlign="Left">
<edititemtemplate>
<asp:Label ID="lblEmpNo" runat="server" Text='<%# Bind("emp_number") %>'>
<itemtemplate>
<asp:Label ID="lblEmpNo" runat="server" Text='<%# Bind("emp_number") %>'>
<HeaderStyle HorizontalAlign="Left" />
<%-- <asp:BoundField HeaderText="Emp_Number" Visible="true" DataField="emp_number"
ItemStyle-HorizontalAlign="center" ReadOnly="true" SortExpression="emp_number">
<itemstyle horizontalalign="Center" width="5%">
--%>
<asp:BoundField HeaderText="Name" DataField="name"
ItemStyle-HorizontalAlign="center" ReadOnly="true" SortExpression="name">
<itemstyle horizontalalign="Center" width="17%">
<asp:BoundField HeaderText="Designation" DataField="emp_designation"
ItemStyle-HorizontalAlign="center" ReadOnly="true" SortExpression="emp_designation">
<itemstyle horizontalalign="Center" width="17%">
<asp:TemplateField HeaderText="From Period" HeaderStyle-HorizontalAlign="Left">
<edititemtemplate>
<asp:DropDownList ID="cmbFrom" runat="server" Style="width: 150px;"
DataSourceID="dsOtherDept1" DataTextField="FromPeriod" DataValueField="emp_number"
AppendDataBoundItems="true">
<asp:ListItem Text="Please Select" Value="">
<itemtemplate>
<asp:Label ID="lblFrm"
gani7787
9-Jul-11 11:45am
View
any help. pls..
gani7787
9-Jul-11 4:01am
View
Deleted
Hi,
When i collapse first column <td> then second column <td> also collapsed. but, it should not like that.
When i coolapse first panel then second and third column remain the same place (second and third column should not collapse)
How to do that..?
see my code
---------------
<table>
<tr>
<td>
<div id="dlg" class="dialog" style="width: 460px">
<div class="header" style="cursor: default">
<div class="outer">
<div class="inner">
<div class="content">
Civil & Structural Employees (Regular)
</div>
</div>
</div>
</div>
<div class="body">
<div class="outer">
<div class="inner">
<div class="content">
<asp:Panel CssClass="grid" ID="pnlEngDesig" runat="server">
<asp:UpdatePanel ID="pnlUpdate" runat="server">
<contenttemplate>
<asp:GridView Width="100%" AllowPaging="True" ID="gvEngDesig" AutoGenerateColumns="False"
DataSourceID="sqlDsEngDesig" runat="server" ShowHeader="False" OnRowCreated="gvEngDesig_RowCreated">
<columns>
<asp:TemplateField>
<itemtemplate>
<asp:Panel CssClass="group" ID="pnlEngDesig" runat="server">
<asp:Image ID="imgCollapsible" CssClass="first" ImageUrl="~/GridImg/plus.png"
Style="margin-right: 5px;" runat="server" /><span class="header">
<%# Eval("emp_Design")%>
:
(<%#Eval("Totalcount")%>)
</span>
<asp:SqlDataSource ID="sqlDsEngDesig" runat="server" ConnectionString="<%$ ConnectionStrings:MPP %>"
SelectCommand="Select emp_number,emp_name+' '+emp_initial as name,emp_designation,Manpower_Division_ID
from idpeapp.dbo.view_employee where emp_dept =16 and Manpower_Division_ID=@Manpower_Division_ID
and emp_number not in (select emp_number from csMPExcludedList) order by emp_name">
<SelectParameters>
<asp:Parameter Name="Manpower_Division_ID" Type="String" DefaultValue="" />
</SelectParameters>
<asp:Panel Style="margin-left: 20px; margin-right: 20px" ID="pnlList" runat="server">
<asp:GridView AutoGenerateColumns="false" CssClass="grid" ID="gvOrders" DataSourceID="sqlDsEngDesig"
runat="server" ShowHeader="true" EnableViewState="f
gani7787
8-Jul-11 7:26am
View
Hi,
Thanks for your help.
But,this year we will have 53 weeks. but, the code always count only 52 weeks.
any other steps..
gani7787
6-Jul-11 7:19am
View
Hi,
What is lbl..?
gani7787
6-Jul-11 5:15am
View
Code is below.
<% Conn.Open()
StrQry = ""
StrQry = "Select emp_number,emp_name+' '+emp_initial as name,emp_designation,Manpower_Division_ID from idpeapp.dbo.view_employee where emp_dept ='" & Session("Dept") & "' order by Manpower_Division_ID,emp_name"
CmdEmp.Connection = Conn
CmdEmp.CommandText = StrQry
RdrEmp = CmdEmp.ExecuteReader
Dim i As Integer = 1
If RdrEmp.HasRows Then
Dim row As Integer = 1
Dim col As Integer = 1
Dim Manpower_Division_ID As Integer = 1
While RdrEmp.Read%>
<% If Manpower_Division_ID <> RdrEmp("Manpower_Division_ID") Then
%>
<tr>
<td align="left" colspan="18">
Designers</td>
</tr>
<%
i = 1
End If
%>
<tr>
<td> <%Response.Write(i)%></td>
<td> <%Response.Write(RdrEmp("name") & " (" & RdrEmp("emp_number") & ")")%></td>
<%
'Conn.Open()
StrQry = ""
StrQry = "Select Designation,DesigCode,Priority,Priority2,ProfRoleCode,ProfRole,DeptCode from Designation where DeptCode='" & Session("Dept") & "' order by Priority2"
CmdDesign.Connection = Conn
CmdDesign.CommandText = StrQry
RdrDesign = CmdDesign.ExecuteReader
If RdrDesign.HasRows Then
col = 1
While RdrDesign.Read%>
<td align="center" title="<%=RdrDesign("Designation")%>" > <%Response.Write(FindVal(RdrEmp("Emp_number"), RdrDesign("DesigCode")))%></td>
<%
col = col + 1
End While
End If
%>
</tr>
<%
row = row + 1
i = i + 1
Manpower_Division_ID = RdrEmp("Manpower_Division_ID")
End While
End If
%>
<%
%>
Any help...
gani7787
6-Jul-11 4:28am
View
I have used the below function.
Private Function FindVal(ByVal ID As Integer, ByVal Desig As Integer)
Dim Conn As System.Data.SqlClient.SqlConnection = New System.Data.SqlClient.SqlConnection(ConfigurationManager.ConnectionStrings("MPP").ConnectionString)
Dim Cmd As New System.Data.SqlClient.SqlCommand
Dim RdrCatVal As System.Data.SqlClient.SqlDataReader
Dim StrQry As String
Dim CatVal As Integer
StrQry = "Select isnull(" & Desig & ",'N') from csEmpCategory where emp_number ='" & ID & "' "
Cmd.Connection = Conn
Cmd.CommandText = StrQry
RdrCatVal = Cmd.ExecuteReader
If RdrCatVal.HasRows Then
While RdrCatVal.Read
CatVal = RdrCatVal(0)
End While
FindVal = CatVal
End If
End Function
But, still it says error "Function without as as clause. return type of object assumed"
pls. hekp.
Regards,
Ganesh.s
gani7787
5-Jul-11 3:35am
View
Hi,
it will not support in the Gridview item template. pls. give us some other solution.getting error.Element list item is not supported.
see my code
-----------
<asp:TemplateField HeaderText="Professional Role">
<itemtemplate>
<asp:DropDownList runat="server" ID="ddlProfRole" width="87%" DataValueField="ProfRoleCode" DataSourceID="SqlDataSource2" DataTextField="ProfRoleDescription"
AppendDataBoundItems="true" xmlns:asp="#unknown">
<asp:ListItem Text="(Select a Role)" Value="" />
<itemstyle horizontalalign="Center" width="25%">
gani7787
4-Jul-11 8:58am
View
I have added. But, still not displaying "select" in dropdown while pageload.
see the below code
<asp:GridView ID="GridView1" runat="server" align="center" AllowPaging="True" DataKeyNames="Priority"
AutoGenerateColumns="False" class="tabulardata" DataSourceID="SqlDataSource1"
HorizontalAlign="Center" Width="100%" OnRowCommand="GridView1_RowCommand"
OnRowDataBound="GridView1_RowDataBound">
<columns>
<asp:TemplateField HeaderText="Sl.No" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="2%">
<itemtemplate>
<asp:Label ID="Sno" runat="server">
<itemstyle horizontalalign="Center">
<asp:BoundField HeaderText="Project Number" Visible="true" DataField="Priority"
ItemStyle-HorizontalAlign="center" ReadOnly="true" SortExpression="Priority">
<itemstyle horizontalalign="Center" width="3%">
<asp:BoundField HeaderText="Current Designation" Visible="true" DataField="Designation"
ItemStyle-HorizontalAlign="center" ReadOnly="true" SortExpression="Designation">
<itemstyle horizontalalign="Center" width="25%">
<asp:TemplateField HeaderText="Professional Role">
<itemtemplate>
<asp:DropDownList runat="server" ID="ddlProfRole" width="87%" DataValueField="ProfRoleCode" DataSourceID="SqlDataSource2" DataTextField="ProfRoleDescription">
<asp:ListItem Text="Select" Value="-1">
<itemstyle horizontalalign="Center" width="25%">
<asp:TemplateField HeaderText="Edit" ItemStyle-HorizontalAlign="Center">
<itemtemplate>
<asp:HyperLink ID="hyperlink1" runat="server" Height="20"
ImageUrl="~/images/Access.gif"
Width="20" />
<itemstyle horizontalalign="Center" width="2%">
<alternatingrowstyle backcolor="#FFF5F5">
pls. help
gani7787
4-Jul-11 4:25am
View
any help..
gani7787
4-Jul-11 3:33am
View
Vb.net
gani7787
4-Jul-11 2:21am
View
Any help. pls.
gani7787
30-Jun-11 3:09am
View
Hi,
I am getting the error "the conversion of a char data type to a datetime data type resulted in an out-of-range datetime value in asp.net" when i insert date value into table.
aspx.code
---------
Private [date] As String = DateTime.Now.ToString
StrQry = ""
Conn.Open()
StrQry = "insert into csproject(CreatedDate) values ('" & [date] & "')"
Cmd.Connection = Conn
Cmd.CommandText = StrQry
Cmd.ExecuteNonQuery()
Cmd.Dispose()
Conn.Close()
What is the problem here...
My "CreatedDate" column datatype is datetime.
pls. help
Regards,
Ganesh.S
gani7787
28-Jun-11 9:16am
View
No it's not working again. pls. suggest me another soln..
gani7787
25-Jun-11 9:11am
View
I need to get all weeks list number for the years
pls. help
gani7787
25-Jun-11 9:08am
View
What changes did you do. can you pls. mark it out...
gani7787
24-Jun-11 10:14am
View
can you pls. provide vb.net code. so that it will be helpful for me...
Thanks..
gani7787
3-Jun-11 7:47am
View
Hi,
I am getting the new error while using the below code.
Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerServerErrorException: The script tag registered for type 'ASP.addconsumables_aspx' and key 's2' has invalid characters outside of the script tags: <SCRIPT language=alert('Please Enter Quantity');
gani7787
25-May-11 9:02am
View
I have used below command for backup.
"backup database IMS_Algeria to disk = 'D:\IMS_Algeria.bak'"
SQL Server says,
Processed 4136 pages for database 'IMS_Algeria', file 'IMS_SG' on file 3.
Processed 1 pages for database 'IMS_Algeria', file 'IMS_SG_log' on file 3.
But, nothing will be created. pls. help.
Regards,
Ganesh.S
BACKUP DATABASE successfully processed 4137 pages in 1.235 seconds (27.441 MB/sec).
gani7787
25-May-11 8:28am
View
Incorrect syntax.pls. give correct syntax
gani7787
11-May-11 8:08am
View
Yes. i have already included in the project.
gani7787
4-May-11 8:33am
View
Yes. i got it. I forgot to include css file in between head tag. now it's working.
<link href="css/ApplyCSS.css" type="text/css" rel="stylesheet"/>--> Added the code in between Head tag.
Thanks Mahendra.
Regards,
Ganesh.S
gani7787
4-May-11 8:06am
View
Sorry. Again i am getting the same problem. Modal popup displaying in black color and also css style "filter" is not known a css property-error.
Regards,
Ganesh.S
gani7787
3-May-11 5:12am
View
I know, boolean values would be enough. But, when we have Root,parent and child checkboxes, then what will be the solution.
Regards,
Ganesh.S
gani7787
3-May-11 4:27am
View
Pls. help. this is urgent.
gani7787
3-May-11 4:16am
View
any update pls.
gani7787
3-May-11 3:10am
View
It is ASP 3.0 and the code only html.
No Database.
I want to create my personal website and need to host in http.
pls. reply.
gani7787
3-May-11 2:41am
View
Thanks for your Query.
I Need code for ASP.Net with Code Behind is "VB.NET"
Thanks.
Ganesh.S
Show More