15,898,949 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 sankmahesh (Top 53 by date)
sankmahesh
20-Oct-14 3:17am
View
then how can i export and lock. any application have this ability
sankmahesh
20-Oct-14 3:01am
View
i need to lock particular column only
sankmahesh
25-Aug-14 1:59am
View
yes
sankmahesh
23-Aug-14 8:58am
View
i need hide column in gridview to excel with hide. the above code the gridview hidden column is not coming to excel.
sankmahesh
23-Aug-14 2:29am
View
i try that but not working
sankmahesh
23-Aug-14 1:05am
View
hi Bhati,
Hi all,
I need to export gridview to excel .I am using the following code for the same
Response.ClearContent();
Response.AddHeader(
"content-disposition", "attachment; filename=MyExcelFile.xls");
Response.ContentType =
"application/excel";
StringWriter sw = new StringWriter();
HtmlTextWriter htw = new HtmlTextWriter(sw);
Gridview1.RenderControl(htw);
Response.Write(sw.ToString());
Response.End();
It gets exported from the grid view to the excel.but the excel needs to be protected sheet with the password generated and hide one column from the code.This is for payroll..
Thanks..
sankmahesh
6-Dec-13 23:35pm
View
Deleted
Sorry, i cann't understand "Dead Easy"... what is meaning of dead easy..
pls explain it briefly..
sankmahesh
6-Dec-13 7:32am
View
i updated my code
sankmahesh
6-Dec-13 7:16am
View
LAN
sankmahesh
6-Dec-13 7:16am
View
console application
sankmahesh
17-Nov-13 9:57am
View
http://msdn.microsoft.com/en-us/library/bb220798.aspx
sankmahesh
17-Nov-13 9:55am
View
http://divyen.wordpress.com/2012/06/13/html5-developing-websocket-server-using-c-sharp-dot-net/
sankmahesh
13-Nov-13 23:22pm
View
hi kornfeld!
that's working.
thank you for your solution..
sankmahesh
13-Nov-13 7:41am
View
<td>
<asp:TextBox ID="TextBox2" runat="server">
<asp:Button OnClientClick="showDirectory();" ID="Button4" runat="server" Text="Browse" />
</td>
sankmahesh
13-Nov-13 7:31am
View
<%@ Page Title="" Language="C#" MasterPageFile="~/Main.Master" AutoEventWireup="true" CodeBehind="scheduler.aspx.cs" Inherits="SDMS.WebForm1" %>
<%@ Register assembly="Infragistics4.Web.v13.1, Version=13.1.20131.1012, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb" namespace="Infragistics.Web.UI.LayoutControls" tagprefix="ig" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
<style type="text/css">
.style1
{
width: 100%;
}
</style>
<%-- <script language="javascript">
function showDirectory() {
document.all.TextBox2.value = window.showModalDialog("browseDirectory.aspx", 'jain', "dialogHeight: 560px; dialogWidth: 360px; edge: Raised; center: Yes; help: Yes; resizable: Yes; status: No;");
return false;
}
</script>--%>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<script language="javascript">
function showDirectory() {
document.all.TextBox2.value = window.showModalDialog("browseDirectory.aspx", 'jain', "dialogHeight: 560px; dialogWidth: 360px; edge: Raised; center: Yes; help: Yes; resizable: Yes; status: No;");
// document.getElementById('TextBox2').value = window.showModalDialog("browseDirectory.aspx", 'jain', "dialogHeight: 560px; dialogWidth: 360px; edge: Raised; center: Yes; help: Yes; resizable: Yes; status: No;");
return false;
}
</script>
<div>
<div class="page_title">Scheduler</div>
<ig:WebTab ID="scheduler" runat="server" Height="200px" Width="500px">
<tabs>
<ig:ContentTabItem runat="server" Text="What">
<template>
<ig:ContentTabItem runat="server" Text="Finish">
</div>
sankmahesh
13-Nov-13 7:16am
View
hi
i changed to
document.getElementById('TextBox2').value = window.showModalDialog("browseDirectory.aspx", 'jain', "dialogHeight: 560px; dialogWidth: 360px; edge: Raised; center: Yes; help: Yes; resizable: Yes; status: No;");
but error came again like this,
Line: 112
Error: 'document.getElementById(...)' is null or not an object
sankmahesh
6-Nov-13 5:07am
View
i need to transfer full folder from client to server or server to client
sankmahesh
6-Nov-13 4:47am
View
Thanks..
That works properly
sankmahesh
5-Nov-13 4:01am
View
sorry that links are not open for me..
pls can you provide the proper solution
sankmahesh
5-Nov-13 3:24am
View
thank you for your reply..
i need another solution..
i want to copy two location..
xcopy src desc1 desc2..
is that possible??
sankmahesh
25-Oct-13 5:57am
View
thankyou
sankmahesh
24-Oct-13 5:31am
View
its not working
sankmahesh
24-Oct-13 5:28am
View
it is posible for hard code.
http://www.codeproject.com/Articles/21895/Directory-Browsing-in-ASP-Net-2-0
but it's not working..
so only i ask again
sankmahesh
24-Oct-13 5:16am
View
thanks,
i need browse folder dialog
sankmahesh
24-Oct-13 5:15am
View
Deleted
thanks,i need browse folder dialog.
sankmahesh
22-Oct-13 2:41am
View
any other solution
sankmahesh
22-Oct-13 2:41am
View
sorry no rights for me
sankmahesh
22-Oct-13 2:32am
View
Setting environment for using Microsoft Visual Studio 2010 x86 tools.
c:\Program Files\Microsoft Visual Studio 10.0\VC>devenv/setup
Microsoft (R) Visual Studio Version 10.0.30319.1.
Copyright (C) Microsoft Corp. All rights reserved.
The operation could not be completed. The requested operation requires elevation
.
c:\Program Files\Microsoft Visual Studio 10.0\VC>
that is my result
sankmahesh
22-Oct-13 2:22am
View
That build successfully
sankmahesh
22-Oct-13 2:17am
View
i try the steps.
it returns error "there are no components in 'Fullpath\servercontrol.dll' that can be placed on the toolbox." like this.
i mistake i do.
can you explain me.
sankmahesh
22-Oct-13 1:47am
View
i created server control and build.
how do i add the server control in tool box?
sankmahesh
21-Oct-13 0:22am
View
thankyou ranjan.
i want to convert the web application to server control.
the above link has converted the label to server label.
i need web form that contains more controls to server controls.
can you help me..
sankmahesh
16-Oct-13 6:31am
View
Thankyou ranukamadushan,
I want table with data.
in your comment i load all table and again i fetch data from DataBase.
it's possible for single fetch from DataBase
sankmahesh
16-Oct-13 5:20am
View
Thankyou ranukamadushan,
i already work that...
but i dont know what are the tables available the database..
when i select any database from webconfig then automatically load all table. i mainly need the table name.
sankmahesh
16-Oct-13 5:19am
View
Thankyou Thomas,
i already work that...
but i dont know what are the tables available the database..
when i select any database from webconfig then automatically load all table. i mainly need the table name.
sankmahesh
16-Oct-13 4:16am
View
I want to load in DropDownList all tables from specified DataBase?
my Code given below
da = new SqlDataAdapter("SELECT * FROM Emp_Details", SqlCon);
da1 = new SqlDataAdapter("SELECT * FROM Prod_Details", SqlCon);
da.Fill(ds, "Emp_Details");
da1.Fill(ds, "Prod_Details");
foreach (DataTable Dtta in ds.Tables)
{
ddlConfig.Items.Add(Dtta.TableName);
}
in here i loaded 2 specified tables only.
i want to load all Tables
sankmahesh
16-Oct-13 4:16am
View
I want to load in DropDownList all tables from specified DataBase?
my Code given below
da = new SqlDataAdapter("SELECT * FROM Emp_Details", SqlCon);
da1 = new SqlDataAdapter("SELECT * FROM Prod_Details", SqlCon);
da.Fill(ds, "Emp_Details");
da1.Fill(ds, "Prod_Details");
foreach (DataTable Dtta in ds.Tables)
{
ddlConfig.Items.Add(Dtta.TableName);
}
in here i loaded 2 specified tables only.
i want to load all Tables
sankmahesh
11-Oct-13 3:30am
View
i reduced
sankmahesh
11-Oct-13 3:23am
View
sorry!
i posted for quick understand!
sankmahesh
11-Oct-13 2:47am
View
Deleted
Again Result,
$$$$
Untitled document
Ketcher 07251311012D 1 1.00000 0.00000 0
49 54 0 0 0 999 V2000
-0.8660 -0.7500 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
M END
> <Project Code>
P-185
> <department>
Medicinal Chemistry
> <client name="">
Sunbio
> <compound code="">
SUN-00-Ref 1
> <compound type="" (final,="" intermediate,="" fragment,="" library,="" etc)="">
Final
> <appearance>
White solid
> <molecular weight="">
614.202
> <compound registered="" by="">
P00017170
> <Purity by HPLC (%)>
98.84
> <batch number="">
SUN567-ON2451
> <compound registered="" date(mm="" dd="" yyyy)="">
08/08/2013
> <compound state="" (solid,="" liquid,="" semisolid)="">
Solid
> <scaffold information="">
SUN-SS-NVP
> <storage location="" (bangalore="" hyderabad)="">
Bangalore
> <batch prepared="" date(mm="" dd="" yyyy)="">
12/13/2013
> <batch prepared="" by="">
P00017170
> <analytical data="" (complies="" decline)="">
Complies
> <clogp>
3.920
> <tpsa>
101.870
>
Synthesized
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head><title>
Home Page
</title>
<link href="ig_res/Default/ig_shared.css" type="text/css" rel="stylesheet" />
<link href="ig_res/Default/ig_dataGrid.css" type="text/css" rel="stylesheet" /><link href="Styles/Site.css" rel="stylesheet" type="text/css" />
<style id="igStyles" type="text/css">
.igede12b8d{display:none;}
</style>
</head>
<body>
<form method="post" action="Default.aspx" id="ctl01">
<div class="aspNetHidden">
<input type="hidden" name="__EVENTTARGET" id="__EVENTTARGET" value="" />
<input type="hidden" name="__EVENTARGUMENT" id="__EVENTARGUMENT" value="" />
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUKLTgxMzM3MDkwNw8WAh4GZHRMaXN0MuFSAAEAAAD/////AQAAAAAAA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ution,
i added just the below code,
public override void VerifyRenderingInServerForm(Control control)
{
/* Confirms that an HtmlForm control is rendered for the specified ASP.NET
server control at run time. */
}
result came...
thank for your cooperaion
sankmahesh
27-Sep-13 0:23am
View
HttpException was unhandled by usercode
------------------------------------------
"Control 'GridView1' of type 'GridView' must be placed inside a form tag with runat=server." error returns the below line
GridView1.RenderControl(hw);
sankmahesh
27-Sep-13 0:02am
View
this is my program.
sankmahesh
26-Sep-13 12:46pm
View
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
OleDbConnection con = new OleDbConnection ("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=G:/Guna Sankari Documents/WebSite2/db1.accdb") ;
string Query2 = "select * from tblfiles" ;
OleDbDataAdapter da;
DataSet ds=new DataSet();
DataTable dtb;
con.Open() ;
da = new OleDbDataAdapter(Query2, con) ;
da.Fill(ds);
con.Close() ;
dtb = ds.Tables[0] ;
GridView1.DataSource = dtb ;
GridView1.DataBind();
}
}
protected string GetUrl(string imagepath)
{
string[] splits = Request.Url.AbsoluteUri.Split('/');
if (splits.Length >= 2)
{
string url = splits[0] + "//";
for (int i = 2; i < splits.Length - 1; i++)
{
removed += splits[i];
removed += "/";
}
return removed + imagepath;
}
return imagepath;
}
private void Excel_Export()
{
Response.Clear();
Response.Buffer = true;
Response.AddHeader("removed-disremoved", "attachment;filename=GridViewExport.xls");
Response.Charset = "";
Response.ContentType = "application/vnd.ms-excel";
StringWriter sw = new StringWriter();
HtmlTextWriter hw = new HtmlTextWriter(sw);
GridView1.AllowPaging = false;
GridView1.DataBind();
for (int i = 0; i < GridView1.Rows.Count; i++)
{
GridViewRow row = GridView1.Rows[i];
row.Attributes.Add("class", "textmode");
}
GridView1.RenderControl(hw);
string style = @"<style> .textmode { mso-number-format:\@; } </style>";
Response.Write(style);
Response.Output.Write(sw.ToString());
Response.Flush();
Response.End();
}
static DataTable GetData()
{
DataTable table = new DataTable();
table.Columns.Add("ID", typeof(string));
table.Columns.Add("FileName", typeof(string));
//table.Columns.Add("Location", typeof(string));
table.Columns.Add("Image");
table.Rows.Add("JP", "XXX", "http://localhost/images/fir.png");
table.Rows.Add("HP", "TTT", "http://localhost/images/sec.png");
table.Rows.Add("SQ", "YYY", "http://localhost/images/thr.png");
table.Rows.Add("XS", "EEE", "http://localhost/images/fur.png");
return table;
}
protected void Button1_Click(object sender, EventArgs e)
{
Excel_Export();
}
}
<pre lang="xml"><asp:GridView ID="GridView1" runat="server" AutoGenerateColumns = "False"
Font-Names = "Arial" >
<Columns>
<asp:BoundField DataField = "ID" HeaderText = "ID"
ItemStyle-Height = "150" />
<asp:BoundField DataField = "FileName" HeaderText = "Image Name"
ItemStyle-Height = "150" />
<asp:TemplateField ItemStyle-Height = "150" ItemStyle-Width = "170">
<ItemTemplate>
<asp:Image ID="Image1" runat="server"
ImageUrl = '<%# Eval("FilePath", GetUrl("{0}")) %>' />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView></pre>
ID1 ID FileName FilePath
1 1 Image images/fir.png
2 2 Img2 images/sec.png
sankmahesh
26-Sep-13 10:02am
View
msotristate savewithDocument value = ?
sankmahesh
26-Sep-13 8:30am
View
msoTrue , msoScaleFromTopLeft are returning error. so please give the above code in C# format
sankmahesh
26-Sep-13 8:28am
View
plz give me the C# code format..
sankmahesh
23-Sep-13 5:06am
View
Sorry. I have a textbox with name txtempname. the focus comes on the textbox then employee details datagrid shows and click on the datagrid the datas set to the related textboxs. designation column value set to txtempdesign and depart colum value set to txtdepart. So i need focus automatically set to datagrid when the focus comes on txtempname.
sankmahesh
21-Sep-13 5:04am
View
if i am using dropdown list then the dropdown list has one field only. i need more than one field from database. so i use dropdown list for refer all data for particular data textbox. so i need the focus goes to datagrid when the cursor focus in textbox
sankmahesh
21-Sep-13 5:00am
View
yes. like as dropdownlist.
sankmahesh
21-Sep-13 5:00am
View
yes. like as dropdownlist.
sankmahesh
21-Sep-13 4:53am
View
i mean the cursor focus to textbox then the datagrid shows and focus goes to datagrid
Show More