15,912,507 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 benzimen (Top 31 by date)
benzimen
24-Jan-15 8:32am
View
Thank you
benzimen
24-Jan-15 8:26am
View
ok.....how to rectifyed it?
benzimen
24-Jan-15 8:19am
View
sir...i mean if my VS working properly or not...dont think in another way recently i launced my vs in system so is it my fault or not i dont know..and iam not good in english
benzimen
24-Jan-15 8:13am
View
you are also not getting split()
benzimen
24-Jan-15 8:09am
View
intelligance does not show split()
var txt1values = txt1.
benzimen
24-Jan-15 8:09am
View
Deleted
intelligance does not show split()
var txt1values = txt1.
benzimen
24-Jan-15 7:55am
View
<asp:TextBox ID="txt1" TextMode="MultiLine" runat="server">
benzimen
24-Jan-15 7:50am
View
thanks for u r reply..i have one doubt what it is in javascript we get any control value with the help of document.getelementbtid("txt1").value;
but you are not mentioned...
benzimen
22-Jan-15 5:37am
View
sake of performance issue...
benzimen
1-Jan-15 5:29am
View
Deleted
Thankyou Tadit Dash
benzimen
1-Jan-15 2:56am
View
Exactly ...not only textboxes and label including Gridview also
benzimen
29-Dec-14 4:45am
View
in which event i have write this foreach
loop?
benzimen
29-Dec-14 4:41am
View
where can i call this foreach loop?
i mean in all textbox _ontextchanged events?
benzimen
29-Dec-14 4:36am
View
its is webform and using asp textbox control
benzimen
24-Dec-14 7:18am
View
if (fup1.HasFile)
{
filename = Path.GetFileName(fup1.PostedFile.FileName);
string extension = Path.GetExtension(fup1.PostedFile.FileName);
string folderpath=ConfigurationManager.AppSettings["folderpath"];
string filepath=Server.MapPath(folderpath+filename);
fup1.SaveAs(filepath);
if(extension==".xls")
con=new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + filepath + ";Extended Properties=\"Excel 8.0;HDR=Yes;IMEX=2\"");
else if(extension==".xlsx")
con=new OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + filepath + ";Extended Properties='Excel 12.0;HDR=YES;IMEX=1;';");
con.Open();
OleDbCommand cmd = new OleDbCommand();
OleDbDataAdapter da = new OleDbDataAdapter();
cmd.Connection = con;
cmd.CommandType = CommandType.Text;
cmd.CommandText = "select * from [Sheet1$]";
da = new OleDbDataAdapter(cmd);
con.Close();
ds = new DataSet();
da.Fill(ds);
if (ds.Tables[0].Rows.Count > 0)
{
Session["dataset"] = ds;
btndup.Visible = true;
}
}
}
protected void btndup_Click(object sender, EventArgs e)
{
DataSet ds = (DataSet)Session["dataset"];
DataTable dt = ds.Tables[0];
dt = removeduplicates(dt, "Website URL");
//DataSet ds1 = new DataSet();
//ds1.Tables.Add(dt);
exporttoexcel(dt);
}
public DataTable removeduplicates(DataTable dtable, string colname)
{
Hashtable ht = new Hashtable();
ArrayList al = new ArrayList();
foreach (DataRow row in dtable.Rows)
{
if (ht.Contains(row[colname]))
al.Add(row);
else
ht.Add(row[colname], string.Empty);
}
foreach (DataRow row in al)
dtable.Rows.Remove(row);
return dtable;
}
public void exporttoexcel(DataTable dt)
{
Excel.Application excelapp=new Excel.Application();
Excel.Workbook excelwork = excelapp.Workbooks.Open(@"D:\Excel.xlsx");
foreach(DataTable dt1 in ds.Tables)
{
Excel.Worksheet wshee = new Excel.Worksheet();
wshee.Name=dt.TableName;
for (int i = 1; i < dt.Columns.Count + 1; i++)
{
wshee.Cells[1, i] = dt.Columns[i - 1].ColumnName;
}
for (int j = 0; j < dt.Rows.Count; j++)
{
for (int k = 0; k < dt.Columns.Count; k++)
{
wshee.Cells[j + 2, k + 1] = dt.Rows[j].ItemArray[k].ToString();
}
}
excelwork.Save();
excelwork.Close();
excelapp.Quit();
benzimen
24-Dec-14 6:00am
View
hi damith..i got an error..pls help me
where it it when i add worksheet to work book it raises error..pls help ..th snippet is
foreach(DataTable dt in ds.Tables)
{
Excel.Worksheet wshee= excelwork.Sheets.Add();//here getting error
wshee.Name=dt.TableName;
for (int i = 1; i < dt.Columns.Count + 1; i++)
{
wshee.Cells[1, i] = dt.Columns[i - 1].ColumnName;
}
benzimen
24-Dec-14 5:58am
View
hi damith..i got an error..pls help me
where it it when i add worksheet to work book it raises error..pls help ..th snippet is
foreach(DataTable dt in ds.Tables)
{
Excel.Worksheet wshee= excelwork.Sheets.Add();//here getting error
wshee.Name=dt.TableName;
for (int i = 1; i < dt.Columns.Count + 1; i++)
{
wshee.Cells[1, i] = dt.Columns[i - 1].ColumnName;
}
benzimen
24-Dec-14 0:28am
View
sinisa thankyou very much for u r response
benzimen
24-Dec-14 0:27am
View
Thanks praveen for u r valuble suggistion.i think this is right way after getting the excel file to remove duplicates...thankyou very much
benzimen
24-Dec-14 0:26am
View
Thnaks DamithSL..i will do in your way
benzimen
23-Dec-14 8:37am
View
DamithSl..i dont know how to start this...so pls give me tips how to do it...
benzimen
23-Dec-14 8:29am
View
Name Contacts
Mark 1234567891
Luois 9848598485
Mark 1234567891
i want to delete the Mark and Contact
benzimen
23-Dec-14 8:28am
View
Name Contacts
Mark 1234567891
Luois 9848598485
Mark 1234567891
i want to delete the Mark and Contact
benzimen
23-Dec-14 8:09am
View
praveen,that is not my requirement.even i enter one field also i get the Data from DB.this is my task.
benzimen
23-Dec-14 0:25am
View
no.even one field is matches also we get the data
benzimen
19-Dec-14 0:20am
View
Thanks for u reply.but it is not my requirement.when i press the Edit button in Gridview that values will be added to out side of Gridview. values should be append to Textboxes.
benzimen
18-Dec-14 23:59pm
View
Deleted
Thanks for u reply.but it is not my requirement.when i press the Edit button in Gridview that values will be added to out side of Gridview. values should be append to Textboxes.
benzimen
1-Dec-14 8:32am
View
can u give me
brief explanation....
benzimen
25-Nov-14 7:11am
View
iam very beginner.so can u pls demonistrate how to write the function?pls
benzimen
25-Nov-14 2:17am
View
even in this process also we write so much code for every event handler.
benzimen
22-Nov-14 7:46am
View
Thank you for your reply.but in my Table i have only Date column,there is no column for Month.Here i will display the month names based upon the Date.how can i do it?
give me reply.
Show More