15,748,615 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 Javascript questions
View C++ questions
View Python questions
View Java 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 Merajuddin Ansari (Top 46 by date)
Merajuddin Ansari
17-May-19 5:50am
View
i tried [__i class="@Html.Raw(Model[i].Icon)"__] , not working.from yesterday i am in problem please help me out.
Merajuddin Ansari
26-Dec-17 0:44am
View
i have the same problem, is this solve the problem..?
Merajuddin Ansari
26-Dec-17 0:39am
View
i have the same problem can anyone help me please..
Merajuddin Ansari
21-Dec-17 5:34am
View
i will try this..
Merajuddin Ansari
21-Dec-17 5:11am
View
i think so..if i will change the location it will work..?
Merajuddin Ansari
13-Dec-17 1:34am
View
This below code solved my problem..thank you
<system.web.extensions>
<scripting>
<webservices>
<jsonSerialization maxJsonLength="819200000" />
Merajuddin Ansari
6-Dec-17 3:05am
View
error: The requested name is valid, but no data of the requested type was found
Merajuddin Ansari
12-Oct-16 3:47am
View
i have done something like this.is this ok.?
declare @day_att table (UserID INT,signtime DATETIME,status CHAR(1))
declare @hrs table (_hours float)
insert into @day_att(UserID,signtime,status) select empno,signtime,status from EmpAtt where empno = 248 and atdate = '2016-09-27' order by signtime
insert into @hrs(_hours) select CAST(DATEDIFF(MINUTE,I.signtime,O.signtime)/60.0 AS float) [Hours]
FROM @day_att I OUTER APPLY (SELECT TOP 1 signtime,status FROM @day_att t WHERE t.UserID = I.UserID AND t.signtime > I.signtime ORDER BY t.signtime) O
WHERE I.status = 'I' AND O.status = 'O'
select sum(_hours) as totalHrs from @hrs
Merajuddin Ansari
12-Oct-16 1:43am
View
what about to use Cursor.?
Merajuddin Ansari
21-Feb-16 8:00am
View
no..if i do !IsPostBack then on autopostback no textbox will be created.
http://stackoverflow.com/questions/9495175/update-dynamically-created-textbox-in-c-sharp-and-asp-net
http://stackoverflow.com/questions/14327729/asp-net-change-update-dynamically-created-textbox
Merajuddin Ansari
14-Feb-16 1:39am
View
thank you
Merajuddin Ansari
14-Feb-16 1:25am
View
i want something like for ex:
say string is : Field1 - Field2
so i need result as:
Field1 and Filed2
Merajuddin Ansari
7-Dec-15 5:02am
View
popup - https://www.dropbox.com/s/xv7eta442w7hks0/it.png?dl=0
C#
-------------------
protected void btnShowDialog_Click(object sender, EventArgs e)
{
string url = "http://xyz.com/HRSystem/IT/ItTaskMonitoring.aspx";
int rowCount = gvTaskMonitoring.Rows.Count;
string height = (rowCount*30).ToString();
string width = HttpContext.Current.Request.Params["clientScreenWidth"];
ClientScript.RegisterStartupScript(GetType(), "hwa", "popup('" + url + "', '" + width + "', '" + height + "');", true);
}
----------------
aspx code
<input type="hidden" value="" name="clientScreenHeight" id="clientScreenHeight" />
<input type="hidden" value="" name="clientScreenWidth" id="clientScreenWidth" />
-------------------
JavaScript code.
<script type="text/javascript">
$(document).ready(function () {
$("#clientScreenWidth").val($(window).width());
$("#clientScreenHeight").val($(window).height());
});
function popup(url, width, height)
{
window.open(url, "_blank", "toolbar=no, dialog=yes, scrollbars=no, resizable=no, width=" + width + ", height=" + height + "");
}
</script>
--------------
Merajuddin Ansari
6-Dec-15 8:06am
View
<script type="text/javascript">
function popup(url, width, height)
{
window.open(url, "_blank", "toolbar=no, dialog=yes, scrollbars=no, resizable=no, width=" + width + ", height=" + height + "");
}
</script>
Merajuddin Ansari
6-Dec-15 6:31am
View
in the popup i am showing gridview so want the size of popup should automatically increase and decrease when there is row addition and deletion in the gridview.
Merajuddin Ansari
6-Dec-15 4:15am
View
path is correct because it was working before normal, when i added "<script src="https://code.jquery.com/jquery-1.9.1.min.js"></script>" in some other page which does not include master page.. then after error is coming even though i remove this "<script src="https://code.jquery.com/jquery-1.9.1.min.js"></script>" ..
i don't know why .. pls help
Merajuddin Ansari
6-Dec-15 3:59am
View
ie 11.
it's only not working in localhost.but it's working when i deploy on server
Merajuddin Ansari
6-Dec-15 3:57am
View
ie 11.
it's only not working in localhost.but it's working when i deploy on server
Merajuddin Ansari
6-Dec-15 3:14am
View
i am facing same problem can you please help me.
Merajuddin Ansari
28-Oct-15 0:51am
View
now problem solved.thanks for your reply.it's working fine now. after replacing using System.Data.Objects; with using System.Data.Entity.Core.Objects and adding the reference System.Data.Entity.dll.
Merajuddin Ansari
12-Aug-15 3:48am
View
it's showing successful only but its not copying like images and Report Definition files(.rdlc).
Merajuddin Ansari
23-Jul-15 4:49am
View
Had to change CausesValidation property of my commandButton to false.
and it's working fine.
thank you for your help.
Merajuddin Ansari
15-Jul-15 3:50am
View
I am doing same.
status.ForeColor = System.Drawing.Color.Red;
but still getting same error.
Merajuddin Ansari
15-Jul-15 3:28am
View
same error:-
'string' does not contain a definition for 'ForeColor' and no extension method 'ForeColor' accepting a first argument of type 'string' could be found (are you missing a using directive or an assembly reference?)
Merajuddin Ansari
8-Jul-15 7:58am
View
Try to write code by yourself.No one will give you full code.
And your Question is also not in detail.Please improve your question.
Merajuddin Ansari
1-Jul-15 8:14am
View
can you please tell me the alternative of this.?
Merajuddin Ansari
1-Jul-15 8:12am
View
thanks it hepled me.
Merajuddin Ansari
29-Jun-15 3:06am
View
thanks giri it helped me out.
Merajuddin Ansari
28-Jun-15 8:56am
View
I have one TabContainer inside that i have added 3 tabs and each tab contains different different GridView. So i want to save GridView data to the Database.
Merajuddin Ansari
27-Jun-15 2:55am
View
Thanks a lot all of you for guiding me.
Merajuddin Ansari
22-Jun-15 6:41am
View
I want to pass Array as Parameter in StoredProcedur.
Example:
INSERT INTO table_name (column1,column2,column3,...) VALUES (value1,value2,value3,...)
I want to pass columns and values as array in StoredProcedure.
Merajuddin Ansari
18-Jun-15 7:45am
View
required little bit modification.
SqlConnection con1;
public DataSet fnSelectQuery(string query, SqlParameter[] sqlParams)
{
try
{
using (con1)
{
con1.Open();
var cmd = new SqlCommand(query, con1);
if (sqlParams != null)
{
foreach (SqlParameter para in sqlParams)
{
if(para != null)
cmd.Parameters.Add(para);
}
}
using (var sda = new SqlDataAdapter())
{
sda.SelectCommand = cmd;
using (DataSet ds = new DataSet())
{
sda.Fill(ds);
con1.Close();
return ds;
}
}
}
}
catch (Exception ex)
{
throw new Exception(ex.Message);
}
}
}
and to pass the parameters
----------------------------
SqlParameter[] parametr =
{
new SqlParameter("@testcol1", SqlDbType.VarChar, 50) { Value = testcol1.ToString() },
new SqlParameter("@testcol2", SqlDbType.VarChar, 50) { Value = testcol2.ToString() }
};
ddl.DataSource = sq.fnSelectQuery("SELECT [test] FROM [testtable] where testcol1 = @testCol1 and testcol2 = @testCol2", "hrms", parametr);
ddl.DataTextField = "test";
ddl.DataValueField = "test";
ddl.DataBind();
Merajuddin Ansari
18-Jun-15 4:07am
View
can please tell me how to pass value for params IDataParameter[] sqlParams while calling function (SelectQuery).?
Merajuddin Ansari
10-Jun-15 5:50am
View
i want to say sorry for my mistake.
Merajuddin Ansari
10-Jun-15 5:44am
View
by mistake i rejected peter.
Merajuddin Ansari
10-Jun-15 4:05am
View
thanks it helped me.
Merajuddin Ansari
8-Jun-15 3:10am
View
thank you very much..
but strCols should be separated from comma.
like col1,col2,col3,....coln
Merajuddin Ansari
8-Jun-15 2:41am
View
Thank you.
ALTER PROCEDURE [dbo].[proc_test]
@cols nvarchar (20),
@tablename nvarchar(250)
AS
Exec('SELECT * FROM ' + @tablename)
-- how can i pass cols to above select statement.
Merajuddin Ansari
8-Jun-15 2:32am
View
yes
Merajuddin Ansari
8-Jun-15 2:10am
View
Can you please give an example for that.?
Merajuddin Ansari
8-Jun-15 1:55am
View
Yes i want to pass array of columns to the sql stored procedure.
Merajuddin Ansari
4-Jun-15 4:20am
View
I have already created GridView Dynamically but the problem is when i click on edit button GridView is not coming in editable mode.
here is the code:-
Hrcon cn = new Hrcon();
gridDt = new DataTable();
gv = new GridView();
/*Grid View Style*/
gv.HeaderStyle.CssClass = "header";
gv.RowStyle.CssClass = "rowstyle";
gv.BorderColor = System.Drawing.Color.Green;
gv.BorderWidth = 1;
gv.BackColor = System.Drawing.Color.Silver;
gv.RowStyle.BorderColor = System.Drawing.Color.White;
gv.RowStyle.BorderStyle = BorderStyle.Ridge;
gv.HeaderStyle.BorderStyle = BorderStyle.Ridge;
gv.AlternatingRowStyle.BackColor = System.Drawing.Color.Tan;
gv.EmptyDataText = "No data available.";
gv.ShowHeaderWhenEmpty = true;
gv.HeaderStyle.Width = 100;
gv.CellPadding = 5;
gv.CellSpacing = 10;
//gv.RowStyle.HorizontalAlign = HorizontalAlign.Center;
//gv.HeaderStyle.HorizontalAlign = HorizontalAlign.Center;
//gv.ItemStyle.HorizontalAlign = "Right";
gv.AutoGenerateColumns = false;
//gv.HeaderStyle.Font.Bold = true;
/*End*/
/*Add Columns to the Grid*/
for (int i = 0; i < gridDt.Columns.Count; i++)
{
AddGridColumns(gridDt.Columns[i].ToString());
}
/*End*/
/*Get the fields from DataBase Table*/
using (SqlConnection con = cn.HRMSCon())
{
con.Open();
SqlCommand cmd = new SqlCommand("SELECT TOP 5 [FORMID], [FIELDID], [FIELDNAME], [EDESCN], [ADESCN], [TYPE] from FORMDETAILS", con);
SqlDataAdapter da = new SqlDataAdapter(cmd);
da.Fill(gridDt);
gv.DataSource = gridDt;
con.Close();
con.Dispose();
}
/*End*/
/*Bind the grid*/
for (int i = 0; i < gridDt.Columns.Count; i++)
{
BindGrid(i);
}
/*End*/
gv.DataSource = gridDt;
//gv.AutoGenerateEditButton = true;
CommandField cf = new CommandField();
cf.ButtonType = ButtonType.Button;
//cf.ShowDeleteButton = true;
cf.ShowEditButton = true;
cf.ShowCancelButton = true;
gv.RowEditing += new GridViewEditEventHandler(OnRowEditing);
gv.RowUpdating += new GridViewUpdateEventHandler(abc);
gv.Columns.Add(cf);
gv.DataBind();
Label lblText = new Label();
lblText.Text = "Grid " + j;
lblText.ForeColor = System.Drawing.Color.Red;
lblText.Style.Add("font-weight", "bold");
lblText.Style.Add("font-size", "17px");
lblText.Style.Add("align", "center");
tbcDynamic.Tabs[j].Controls.Add(lblText);
tbcDynamic.Tabs[j].Controls.Add(gv);
}
tbcDynamic.CssClass = "MyTabStyle";
PlaceHolder1.Controls.Add(tbcDynamic);
}
protected void OnRowEditing(object sender, GridViewEditEventArgs e)
{
gv.EditIndex = e.NewEditIndex;
gv.DataBind();
//Session["SelecetdRowIndex"] = e.NewEditIndex;
//GridView gv = (GridView)sender;
//gv.EditIndex = e.NewEditIndex;
}
protected void abc(object sender, GridViewUpdateEventArgs e)
{
Response.Write(e.RowIndex);
}
Merajuddin Ansari
4-Jun-15 4:04am
View
But no edit and delete option here.
http://www.c-sharpcorner.com/uploadfile/Shawpnendu/dynamically-creating-bound-and-template-columns-in-gridview-using-Asp-Net/[^]
Merajuddin Ansari
25-May-15 7:04am
View
I tried it's not working and using .Net Frame Work version 4.5.
Merajuddin Ansari
11-May-15 2:35am
View
any link which help me to start.?
Merajuddin Ansari
11-May-15 2:25am
View
to do this how much time is needed, if there is two programmers.
Show More