16,000,060 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 .NET 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 kav@94 (Top 105 by date)
kav@94
28-Mar-18 5:43am
View
i had already tried this but i am unable to get the required output
kav@94
14-Mar-18 7:58am
View
below is the code which i have tried as suggested by you
try
{
XmlDocument Docs = new XmlDocument();
Docs.Load(Server.MapPath("~/Sample.xml"));
XmlElement root = Docs.DocumentElement;
DataTable dt = new DataTable();
dt.Columns.Add("Bnum");
dt.Columns.Add("Pnum");
dt.Columns.Add("Vnum");
dt.Columns.Add("Vnum");
dt.Columns.Add("Cdilute");
dt.Columns.Add("Test");
dt.Columns.Add("Mcode");
XmlNodeList nodes = root.SelectNodes("????????");
foreach (XmlNode node in nodes)
{
dt.Rows.Add(node["SID"].InnerText.ToString(),
node["Pnum"].InnerText.ToString(),
node["Vnum"].InnerText.ToString(),
node["Vnum"].InnerText.ToString(),
node["Code"].InnerText.ToString(),
node["Cdilute"].InnerText.ToString(),
node["Mcode"].InnerText.ToString()
);
}
return dt;
}
catch (Exception es)
{
throw es;
}
but it is going into catch block and giving me the exception object reference not set to instance of object.I am unable to get how to provide the relation in this line XmlNodeList nodes = root.SelectNodes("????????"); to get the value of get the value of each node and subnode
kav@94
14-Mar-18 6:53am
View
That is what i am unable to get it i was already trying in the same way
kav@94
20-Feb-18 2:56am
View
Hi thanks for your quick reply i want to do this delete operation using query not through stored procedure
kav@94
1-Feb-18 7:29am
View
again in lnkCompletedBatches() usrer is becoming empty
kav@94
1-Feb-18 6:46am
View
there is one more small problem we are getting paging and we are able to navigate but when we are navigating that means each time when we click paging second grid is gwetting disappeared
kav@94
1-Feb-18 6:26am
View
no user1 is coming empty we need to get the user name of the row that we are clicking in completed,new or pending batches for that particular user
kav@94
1-Feb-18 6:21am
View
the problem is i need to get the username of whose records we are viewing in second gridview to User1 = ((LinkButton)sender).CommandArgument; but we are not getting that
kav@94
1-Feb-18 5:49am
View
protected void lnkNewBatches_Click(object sender, EventArgs e)
{
strStatus = "NewBatches";
grd2.Visible = true;
User1 = ((LinkButton)sender).CommandArgument;
DataTable dt = adm.getProjectsbyStatusbyUser(strStatus, txtDate2.Text, User1);
if (dt.Rows.Count > 0)
{
grd2.DataSource = dt;
grd2.DataBind();
}
else
{
grd2.DataSource = null;
grd2.DataBind();
}
ViewState["SecondStatus"] = "NewBatches";
}
protected void lnkRunningbatches_Click(object sender, EventArgs e)
{
strStatus = "Runningbatches";
grd2.Visible = true;
User1 = ((LinkButton)sender).CommandArgument;
DataTable dt = adm.getProjectsbyStatusbyUser(strStatus, txtDate2.Text, User1);
if (dt.Rows.Count > 0)
{
grd2.DataSource = dt;
grd2.DataBind();
}
else
{
grd2.DataSource = null;
grd2.DataBind();
}
ViewState["SecondStatus"] = "Runningbatches";
}
protected void lnkCompletedBatches_Click(object sender, EventArgs e)
{
strStatus = "CompletedBatches";
grd2.Visible = true;
User1 = ((LinkButton)sender).CommandArgument;
DataTable dt = adm.getProjectsbyStatusbyUser(strStatus, txtDate2.Text, User1);
if (dt.Rows.Count > 0)
{
grd2.DataSource = dt;
grd2.DataBind();
}
else
{
grd2.DataSource = null;
grd2.DataBind();
}
ViewState["SecondStatus"] = "CompletedBatches";
}
Paging of second gridview
protected void grd2_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
grd2.PageIndex = e.NewPageIndex;
string Eve1 = ViewState["SecondStatus"].ToString();
if (!string.IsNullOrEmpty(Eve1))
{
if (Eve1 == "CompletedBatches")
{
lnkCompletedBatches_Click(this, new EventArgs());
}
else if (Eve1 == "Runningbatches")
{
lnkRunningbatches_Click(this, new EventArgs());
}
else if (Eve1 == "NewBatches")
{
lnkNewBatches_Click(this, new EventArgs());
}
}
grd2.DataBind();
}
kav@94
1-Feb-18 5:48am
View
ok sure
kav@94
1-Feb-18 5:36am
View
ok do you need both gridviews code
kav@94
1-Feb-18 5:26am
View
lnkCompletedBatches_Click is nothing but lnkCompleted1_Click both are same
kav@94
1-Feb-18 5:19am
View
my mark ups of gridview
mark up of first griview
<asp:GridView ID="grd1" AutoGenerateColumns="false" HeaderStyle-BackColor="#708090" CssClass="EU_DataTable" PagerStyle-ForeColor="Black" HeaderStyle-ForeColor="White" runat="server" AllowPaging="true" EmptyDataText="No Records Available" Width="100%">
<columns>
<asp:BoundField HeaderText="User" DataField="DN" />
<asp:TemplateField HeaderText="New Batches">
<itemtemplate>
<asp:LinkButton ID="lnkNewBatches" OnClick="lnkNewBatches_Click" CommandName="Select" CommandArgument='<%# Eval("DN") %>' runat="server">/asp:LinkButton>
<asp:TemplateField HeaderText="Running batches"> <%-- modified working to in-progress--%>
<itemtemplate>
<asp:LinkButton ID="lnkRunningbatches" OnClick="lnkRunningbatches_Click" CommandName="Select" CommandArgument='<%# Eval("DN") %>' runat="server">
<asp:TemplateField HeaderText="CompletedBatches">
<itemtemplate>
<asp:LinkButton ID="lnkCompletedBatches" OnClick="lnkCompletedBatches_Click" CommandName="Select" CommandArgument='<%# Eval("DN") %>' runat="server">
<RowStyle ForeColor="#000066" HorizontalAlign="Center" />
mark up of second gridview
<asp:GridView ID="grd2" runat="server" ShowFooter="true" CssClass="EU_DataTable" AutoGenerateColumns="false" EmptyDataText="No Records Available"
OnPageIndexChanging="grdIndivuidualTask_PageIndexChanging" HeaderStyle-BackColor="#708090" PagerStyle-ForeColor="Black" HeaderStyle-ForeColor="White" AllowPaging="true" PageSize="2" Width="100%">
<columns>
<asp:BoundField HeaderText="Name" DataField="Name" />
<asp:BoundField HeaderText="Course" DataField="Course" />
<asp:BoundField HeaderText="Assigned To" DataField="Dn" />
<asp:BoundField HeaderText="Status" DataField="WorkStatus" />
<RowStyle ForeColor="#000066" HorizontalAlign="Center" />
kav@94
1-Feb-18 5:02am
View
no its still not working why because i need to pass lnkCompleted1_Click(object sender, EventArgs e) in my page index changing event
kav@94
1-Feb-18 5:00am
View
but i am getting error here itself know
protected void lnkCompleted1_Click(object sender, EventArgs e)
{
string User1 = ((LinkButton)sender).CommandArgument;
}
kav@94
1-Feb-18 4:44am
View
Deleted
i had updated my post could you please take a look at it from To be more clear onwards
kav@94
1-Feb-18 4:13am
View
Deleted
In First Gridview i will be having rows like this
User Completed batches
nandini 23
geetha 2
radha 4
etc
now i need to pass the username for whom i am clicking the link button in my gridview suppose if i click on 4 i need to pass
radha into below code in place of username
protected void lnkCompleted1_Click(object sender, EventArgs e)
{
strStatus = "Completedays";
grd1.Visible = true;
User1 = ((LinkButton)sender).CommandArgument; // here i am getting error as Unable to cast object of type 'ASP.home_aspx' to type 'System.Web.UI.WebControls.LinkButton'.
DataTable dt = adm.getProjectsbyStatusbyUser(strStatus, txtDate2.Text, User1);
}
kav@94
1-Feb-18 2:40am
View
Deleted
can anyone help me out
kav@94
1-Feb-18 2:06am
View
Deleted
In my paging event i want to call this event
protected void lnkCompleted1_Click(object sender, EventArgs e)
{
strStatus = "Completedays";
grd1.Visible = true;
User1 = ((LinkButton)sender).CommandArgument; // here i am getting error as Unable to cast object of type 'ASP.home_aspx' to type 'System.Web.UI.WebControls.LinkButton'.
DataTable dt = adm.getProjectsbyStatusbyUser(strStatus, txtDate2.Text, User1);
}
Paging event
protected void grd1_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
string Eve1 = ViewState["SecondStatus"].ToString();
if (Eve1 == "Completeddays")
{
lnkCompleted1_Click(this, new EventArgs());
}
}
it contains more than 3 pages for that particular user in my frist gridview
kav@94
1-Feb-18 1:56am
View
Deleted
then how can i do this
kav@94
31-Jan-18 4:05am
View
for better understanding i had mentioned in that way
kav@94
31-Jan-18 0:31am
View
then could you give some sample code with which i can date in these formats 01/29/2018 13:18:46
01/07/2017 10:48:00,06/07/2017 11:38:00
kav@94
30-Jan-18 0:22am
View
i am already using calander control only but i am getting the date only in mm/dd/yyyy format but i need to get in these formats 01/29/2018 13:18:46
01/07/2017 10:48:00,06/07/2017 11:38:00
kav@94
30-Jan-18 0:22am
View
i am already using calander control only but i am getting the date only in mm/dd/yyyy format but i need to get in these formats 01/29/2018 13:18:46
01/07/2017 10:48:00,06/07/2017 11:38:00
kav@94
29-Jan-18 8:58am
View
when i choose date using datepicker i need to get the date into string variable in these formats
01/29/2018 13:18:46
01/07/2017 10:48:00
06/07/2017 11:38:00
and also todays date should be in the above formats
kav@94
29-Jan-18 8:50am
View
but they are not working could you show with some example for today's date and the date entered in textbox it should be of the above mentioned formats
kav@94
29-Jan-18 8:50am
View
but they are not working could you show with some example for todays's date and the date entered in textbox it should be of the above mentioned formats
kav@94
24-Jan-18 9:06am
View
no using this query i need to create that solution
I already have the query how can i get the data using this query by passing the date that i entered in textbox and by checking whether it is between from date and to date
SELECT (SELECT PName FROM PDet WHERE (ID = dws.PName )) AS ProjName, TTitle AS Title,
(SELECT Name FROM User WHERE (ID = dws.Dname)) AS Devname, Status,
(SELECT Name FROM User AS User_a WHERE (ID = dws.AWork))
AS AssWork, FromDate, ToDate, DescATask FROM Status AS ws
kav@94
24-Jan-18 8:51am
View
what is the percentage calculation you are asking about my above query is giving me this data
Sno Status FromDate ToDate
1 Pending 02/20/2017 02/26/2017
2 Hold 01/10/2017 01/25/2017
3 Completed 02/21/2017 02/26/2017
4 Completed 02/22/2017 02/28/2017
5 Hold 01/15/2017 01/30/2017
6 Pending 01/20/2017 02/22/2017
now i need to modify my above query to get this data
Pending Hold Completed
1 0 2
kav@94
24-Jan-18 7:58am
View
I already have the query how can i get the data using this query by passing the date that i entered in textbox and by checking whether it is between from date and to date
SELECT (SELECT PName FROM PDet WHERE (ID = dws.PName )) AS ProjName, TTitle AS Title,
(SELECT Name FROM User WHERE (ID = dws.Dname)) AS Devname, Status,
(SELECT Name FROM User AS User_a WHERE (ID = dws.AWork))
AS AssWork, FromDate, ToDate, DescATask FROM Status AS ws
kav@94
24-Jan-18 2:20am
View
because sql query is not working how can i pass the entered date in textbox to sql query
kav@94
24-Jan-18 1:58am
View
i want to make it through c# code as i had already tried using sql query
kav@94
17-Jan-18 4:50am
View
I am trying to put in a method and stop the execution of next lines of my code if it goes into else condition of my below method by using return keyword but it is still executing the next lines of my code after going in else condition.How can i stop my execution of next lines of code after going into else condition
public void Users()
{
DataTable dt = new DataTable();
dt.Columns.Add(new DataColumn("Id", typeof(string)));
dt.Rows.Add("test1@test.com,test2@test.com,test3@test.com");
dt.Rows.Add("test4@test.com,test5@test.com,test6@test.com");
dt.Rows.Add("test7@test.com,test8@test.com,test9@test.com");
DataTable dtusercheck = dt;
DataTable dt2 = new DataTable();
dt2.Columns.Add(new DataColumn("Id", typeof(string)));
dt2.Rows.Add("test3@test.com");
DataTable dtuserinprojectornot = dt2;
DataTable dt3 = dtuserinprojectornot.Clone();
foreach (DataRow row1 in dtusercheck.Rows)
{
foreach (DataRow row2 in dtuserinprojectornot.Rows)
{
foreach (string emailId in row1["id"].ToString().Split(','))
{
if (emailId == row2["id"].ToString())
{
dt3.ImportRow(row2);
}
}
}
}
if (dt3.Rows.Count > 0)
{
lblErrMsg.Visible = true;
}
else
{
lblErrMsg.Visible = true;
return;
}
}
kav@94
17-Jan-18 4:17am
View
I am trying to put in a method and stop the execution of next lines of my code if it goes into else condition of my below method by using return keyword but it is still executing the next lines of my code after going in else condition.How can i stop my execution of next lines of code after going into else condition
public void Users()
{
DataTable dt = new DataTable();
dt.Columns.Add(new DataColumn("Id", typeof(string)));
dt.Rows.Add("test1@test.com,test2@test.com,test3@test.com");
dt.Rows.Add("test4@test.com,test5@test.com,test6@test.com");
dt.Rows.Add("test7@test.com,test8@test.com,test9@test.com");
DataTable dtusercheck = dt;
DataTable dt2 = new DataTable();
dt2.Columns.Add(new DataColumn("Id", typeof(string)));
dt2.Rows.Add("test3@test.com");
DataTable dtuserinprojectornot = dt2;
DataTable dt3 = dtuserinprojectornot.Clone();
foreach (DataRow row1 in dtusercheck.Rows)
{
foreach (DataRow row2 in dtuserinprojectornot.Rows)
{
foreach (string emailId in row1["id"].ToString().Split(','))
{
if (emailId == row2["id"].ToString())
{
dt3.ImportRow(row2);
}
}
}
}
if (dt3.Rows.Count > 0)
{
lblErrMsg.Visible = true;
}
else
{
lblErrMsg.Visible = true;
return;
}
}
kav@94
17-Jan-18 4:11am
View
Deleted
I am trying to put in a method and stop the execution of next lines of my code if it goes into else condition of my below method by using return keyword but it is still executing the next lines of my code after going in else condition.How can i stop my execution of next lines of code after going into else condition
public void Users()
{
DataTable dt = new DataTable();
dt.Columns.Add(new DataColumn("Id", typeof(string)));
dt.Rows.Add("test1@test.com,test2@test.com,test3@test.com");
dt.Rows.Add("test4@test.com,test5@test.com,test6@test.com");
dt.Rows.Add("test7@test.com,test8@test.com,test9@test.com");
DataTable dtusercheck = dt;
DataTable dt2 = new DataTable();
dt2.Columns.Add(new DataColumn("Id", typeof(string)));
dt2.Rows.Add("test3@test.com");
DataTable dtuserinprojectornot = dt2;
DataTable dt3 = dtuserinprojectornot.Clone();
foreach (DataRow row1 in dtusercheck.Rows)
{
foreach (DataRow row2 in dtuserinprojectornot.Rows)
{
foreach (string emailId in row1["id"].ToString().Split(','))
{
if (emailId == row2["id"].ToString())
{
dt3.ImportRow(row2);
}
}
}
}
if (dt3.Rows.Count > 0)
{
lblErrMsg.Visible = true;
}
else
{
lblErrMsg.Visible = true;
return;
}
}
kav@94
12-Jan-18 8:28am
View
below is my pageindexchanging method the total which i am getting in ViewState["Result1".tostring() should be binded to last page of my gridview how can i do this can anyone help me out
protected void grd_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
DataTable dt = (DataTable)ViewState["grd"];
if (dt.Rows.Count > 0)
{
grd.PageIndex = e.NewPageIndex;
grd.DataSource = dt;
grd.DataBind();
grd.FooterRow.Cells[6].Text = "Total:";
grd.FooterRow.Cells[6].HorizontalAlign = HorizontalAlign.Left;
grd.FooterRow.Cells[7].Text = ViewState["Result1"].ToString();
grd.FooterRow.Cells[6].Font.Size = 15;
grd.FooterRow.Cells[7].Font.Size = 15;
}
else
{
grdUser.DataSource = null;
grdUser.DataBind();
}
}
kav@94
28-Dec-17 2:53am
View
i had updated it can you please help me out
kav@94
28-Dec-17 0:55am
View
Deleted
i had added div tag but still same issue and this is my css
.navbar {
overflow: hidden;
background-color: #333;
font-family: Bauhaus 93;
}
.navbar a {
float: left;
font-size: 16px;
color: white;
text-align: center;
padding: 14px 16px;
text-decoration: none;
}
.dropdown {
float: left;
overflow: hidden;
}
.dropdown .dropbtn {
font-size: 16px;
border: none;
outline: none;
color: white;
padding: 14px 16px;
background-color: inherit;
}
.navbar a:hover, .dropdown:hover .dropbtn {
background-color: red;
}
.dropdown-content {
display: none;
position: absolute;
background-color: #f9f9f9;
min-width: 160px;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
z-index: 1;
}
.dropdown-content a {
float: none;
color: black;
padding: 12px 16px;
text-decoration: none;
display: block;
text-align: left;
}
.dropdown-content a:hover {
background-color: #ddd;
}
.dropdown:hover .dropdown-content {
display: block;
}
html,
body {
margin: 0;
padding: 0;
height: 100%;
}
#wrapper {
min-height: 100%;
position: relative;
}
#header {
background: #ededed;
padding: 10px;
}
#content {
padding-bottom: 100px;
/* Height of the footer element */
}
/*#footer {
background: #ffab62;
width: 100%;
height: 100px;
position: absolute;
bottom: 0;
left: 0;
}*/
kav@94
26-Dec-17 1:53am
View
you did not get my point i guess when i keep if(theLinkButton != null)
{
// Enable the link button
theLinkButton.Enabled = true;
} then each time when i click link button it is going into if block but it should go into if block only when i click that link button
kav@94
26-Dec-17 1:45am
View
i need to call in page index changing event
kav@94
22-Dec-17 7:08am
View
how can i do it at the backend could you illustrate with an example
kav@94
12-Dec-17 5:26am
View
my requirement is different from the solution you gave me
My table1 data and table2 data are already there in my database and i am trying to compare the table 1 data with table2 data that is i am comparing
CPTCode CPT
80051 82374
82435
84132
84295
with
Billnum CPT
OCR000967985 80051
OCR000967985 82310
OCR000967985 83690
OCR000967985 84132
OCR000967985 85025
OCR000967985 86140
as my second table has both 80051 and 84132 in first table i need to apply colour for my second table while exporting to excel.
i am getting the two tables data into two datatables and i got strucked in comparing the first datatable with second datatable in order to find the matching CPT'S in both the datatables and to apply the colours.
Till now i am able to get two tables data into two datatables from there i got strucked with two tasks they are
1) Finding the matching Cpt's in both the tables and
2) Applying colour to those matching Cpt's while exporting to excel
kav@94
12-Dec-17 4:49am
View
using interop
kav@94
29-Nov-17 0:19am
View
Hi i am getting below errors
'Color' is an ambiguous reference between 'System.Drawing.Color' and 'DocumentFormat.OpenXml.Spreadsheet.Color'
'object' does not contain a definition for 'Style' and no extension method 'Style' accepting a first argument of type 'object' could be found (are you missing a using directive or an assembly reference?)
kav@94
28-Nov-17 4:02am
View
i had already tried them they are not working
kav@94
21-Nov-17 0:25am
View
i had already tried by using media queries but its not working that is the reason for posting my question with complete html and css code
kav@94
20-Nov-17 14:50pm
View
can any one please help me out i am completely new to this and hence i am unable to do this
kav@94
20-Nov-17 2:23am
View
can you please help me out with this as i am new to this and more over i am unable to access the link you shared to me
kav@94
10-Sep-17 22:43pm
View
thank you
kav@94
10-Sep-17 22:31pm
View
if you can help me help me out otherwise dont post the reply to my question every time when the message comes into my inbox i am checking the messages whether i have a solution but you will be replying like vampire and all which is of no use and waste of time for both of us i had posted this question as i could not get the solution if you can give me the solution i will be happy otherwise please dont reply if you cant give me the solution
kav@94
10-Sep-17 22:18pm
View
Deleted
that is what i said as i am very begineer i could not find way for doing this and i could not move forward to do this
kav@94
7-Sep-17 3:40am
View
yes but i am new to this can you please help me out
kav@94
7-Sep-17 3:26am
View
but still i am getting error near var files = new List<string> { "aaa.mp3", "aaa-c.mp3", "aAa-c.DoC", "aAa-c.doc" }; commas in this line and near foreach (string file in files) line moreover i cant keep the filenames statically in list it should be taben from the files that are choosed using fileuploader
kav@94
7-Sep-17 3:07am
View
its .net framework 3.5
kav@94
7-Sep-17 3:01am
View
i am getting error near foreach loop at var as syntax error and also near console.writeline as expected ')' this is javascript funtion not c# code
kav@94
7-Sep-17 2:46am
View
i tried your code only but its not working it is still accepting other extensions
kav@94
7-Sep-17 1:48am
View
i tried in this way but still its not working
if (myfile.indexOf("-c.doc").toLowerCase() > 0 || myfile.indexOf("-C.DOC").toLowerCase() > 0 || myfile.indexOf("-C.doc").toLowerCase() > 0 || myfile.indexOf("-c.DOC").toLowerCase() > 0 || myfile.indexOf("-c.docx").toLowerCase() > 0 || myfile.indexOf("-C.DOCX").toLowerCase() > 0 || myfile.indexOf("-C.docx").toLowerCase() > 0 || myfile.indexOf("-c.DOCX").toLowerCase() > 0) {
label.innerText = "Valid Format";
}
else {
label.innerText = "Invalid Format";
chkFile.value = "";
}
}
kav@94
7-Sep-17 1:22am
View
Deleted
how can i do this can you please show me out as i am new to this below is my code
function checkbaseFileExtension() {
var chkFile = document.getElementById('<%= filBaseDoc.ClientID %>');
var label = document.getElementById('<%= lblerrmsg.ClientID%>');
var myfile = chkFile.value;
if (myfile.indexOf("-c.doc") > 0 || myfile.indexOf("-C.DOC")!= -1 || myfile.indexOf("-C.doc") != -1 || myfile.indexOf("-c.DOC")!= -1 || myfile.indexOf("-c.docx") != -1|| myfile.indexOf("-C.DOCX") != -1 || myfile.indexOf("-C.docx") != -1 || myfile.indexOf("-c.DOCX")!= -1) {
label.innerText = "Valid Format";
}
else {
label.innerText = "Invalid Format";
chkFile.value = "";
}
}
kav@94
7-Sep-17 1:02am
View
i had even tried with if (myfile.indexOf("-c.doc") != -1 || myfile.indexOf("-C.DOC") > != -1) but if i choose the files in
below order it is still saying valid format but it should say invalid format
because in the selected files there is an .mp3 file 400-C.doc,401-c.doc,402-C.doc,403.mp3
kav@94
6-Sep-17 7:39am
View
Deleted
my multiple file uploader should accept only files with extension -c.docx,-C.docx if any other extensions are selected using fileuploader it should show an error msg and clear the files that are previously choosed
kav@94
4-Sep-17 3:13am
View
Deleted
can you please show me how to do that as i am new to this
kav@94
22-Aug-17 7:06am
View
my first array
"400005733.wav"
"400006813.wav"
my second array
"400005733-b.doc"
"400006813-b.doc"
if we see them 400005733.wav matches with 400005733-b.doc irresptive of exctensions but i have -b which should be removed and that name after removing -b "400005733.doc" this should be saved in a string variable how can i do this
kav@94
22-Aug-17 5:44am
View
Deleted
can you show me how to do that as i am new to this
kav@94
22-Aug-17 5:38am
View
Deleted
then how can i assign to string variable if that filename in arr1 is is array 2
kav@94
22-Aug-17 5:26am
View
for (int i = 0; i < wavarr.Length; i++)
{
if (basearr.Contains(wavarr[i]))
{
// Array 2 contains this element. Index: i. Value: arr1[i]
}
// do the same for arr3 and arr4
}
i had did this but it is giving below error
'System.Array' does not contain a definition for 'Contains' and no extension method 'Contains' accepting a first argument of type 'System.Array' could be found (are you missing a using directive or an assembly reference?) C:\Users\yaminik\Desktop\MT original from network with 208 db\mttraining\SubjectItems.aspx.cs 153 28 C:\...\mttraining\
kav@94
22-Aug-17 5:21am
View
Deleted
i have 4 elements in array one i need to take zeroth element in first array and check whether it is there in second third and fourth array if it exists i need to store in a strin variable and again i need to take the name in first array at index one and repeat the same that is what i need to do
kav@94
24-Jul-17 3:05am
View
i want in mm dd yyyy format
kav@94
23-Jul-17 5:13am
View
Deleted
i have an excel sheet with a column from date in it and that from date will always be in the fourth column of excel sheet
for(int i = 2; i < RowCount; i++)
{
for(int j=1;j< ColCount;j++)
{
cell = sheet.getCellAt(j, i);
Value= cell.getValue().toString();
if(j==1)
{
Name=Value;
}
else if(j==2)
{
Firstname=Value;
}
else if(j==3)
{
Lastname=Value;
}
else if(j==4)
{
Fromdate=Value;
SimpleDateFormat sdf = new SimpleDateFormat("MM-DD-YYYY hh:mm:ss");
java.sql.Date d = new java.sql.Date(sdf.parse(Fromdate).getTime());
}
int k=st.executeUpdate("Insert into Users(Name,Firstname,Lastname,Fromdate)values('"+Name+"','"+Firstname+"','"+Lastname+"','"+Fromdate+"')");
System.out.println("Data is inserted");
}
} this is the code i am using to read the excel sheet data and insert into database but its not working
kav@94
22-Jul-17 5:26am
View
but i need to pass this from date because i need to convert that date that i am getting in from date to mm/dd/yyyy format
String FromDate="";
FromDate=Value;
kav@94
21-Jul-17 2:07am
View
kav@94
18-Jul-17 8:33am
View
Deleted
I am using sql server database and below is my code for insertion
if (nColIndex==14 && cell.isEmpty())
{
throw new RuntimeException(String.format("Cell at col=%d,row=%d is empty%n", nColIndex, nRowIndex));
}
else
{
Connection conn=null;
Class.forName("com.microsoft.sqlserver.jdbc.SQLSer verDriver");
SQLServerDataSource ds = new SQLServerDataSource();
ds.setUser("");
ds.setPassword("");
ds.setServerName("");
ds.setDatabaseName("");
conn = ds.getConnection();
for(int i = 0; i < nRowCount; i++)
{
HttpSession session=request.getSession();
String Name=session.getAttribute("userid").toString();
String doneby=session.getAttribute("userid").toString();
String sql="insert into login(username,password,doneby,name) value(?,?,?,?)";
PreparedStatement ps=conn.prepareStatement(sql);
ps.execute();
request.setAttribute("message", "The details are saved successfully");
}
}
cell = sheet.getCellAt(nColIndex, nRowIndex);
System.out.print(cell.getValue()+ " ");
}
System.out.println();
}
kav@94
27-Jun-17 6:12am
View
my question is not about displaying the sum in datagridview it is about binding label messages to gridview
kav@94
16-Jun-17 7:25am
View
every user will have a downloads folder know where all the files gets downloaded in downloads that is where i need to place my file
kav@94
16-Jun-17 6:59am
View
i am not saving my file in application folder i should directly save in downloads folder
kav@94
16-Jun-17 6:33am
View
protected void btnExportExcel_Click(object sender, EventArgs e)
{
string pathDownload = @"~\Downloads\"+Session["CPT"].ToString() + "-" + "HistoricalData.xls";
ExportToExcel(dsExcel, pathDownload);
lblMessage.Text = "Downloaded Successfully";
}
private void ExportToExcel(DataSet table, string filePath)
{
int tablecount = table.Tables.Count;
StreamWriter sw = new StreamWriter(filePath, false);
}
this is the path that i am getting ~\Downloads\DATA.xls
and i am getting this exception Could not find a part of the path 'C:\Program Files (x86)\Common Files\Microsoft Shared\DevServer\11.0\~\Downloads\DATA.xls'. near StreamWriter sw = new StreamWriter(filePath, false);
kav@94
16-Jun-17 5:59am
View
i know that i should provide the path for the excel to get download but i cannot pass this path because when hosted in server it is giving error so i got strucked
string pathUser = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);
string pathDownload = Path.Combine(pathUser, "Downloads\\");
kav@94
16-Jun-17 5:41am
View
byte[] fileContent = File.ReadAllBytes(path);
HttpContext.Current.Response.Clear();
HttpContext.Current.Response.AddHeader("Content-Disposition attachment; filename=myFile.xlsx");
HttpContext.Current.Response.AddHeader("Content-Length", fileContent.Length.ToString());
HttpContext.Current.Response.ContentType = "application/octet-stream";
HttpContext.Current.Response.BinaryWrite(fileContent);
HttpContext.Current.Response.End();
by placing this code i am getting error near path and near add header
kav@94
16-Jun-17 5:33am
View
Deleted
where should i place this code because it is not working more over i need to give the path in such a way that it gets downloaded into downloads folder
kav@94
16-Jun-17 4:36am
View
Response.ContentType = "APPLICATION/OCTET-STREAM";
String Header = "Attachment; Filename=XMLFile.xml";
Response.AppendHeader("Content-Disposition", Header);
System.IO.FileInfo Dfile = new System.IO.FileInfo(Server.MapPath("here i had gien my application folder name"));
Response.WriteFile(Dfile.FullName);
//Don't forget to add the following line
Response.End();
this is the code that i had used but it is giving exception because i am using stream writer in my code and this code is not working i should be able to downlad into downloads folder on button click
kav@94
16-Jun-17 4:30am
View
i had tried but they are not working while downloading i am getting exception
kav@94
28-Apr-17 5:38am
View
Deleted
it is hours and min
int val = 0;
for (int i = 0; i < dt.Rows.Count; i++)
{
string result = dt.Rows[i]["WorkingTime"].ToString();
string[] array = result.Split(' ');
string mm = string.Empty;
if (array.Length > 0)
{
int hrs = Convert.ToInt32(array[0].ToString());
string Min = array[1].ToString();
if (!string.IsNullOrEmpty(Min))
{
string[] minn = Min.Split(':');
mm = minn[1].ToString();
}
string min = mm;
//string Total = hrs + ":" + Mval.ToString();
string Total = hrs + min.ToString();
int va = Convert.ToInt32(Total.ToString());
val = val + va;
}
dt.AcceptChanges();
} this is the complete code i am getting error near int va = Convert.ToInt32(Total.ToString()); as Input string was not in a correct format.
kav@94
28-Apr-17 5:07am
View
does that had any answer
kav@94
27-Apr-17 7:50am
View
i should not use regular exp i should use javascript function and validate that textbox <asp:TextBox ID="txt1" runat="server"> on text change event in such a way that the domains are either gmail.com or yahoo.com.It should not allow other domains except gmail and yahoo i need to compare with the email given in textbox if that domain matches with gmail or yahoo then only it should show valid else it should clear the textbox and display not valid
kav@94
27-Apr-17 7:00am
View
i should not use regular exp i should use javascript function and validate that textbox <asp:TextBox ID="txt1" runat="server"> on text change event in such a way that the domains are either gmail.com or yahoo.com.It should not allow other domains except gmail and yahoo
kav@94
20-Apr-17 8:34am
View
Deleted
i am getting 2yrs -2 months and 19 days but i need to get 1yr 10 months 19 days
kav@94
24-Feb-17 2:48am
View
my problem is i should again display the error messages after uploading the sheet successfully againg if user select invalid month and year but once the data is inserted no error message is displayed on button click
kav@94
24-Feb-17 2:40am
View
the issue is till i upload the sheet successfully into database i am able to display the label messages to the user select month ,select year,not a valid document,select file all these messages i am able to display when user clicks the button but once the sheet is uploaded i am unable to see the error messages on button click but the button click event is firing
kav@94
23-Feb-17 11:21am
View
Hi Anandm then how should i get my requirement can you please help me out as you know my complete reuirement that is i will choose some month and year and upload the sheet using file uploader and finally i will click the button when i click the button it should check whether the month and year in the sheet matches with the month and year given by us if yes it should get inserted else it should not get inserted this process should repeat and each time when i choose the file i need to clear the previous label message after choosing the file whether it is uploaded or not i need to clear the label msg each time
kav@94
23-Feb-17 11:20am
View
Hi Anandm then how should i get my requirement can you please help me out as you know my complete reuirementthat is i will choose some month and year and upload the sheet using file uploader and finally i will click the button when i click the button it should check whether the month and year in the sheet matches with the month and year given by us if yes it should get inserted else it should not get inserted this process should repeat and each time when i choose the file i need to clear the previous label message after choosing the file whether it is uploaded or not i need to clear the label msg each time
kav@94
23-Feb-17 11:13am
View
Hi grief it is not working my requirement is i will be selecting month and year using drop down and choosing the file using file uploader if the selected month and year matches with the month and year in the sheet then data should be inserted else it should stop insertion and display as not a valid document and when i choose the file again by file uploader by selecting month and year previous label message should be disappered.Ihad posted my code in one of the comments it is the main process that happens when i click the button can you suggest any solution
kav@94
23-Feb-17 11:12am
View
Hi madhav_jain it is not working my requirement is i will be selecting month and year using drop down and choosing the file using file uploader if the selected month and year matches with the month and year in the sheet then data should be inserted else it should stop insertion and display as not a valid document and when i choose the file again by file uploader by selecting month and year previous label message should be disappered.Ihad posted my code in one of the comments it is the main process that happens when i click the button can you suggest any solution
kav@94
23-Feb-17 7:03am
View
even that is also not working
kav@94
23-Feb-17 7:00am
View
i had posted my complete code and requirement can you give me the sol
kav@94
23-Feb-17 6:57am
View
i did not get you can you post little clearly my requirement is i will be selecting month and year and choosing the file using file uploader if the selected month and year matches with the month and year in the sheet then data should be inserted else it should stop insertion and display as not a valid document and when i choose the file again by file uploader by selecting month and year previous label message should be disappered.below is my complete code can you suggest any solution
Select Month:<asp:DropDownList ID="ddlmonth" runat="server">
<asp:ListItem Value="0">--Select--
Select Year:<asp:DropDownList ID="ddlyear" runat="server">
<asp:ListItem Value="0">--Select--
SELECT SHEET<asp:FileUpload ID="FileUpload1" runat="server"/><asp:Button ID="btnUpload" runat="server" OnClick="btnUpload_Click" Width="130px" Height="23px" Text="UPLOAD" /> <asp:Label ID="lblerrorMessage" runat="server" ForeColor="Red"> <asp:Label ID="label1" runat="server" ForeColor="Green">
protected void btnUpload_Click(object sender, EventArgs e)
{
//Validations for From Date,To Date and File Uploader
if (ddlmonth.SelectedValue == "0")
{
lblerrorMessage.Text = "Please Select The Month";
}
else if (ddlyear.SelectedValue == "0")
{
lblerrorMessage.Text = "Please Select The Year";
}
else if (FileUpload1.HasFile == false)
{
lblerrorMessage.Text = "Please Select A File";
}
else
{
string fileName = Path.GetFileName(FileUpload1.PostedFile.FileName);
FileUpload1.PostedFile.SaveAs(Server.MapPath("~/Files/" + fileName));
string fullpath = Path.GetFullPath(Server.MapPath("~/Files/" + fileName));
ReadExcelSheet obj = new ReadExcelSheet();
//send filepath,sheet number,selected rows to class file
DataTable dt = obj.Read(fullpath, 1);
bool Ismatch = false;
for (int i = 0; i < dt.Rows.Count; i++)
{
string date = dt.Rows[i]["Month"].ToString();
string[] date1 = date.Split('/');
string month = date1[0];
string year = date1[2];
if (month == ddlmonth.SelectedValue && year == ddlyear.SelectedValue)
{
Ismatch = true;
//break;
}
else
{
Ismatch = false;
break;
}
}
if (Ismatch == true)
{
lblerrorMessage.Visible = false;
lblerrorMessage.Text = "Valid Document";
}
else
{
lblerrorMessage.Text = "Not a Valid Document";
ddlmonth.ClearSelection();
ddlyear.ClearSelection();
label1.Text = "";
return;
}
//checking the input month and year records exists or not in DB
SqlCommand cmd = new SqlCommand("select Uploaded from TestMCount ", con);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataTable DBdt = new DataTable();
da.Fill(DBdt);
if (DBdt.Rows.Count > 0)
{
kav@94
23-Feb-17 6:47am
View
i need to clear my label message not a valid document while choosing the file only but it is not getting cleared
kav@94
23-Feb-17 6:36am
View
i had tried your code by taking in my aspx page and taking in aspx page and js fun function callme() {
document.getElementById("your message label id").value= "";
} and finally calling it in this way in .cs page
kav@94
23-Feb-17 6:11am
View
i tried it but its not working
kav@94
3-Feb-17 3:07am
View
but i need to do it with c# code that too i need to display the word count while typing text in ck editor
kav@94
16-Jan-17 4:50am
View
jquery.dataTables.min.js and jquery-1.11.1.min.js
kav@94
16-Jan-17 4:50am
View
kav@94
18-Dec-16 7:37am
View
can you please show me how to do that
kav@94
16-Dec-16 6:06am
View
it is not download i need to open the open office spread sheet document on button click in browser
kav@94
16-Dec-16 0:12am
View
I have open office installed in my system and i am trying to open the open office document that is saved in my application folder by clicking an image using asp .net c#
kav@94
15-Dec-16 0:13am
View
It should be implemented with asp .net also i should open the open office spread sheet word document on clicking an image button in the browser not the download
kav@94
14-Dec-16 23:51pm
View
can you please provide any links for implementing this
Show More