15,899,679 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 Kandiya (Top 24 by date)
Kandiya
6-Oct-15 8:30am
View
Tried as such but on doing so If there is multiple elements are missing on comparing validation error message for missing elements is shown only one after the other.
Kandiya
6-Oct-15 7:48am
View
Only the missing elements in the Input Xml are to be figured out by comparing with the Reference Xml.Value comparison of the Nodes are not required.
Kandiya
5-Oct-15 10:15am
View
Tried below code but not working .I just want the node missing on comparing. Value difference is not required.
public void CompareXmlTest1(string RefXml, string InputXml)
{
string childnodeCommon = string.Empty;
string childnode = string.Empty;
FileInfo feedList = new FileInfo(RefXml);
FileInfo feedRequest = new FileInfo(InputXml);
// Load the documents
XmlDocument feedListXmlDoc = new XmlDocument();
feedListXmlDoc.Load(RefXml);
// Load the documents
XmlDocument feedRequestXmlDoc = new XmlDocument();
feedRequestXmlDoc.Load(InputXml);
// Define a single node
XmlNode feedListNode;
XmlNode feedRequestNode;
//Get Child Node Names(New)
string feedListNodeName = string.Empty;
string feedRequestNodeName = string.Empty;
//End
// Get the root Xml element
XmlElement feedListRoot = feedListXmlDoc.DocumentElement;
XmlElement feedRequestRoot = feedRequestXmlDoc.DocumentElement;
// Get a list of feeds for the stored list and the request
XmlNodeList feedListXml = feedListRoot.SelectNodes("/Names");
XmlNodeList feedRequestXml = feedRequestRoot.SelectNodes("/Names");
if (feedListRoot.HasChildNodes && feedRequestRoot.HasChildNodes)
{
try
{
// loop through list of Ref Xml Child Nodes
for (int i = 0; i < feedListRoot.ChildNodes.Count; i++)
{
//Get Ref Xml Node
feedListNode = feedListRoot.ChildNodes.Item(i);
//Get Ref Xml Child Node Name
feedListNodeName = feedListRoot.ChildNodes.Item(i).Name.ToString();
//check Input Xml Child Nodes for any missing with the Ref Xml Child Nodes
//Get Input Xml Child Node Name
if (feedRequestRoot.ChildNodes.Item(i) != null)
{
//Get Input Xml Node
feedRequestNode = feedRequestXml.Item(i);
}
//checks to see if child node names is there or not comparing the Input Xml with Ref Xml
else
{
feedListNodeName = feedListRoot.ChildNodes.Item(i).Name.ToString();
if (string.IsNullOrEmpty(childnode) == true)
{
childnode = "Missing Child Node: " + feedListNodeName;
}
else
{
childnode += "," + feedListNodeName;
}
childnodeCommon = childnode + " for the Parent Node " + feedListRoot.Name;
}
}
}
finally
{
//Console.WriteLine("Result file has been written out at " + _resultPath);
}
}
Response.Write(childnodeCommon);
//feedListXmlDoc.Save(_resultPath);
}
Kandiya
5-Oct-15 10:13am
View
How to compare two XML files and fetch missing nodes using c#?
Tried below code but not working .
public void CompareXmlTest1(string RefXml, string InputXml)
{
string childnodeCommon = string.Empty;
string childnode = string.Empty;
FileInfo feedList = new FileInfo(RefXml);
FileInfo feedRequest = new FileInfo(InputXml);
// Load the documents
XmlDocument feedListXmlDoc = new XmlDocument();
feedListXmlDoc.Load(RefXml);
// Load the documents
XmlDocument feedRequestXmlDoc = new XmlDocument();
feedRequestXmlDoc.Load(InputXml);
// Define a single node
XmlNode feedListNode;
XmlNode feedRequestNode;
//Get Child Node Names(New)
string feedListNodeName = string.Empty;
string feedRequestNodeName = string.Empty;
//End
// Get the root Xml element
XmlElement feedListRoot = feedListXmlDoc.DocumentElement;
XmlElement feedRequestRoot = feedRequestXmlDoc.DocumentElement;
// Get a list of feeds for the stored list and the request
XmlNodeList feedListXml = feedListRoot.SelectNodes("/Names");
XmlNodeList feedRequestXml = feedRequestRoot.SelectNodes("/Names");
if (feedListRoot.HasChildNodes && feedRequestRoot.HasChildNodes)
{
try
{
// loop through list of Ref Xml Child Nodes
for (int i = 0; i < feedListRoot.ChildNodes.Count; i++)
{
//Get Ref Xml Node
feedListNode = feedListRoot.ChildNodes.Item(i);
//Get Ref Xml Child Node Name
feedListNodeName = feedListRoot.ChildNodes.Item(i).Name.ToString();
//check Input Xml Child Nodes for any missing with the Ref Xml Child Nodes
//Get Input Xml Child Node Name
if (feedRequestRoot.ChildNodes.Item(i) != null)
{
//Get Input Xml Node
feedRequestNode = feedRequestXml.Item(i);
}
//checks to see if child node names is there or not comparing the Input Xml with Ref Xml
else
{
feedListNodeName = feedListRoot.ChildNodes.Item(i).Name.ToString();
if (string.IsNullOrEmpty(childnode) == true)
{
childnode = "Missing Child Node: " + feedListNodeName;
}
else
{
childnode += "," + feedListNodeName;
}
childnodeCommon = childnode + " for the Parent Node " + feedListRoot.Name;
}
}
}
finally
{
//Console.WriteLine("Result file has been written out at " + _resultPath);
}
}
Response.Write(childnodeCommon);
//feedListXmlDoc.Save(_resultPath);
}
Kandiya
5-Oct-15 1:57am
View
I have a reference xml and an input xml.
In the input xml few child nodes are missing.
I want to fetch those missing child nodes by comparing the reference xml with the Input Xml provided.
Kandiya
17-Sep-15 7:42am
View
what is to be set in divPDF in the source code part(aspx page)?
Kandiya
8-Jun-15 0:36am
View
some popular smartcards/tokens still don’t support signing with SHA256 hash, they only support SHA1withRSA Algorithm. Hence its needed
Kandiya
20-May-15 7:13am
View
//First Case
var num = 123.40;
str = num.toString();
len = str.length;
alert(len);
//Second Case
var num = 123.45;
str = num.toString();
len = str.length;
alert(len);
Kandiya
13-May-15 9:32am
View
I want the same in English Metric . I mean in millions instead of crore, lakhs etc. Which is the indian Rupee format.
Kandiya
28-Apr-15 3:35am
View
I want to update the below IBAN validation suited for all countries other than UAE alone???
<script>
//var IBAN = "DE12500105170648489890";
//var IBAN = "GB82WEST12345698765432";
var IBAN="AE260211000000230064016";
app.alert(IBAN);
if (IBAN == "") {
app.alert("Please Enter IBAN Value");
this.getField("txtIBAN").setFocus();
exit();
}
if(IBAN!="")
{
if (IBAN.length !=23) {
app.alert("IBAN Validation Error!! IBAN should contain 23 Characters");
this.getField("txtIBAN").setFocus();
exit();
}
else {
var moveLast = IBAN.substring(0,2);
var CheckDigit = IBAN.substring(2, 4);
var BankCode = IBAN.substring(4, 7);
var AccountCode = IBAN.substring(7, 23);
if (CheckAllCaps(IBAN) == false) {
app.alert("Invalid IBAN");
this.getField("txtIBAN").setFocus();
exit();
}
var CountryCodeString = '';
CountryCodeString = GetCharCode(CountryCode);
app.alert(CountryCodeString);
moveLast = BankCode + AccountCode + CountryCodeString + CheckDigit;
// moveLast = RemoveLeadingZeros(moveLast);
app.alert(strcode);
var strcode = parseFloat(strcode) % 97;
app.alert(strcode);
if (strcode != "1") {
app.alert("Not a valid IBAN");
this.getField("txtIBAN").setFocus();
exit();
}
}
}
function CheckAllCaps(IBAN) {
var i = 0;
var countUpper = 0;
var countAlphabets = 0;
var character = '';
while (i <= IBAN.length) {
character = IBAN.charAt(i);
if (isNaN(character * 1)) {
countAlphabets++;
if (character == character.toUpperCase()) {
countUpper++;
}
}
i++;
}
if ((countAlphabets == 0) || (countAlphabets != countUpper)) {
return false;
}
return true;
}
function GetCharCode(CountryCode) {
var count = 0;
var CountryCodeSplit = '';
var CountryCodeStr = '';
var Result = '';
var charCodeAr = new Array("A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z");
var DecValueAr = new Array("10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31", "32", "33", "34", "35");
while (count <= 1) {
for (var i = 0; i < charCodeAr.length; i++) {
if (CountryCode.substring(count, count + 1) == charCodeAr[i]) {
Result = Result + DecValueAr[i];
}
}
count++;
}
return Result;
}
function RemoveLeadingZeros(strDigit) {
var remain = strDigit.replace(/^0+/, '');
return remain;
}
</script>
Kandiya
24-Feb-15 23:33pm
View
It happend accidentally. Here insertion of data is done to a table in the Linked Server NESTIT-319-E from the DB Server NESTIT-327.
declare @sql nvarchar(1000)='SET IDENTITY_INSERT dbo.EMPMASTER ON
INSERT INTO [NESTIT-319-E].test3.dbo.EMPMASTER(
[EmpId],[EmployeeName],[DeptId])
SELECT[EmpId],[EmployeeName],[DeptId]
FROM [NESTIT-327].test1.dbo.EMPMASTER
SET IDENTITY_INSERT dbo.EMPMASTER OFF'
EXEC sp_executesql @sql
Kandiya
24-Feb-15 8:18am
View
I have admin privileges to do these. But still getting the error:
Cannot find the object "dbo.EMPMASTER" because it does not exist or you do not have permissions.
Kandiya
10-Feb-15 8:19am
View
I am doing an Archival of data based on Archival date from original DB to another DB for Archival. The Archival server is Linked Server.The Issue comes on insertion on tables with identity insert ON.
Archival Script is as follows:
-- exec [DIB_ARCHIVE] 'DIBARCHIVETEST','DIBWPS_ARCHIVE_DB_ITT','05-10-2010'
CREATE PROCEDURE [dbo].[DIB_ARCHIVE1]
(
@LIVEDB NVarchar(100)
, @ARCHIVEDB Varchar(100)
, @ArchiveDate VARCHAR(10)
, @ArchiveAgeDate VARCHAR(10)
)
AS
DECLARE @TableName Varchar(200)
Declare @DateField Varchar(50)
Declare @TableType char(1)
Declare @STRIDENTITY NVarchar(4000)
Declare @STRINSERT NVarchar(4000)
Declare @STRDELETE NVarchar(4000)
declare @ColumnList varchar(MAX)
declare @STRUSE Nvarchar(100)
declare @DISABLECONSTRAINT Nvarchar(1000) declare @ENABLECONSTRAINT Nvarchar(1000) Declare @Archive_LogID INT Declare @NumRowsChanged INT
SET @DISABLECONSTRAINT=@LIVEDB+'.dbo.sp_MSforeachtable @command1="ALTER TABLE ? NOCHECK CONSTRAINT ALL"'
EXECUTE sp_executesql @DISABLECONSTRAINT SET @DISABLECONSTRAINT=@ARCHIVEDB+'.dbo.sp_MSforeachtable @command1="ALTER TABLE ? NOCHECK CONSTRAINT ALL"'
EXECUTE sp_executesql @DISABLECONSTRAINT
SET XACT_ABORT ON
set @STRUSE='USE '+@LIVEDB
EXECUTE sp_executesql @STRUSE
---Archive LOg-------------
INSERT INTO Archive_Log (LiveDBName,ArchivalDBName,Archival_Date,ArchivalStartTime)
VALUES (@LIVEDB,@ARCHIVEDB,getdate(),getdate())
SET @Archive_LogID= SCOPE_IDENTITY() ---Archive LOg-------------
BEGIN TRY
BEGIN TRAN
IF CURSOR_STATUS('global','ARCHIVE')>=-1
BEGIN
DEALLOCATE ARCHIVE
END
DECLARE ARCHIVE CURSOR FOR SELECT TableName,DateField,TableType FROM dbo.Archive_config OPEN ARCHIVE fetch next from ARCHIVE into @TableName, @DateField,@TableType
WHILE @@FETCH_STATUS = 0
BEGIN
SET @STRIDENTITY=''
set @ColumnList=''
set @STRINSERT=''
--**********SQL to SET IDENTITY_INSERT ON**********--
IF Exists (select 1 from sys.all_columns c INNER JOIN sys.tables t ON t.object_id = c.object_id
WHERE is_identity = 1 AND t.type = 'U' and Object_name(t.object_id)=@TableName)
SET @STRIDENTITY='SET IDENTITY_INSERT '+ @ARCHIVEDB +'.dbo.'+@TableName + ' ON '
--**********SQL to SET IDENTITY_INSERT ON**********--
IF(@TableType='M') --Master Table
BEGIN
--**********Delete all rows from Master/Meta Table**********--
SET @STRDELETE='delete from '+ @ARCHIVEDB +'.dbo.'+@TableName
EXECUTE sp_executesql @STRDELETE
--**********Delete all rows from Master/Meta Table**********--
---Archive LOg-------------
Kandiya
19-Jan-15 2:17am
View
Both data structure are the same. i want it to work via a SP script. Posted one can work via adding Linked server using the sp_addlinkedserver. I want the same to work without Linked Server.
Kandiya
2-Jan-15 4:06am
View
I want to use Interop dll itself. My code is as follows:
Microsoft.Office.Interop.Excel.Application xla = new Microsoft.Office.Interop.Excel.Application();
Excel.Workbook vb = (Excel.Workbook)(xla.Workbooks._Open(ExcelFilePath, System.Reflection.Missing.Value,
System.Reflection.Missing.Value, System.Reflection.Missing.Value, System.Reflection.Missing.Value,
System.Reflection.Missing.Value, System.Reflection.Missing.Value, System.Reflection.Missing.Value,
System.Reflection.Missing.Value, System.Reflection.Missing.Value, System.Reflection.Missing.Value,
System.Reflection.Missing.Value, System.Reflection.Missing.Value)); // open the existing excel file
int numberOfWorkbooks = xla.Workbooks.Count; // get number of workbooks (optional)
Excel.Worksheet ws = (Excel.Worksheet)xla.Worksheets[1];
xla.Visible = true;
for (int i = 0; i < dt.Rows.Count; i++)
{
ws.Cells[ExcelRowCnt, 1] = dt.Rows[i]["SRNo"].ToString();
ws.Cells[ExcelRowCnt, 2] = dt.Rows[i]["CSDReceivedDate"].ToString();
ws.Cells[ExcelRowCnt, 3] = dt.Rows[i]["UNBBankName"].ToString();
ws.Cells[ExcelRowCnt, 4] = dt.Rows[i]["CustomerName"].ToString();
ws.Cells[ExcelRowCnt, 5] = dt.Rows[i]["Gender"].ToString();
ws.Cells[ExcelRowCnt, 6] = dt.Rows[i]["PolicyNo"].ToString();
ws.Cells[ExcelRowCnt, 7] = dt.Rows[i]["PlanName"].ToString();
ws.Cells[ExcelRowCnt, 8] = dt.Rows[i]["SumAssured"].ToString();
ws.Cells[ExcelRowCnt, 9] = dt.Rows[i]["PolicyTerm"].ToString();
ws.Cells[ExcelRowCnt, 10] = dt.Rows[i]["Currency"].ToString();
ws.Cells[ExcelRowCnt, 11] = dt.Rows[i]["AnnualPremium"].ToString();
ws.Cells[ExcelRowCnt, 12] = dt.Rows[i]["NextPremiumThrough"].ToString();
ws.Cells[ExcelRowCnt, 13] = dt.Rows[i]["CustomerDocuments"].ToString();
ws.Cells[ExcelRowCnt, 14] = dt.Rows[i]["SubmissionDate"].ToString();
ws.Cells[ExcelRowCnt, 15] = dt.Rows[i]["Actions"].ToString();
ws.Cells[ExcelRowCnt, 16] = dt.Rows[i]["Remarks"].ToString();
ws.Cells[ExcelRowCnt, 17] = dt.Rows[i]["Date"].ToString();
ExcelRowCnt = ExcelRowCnt + 1;
}
// CLEAR the Excel Application Objects
//xla.Workbooks.Close();
xla.Quit();
xla = null;
ws = null;
Kandiya
27-Nov-14 4:59am
View
Ya I tried as mentioned above. But here I want to extract the text in the specified area of the image.
Kandiya
24-Nov-14 1:11am
View
The posts were accidental mistakes. But these are actual and is there a solution for the above thread.
Kandiya
10-Nov-14 8:01am
View
I installed the IIS express. How can I test my SignalR app in IIS 7.5 express?
Kandiya
10-Nov-14 6:24am
View
I am using IIS 5.1.
Kandiya
10-Nov-14 6:05am
View
Yes. I am deploying the same to IIS 5.1
Kandiya
3-Nov-14 8:06am
View
I have set as per the second line
<script src="/SignalR/hubs"
But Still while hosting the issue persists.But in Visual Studio 2010 there is no sucvh issue
Kandiya
31-Oct-14 3:35am
View
I didn't saw such. Can u please send an image of the same which you mentioned.
Kandiya
29-Oct-14 6:07am
View
But in the same link the Package Manager Console is obtained via framework 4 or 4.5 only. So how can I make it work in 3.5?.
Kandiya
16-Oct-14 1:45am
View
I am unable to download IBM WEB STUDIO APPLICATION DEVELOPER(WSAD) with various links from google and also from IBM site. Such a product isn't seen. Should I have to download IBM Installation Manager to get WSAD .
Show More