15,918,889 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 Member 10234093 (Top 53 by date)
Member 10234093
3-Feb-14 2:30am
View
below is my code
Default.aspx
<table cellpadding="3" cellspacing="3" border="3" style="width:100%" align="center">
<tr>
<td align="left" colspan="2">
<asp:LinkButton ID="lnk" runat="server" Text="Back" PostBackUrl="~/Dash.aspx">
</td></tr>
<tr>
<td align="center">
<asp:GridView ID="GridView1" runat="server" GridLines="Horizontal" AllowPaging="true"
ShowFooter="True" CellPadding="3" CellSpacing="3" BorderColor="ActiveBorder"
Width="1076px"
AutoGenerateSelectButton="True"
onselectedindexchanged="GridView1_SelectedIndexChanged" onpageindexchanging="GridView1_PageIndexChanging1"
>
<columns>
<asp:TemplateField>
<HeaderTemplate>
<asp:CheckBox ID="chkAll" runat="server" onclick = "checkAll(this)" />
</HeaderTemplate>
<itemtemplate>
<asp:CheckBox ID="CheckBox1" runat="server" onclick = "Check_Click(this)" />
<alternatingrowstyle backcolor="White">
<editrowstyle backcolor="#efefef">
<HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
<PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
<rowstyle backcolor="#EFF3FB">
<SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
</td>
</tr></table>
<table>
<tr>
<td>
<asp:Button ID="Button1" runat="server" Text="Export to Excel"
onclick="Button1_Click" />
</td>
</tr>
</table>
Default.aspx.cs
protected void Button1_Click(object sender, EventArgs e)
{
Response.Clear();
Response.Buffer = true;
Response.AddHeader("content-disposition",
"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();
GridView1.HeaderRow.Style.Add("background-color", "#FFFFFF");
GridView1.HeaderRow.Cells[0].Visible = false;
GridView1.HeaderRow.Cells[1].Style.Add("background-color", "green");
GridView1.HeaderRow.Cells[2].Style.Add("background-color", "green");
GridView1.HeaderRow.Cells[3].Style.Add("background-color", "green");
// GridView1.HeaderRow.Cells[4].Style.Add("background-color", "green");
if (ViewState["CheckBoxArray"] != null)
{
ArrayList CheckBoxArray = (ArrayList)ViewState["CheckBoxArray"];
string checkAllIndex = "chkAll-" + GridView1.PageIndex;
int rowIdx = 0;
for (int i = 0; i < GridView1.Rows.Count; i++)
{
GridViewRow row = GridView1.Rows[i];
row.Visible = false;
if (row.RowType == DataControlRowType.DataRow)
{
if (CheckBoxArray.IndexOf(i + 1) != -1)
{
row.Visible = true;
row.BackColor = System.Drawing.Color.White;
row.Cells[0].Visible = false;
row.Attributes.Add("class", "textmode");
if (rowIdx % 2 != 0)
{
row.Cells[1].Style.Add("background-color", "#C2D69B");
row.Cells[2].Style.Add("background-color", "#C2D69B");
row.Cells[3].Style.Add("background-color", "#C2D69B");
row.Cells[4
Member 10234093
24-Jan-14 4:40am
View
it goes to home page
Member 10234093
22-Jan-14 6:34am
View
Ya."Logout.aspx" page is available.I am inheriting the master page into "incident2.aspx" page.
Member 10234093
22-Jan-14 6:33am
View
still not working
Member 10234093
16-Jan-14 6:51am
View
Thank u too
Member 10234093
16-Jan-14 6:42am
View
Thanks.I got it.
Member 10234093
3-Jan-14 4:25am
View
thanks
Member 10234093
3-Jan-14 2:04am
View
I have already added drop down list in edititem template.If we click edit link button drop down is not displaying the selected value.
Member 10234093
27-Dec-13 2:00am
View
It is not showing excel report based on entered incident number
Member 10234093
23-Dec-13 2:23am
View
Ya.I tried this.It showing "Object reference not set to instance of an object" during when break point comes under line "string incident=(string) Session["Incidentgv"];"
Member 10234093
23-Dec-13 2:20am
View
total number of rows
Member 10234093
23-Dec-13 2:20am
View
Not passing the total rows count value (ie) 20 into other .aspx page.
Member 10234093
19-Dec-13 2:13am
View
I am having few pages.Suppose if i create a new user they will see only particular pages only.How it can be done
Member 10234093
12-Dec-13 7:51am
View
Thanks.i got it.
Member 10234093
12-Dec-13 1:42am
View
ok :)
Member 10234093
12-Dec-13 1:40am
View
To select multiple items in listbox
Member 10234093
12-Dec-13 1:40am
View
Thank you so much.Now it's working
Member 10234093
12-Dec-13 1:12am
View
But selecteditems option is not available.
Member 10234093
12-Dec-13 0:50am
View
Thanks a lot.But one more issue is there.suppose if we are selecting multiple items in listbox foreach loop is getting only the first selected items from listbox.others are not displaying in table.
Member 10234093
12-Dec-13 0:33am
View
I have debugged the code.Arguments that are passed in SP is 4 only.In code behind also only 4 arguments.Maybe in foreach loop there is some mistake.Could you plz clarify this.
Member 10234093
12-Dec-13 0:28am
View
sry.It is sampledata1 only.But still i am getting that error.I think in foreach loop it is mistake.Can u plz help me
Member 10234093
11-Dec-13 5:51am
View
Suppose if i want to check only user name the error message "Invalid credentials" is ok?Suppose if i entered wrong user name and correct password above error message "Invalid Credentials" is ok?
Member 10234093
11-Dec-13 5:25am
View
yes.
Member 10234093
9-Dec-13 6:26am
View
I have developed ordinary c# .net web application.Now i want to convert this one into mobile.How can i do this.Plz help me.
Member 10234093
9-Dec-13 2:01am
View
If we execute the above sp is it shown error in screen itself?
Member 10234093
9-Dec-13 2:00am
View
hai karthik.Below is the code i have changed.Can u plz check this.It's too long :)
CREATE procedure [dbo].[InsertProblemdata1]
(
@problemnumber int,
@linkedincidents varchar(50),
@linkedbugs varchar(50),
@publishtopartner varchar(50),
@impactscale varchar
(50),
@primaryimpactedarea varchar(50),
@secondaryimpactedarea varchar(50),
@impactedentity varchar
(50),
@impacttype varchar(50),
@percentimpact int,
@title varchar(50),
@description varchar(50),
@problemreported datetime,
@rcastatus varchar(50),
@rcastatusdetails varchar(50),
@rcaclosetime datetime
)
AS
BEGIN TRY
INSERT INTO Problem(ProblemNumber,LinkedIncidents,LinkedBugs,PublishToPartner,ImpactScale,PrimaryImpactedArea,SecondaryImpactedArea,ImpactedEntity,ImpactType,PercentImpact,Title,Description,ProblemReported,RCAStatus,RCAStatusDetails,RCACloseTime)
values
(
@problemnumber ,
@linkedincidents ,
@linkedbugs,
@publishtopartner,
@impactscale
,
@primaryimpactedarea ,
@secondaryimpactedarea ,
@impactedentity
,
@impacttype ,
@percentimpact ,
@title ,
@description ,
@problemreported ,
@rcastatus ,
@rcastatusdetails ,
@rcaclosetime
)
END TRY
BEGIN CATCH
SELECT ERROR_NUMBER() as ERROR_NUMBER,
ERROR_SEVERITY() as ERROR_SEVERITY,
ERROR_STATE() as ERROR_STATE,
ERROR_MESSAGE() as ERROR_MESSAGE
END CATCH
Member 10234093
6-Dec-13 6:51am
View
can u give me a sample code for this
Member 10234093
6-Dec-13 6:46am
View
Another one doubt.How can i assign the roles for admin and users.plz share with me
Member 10234093
6-Dec-13 6:46am
View
thanks
Member 10234093
6-Dec-13 6:25am
View
ok.thank u.I have few more doubts.could you plz help me.
Member 10234093
6-Dec-13 6:21am
View
That property is appearing in hyperlink button.Is this equal to linkbutton?
Member 10234093
6-Dec-13 6:17am
View
sry.that property is not there in link button.
Member 10234093
6-Dec-13 6:14am
View
below is the code i have used in .aspx page.
<asp:LinkButton ID="LinkButton1" runat="server" PostBackUrl="~/dashboard-spy-template.html">Go to Home Page
Member 10234093
4-Dec-13 3:21am
View
sorry for the above code.Below is the right code.
<asp:TemplateField HeaderText="ImpactedEntity">
<itemtemplate>
<asp:Label ID="Label2" runat="server" Text='<%# Eval("ImpactedEntity") %>'>
<edititemtemplate>
<asp:ListBox ID="ListBox3" runat="server" AutoPostBack="True" SelectionMode="Multiple">
Member 10234093
4-Dec-13 3:19am
View
Below is the code:
<asp:TemplateField HeaderText="ImpactedEntity">
<itemtemplate>
<asp:Label ID="Label2" runat="server" Text='<%# Eval("ImpactedEntity") %>'>
<edititemtemplate>
<asp:ListBox ID="ListBox3" runat="server" AutoPostBack="True" SelectionMode="Multiple">
we can't select multiple option in edititemtemplate in listbox
Member 10234093
4-Dec-13 0:04am
View
sure.How can i select multiple values in the listbox inside gridview?
Member 10234093
27-Nov-13 1:12am
View
yes.After write the above code error "DataBinding: 'System.Data.DataRowView' does not contain a property with the name 'BugDescription'" is showing.
Member 10234093
26-Nov-13 5:27am
View
Thanks alot.I think you have missed a line foreach statement before the secondary impacted area.
Member 10234093
26-Nov-13 5:05am
View
not in same row.to be insert into table for selected rows.
ex:If we select 2 options in a listbox we can able to insert those values in two rows.
Member 10234093
26-Nov-13 4:35am
View
Getting error in the below code.
protected void AddRecords_Click(object sender, EventArgs e)
{
string insertText = "INSERT INTO Bug(BugNumber,PublishToPartner,ImpactScale,PrimaryImpactedArea,SecondaryImpactedArea,ImpactedEntity,ImpactType,PercentImpact,Title,Description,DefectDiscovered,ETA,DefectStatus,DefectStatusDetails,DefectCloseTime)values(@bugnumber ,@publishtopartner ,@impactscalee ,@primaryimpactedareaa,@secondaryimpactedarea,@impactedentity ,@impacttype ,@percentimpact ,@title ,@description ,@defectdiscovered ,@eta ,@defectstatus ,@defectstatusdetails ,@defectclosetime )";
string connString = @"Data Source=CDC015;Initial Catalog=Dashboard;User ID=prima;Password=123abcd*";
SqlConnection conn = new SqlConnection(connString);
SqlCommand cmd = new SqlCommand(insertText, conn); conn.Open();
cmd.Parameters.Add("@bugnumber", SqlDbType.VarChar, 50);
cmd.Parameters["@bugnumber"].Value = txtBugNumber.Text;
cmd.Parameters.Add("@description", SqlDbType.VarChar, 50);
cmd.Parameters["@description"].Value = txtBugDescription.Text;
cmd.Parameters.Add("@publishtopartner", SqlDbType.VarChar, 50);
cmd.Parameters["@publishtopartner"].Value = lstPublishToPartner.SelectedItem.Text;
var selected = lstPrimaryImpactedArea.GetSelectedIndices().ToList();
var selectedValues = (from c in selected
select lstPrimaryImpactedArea.Items[c].Text).ToList();
foreach (string value in selectedValues)
{
cmd.Parameters.AddWithValue("@primaryimpactedareaa", value);
}
var selectedd = lstSecondaryImpactedArea.GetSelectedIndices().ToList();
var selectedValuess = (from c in selectedd
select lstSecondaryImpactedArea.Items[c].Text).ToList();
foreach (string values in selectedValuess)
{
cmd.Parameters.AddWithValue("@secondaryimpactedarea", values);
}
cmd.Parameters.AddWithValue("@impactscalee", lstImpactScale.SelectedItem.Text);
cmd.Parameters.AddWithValue("@impactedentity", lstImpactedEntity.SelectedItem.Text);
cmd.Parameters.AddWithValue("@impacttype", lstImpactType.SelectedItem.Text);
cmd.Parameters.Add("@percentimpact", SqlDbType.VarChar, 50);
cmd.Parameters["@percentimpact"].Value = txtPercentImpact.Text;
cmd.Parameters.Add("@title", SqlDbType.VarChar, 50);
cmd.Parameters["@title"].Value = txtTitle.Text;
cmd.Parameters.AddWithValue("@defectdiscovered", DefectdiscoveredCalendar.SelectedDate);
cmd.Parameters.AddWithValue("@eta", ETACalendar.SelectedDate);
cmd.Parameters.AddWithValue("@defectstatus", lstDefectStatus.SelectedItem.Text);
cmd.Parameters.AddWithValue("@defectstatusdetails", txtDefectStatusDetails.Text);
cmd.Parameters.AddWithValue("@defectclosetime", DefectCloseTimeCalendar.SelectedDate);
cmd.ExecuteNonQuery();
lblMessage.Text = "Inserted";
txtBugNumber.Text = string.Empty;
txtBugDescription.Text = string.Empty;
txtDefectStatusDetails.Text = string.Empty;
txtTitle.Text = string.Empty;
txtPercentImpact.Text = string.Empty;
}
In the cmd.executenonquery line i am getting error "The variable name '@primaryimpactedareaa' has already been declared. Variable names must be unique within a query batch or stored procedure.
Must declare the scalar variable "@impactscalee".".Plz help me
Member 10234093
26-Nov-13 2:19am
View
sure.Below is my code to bind data to listbox.
SqlConnection con = new SqlConnection("Data Source=CDC015;Initial Catalog=Dashboard;User ID=prima;Password=123abcd*");
protected void Page_Load(object sender, EventArgs e)
{
// SqlConnection con = new SqlConnection("Data Source=CDC015;Initial Catalog=Dashboard;User ID=prima;Password=123abcd*");
con.Open();
string str = "SELECT System FROM Catalog1";
SqlCommand cmd4 = new SqlCommand(str, con);
SqlDataReader rd = cmd4.ExecuteReader();
while (rd.Read())
{
ListBox1.Items.Add(rd.GetValue(0).ToString());
}
rd.Close();
con.Close();
}
Member 10234093
26-Nov-13 2:06am
View
No.It is not working for single and multiple value.If there is any other method can u plz suggest
Member 10234093
26-Nov-13 1:18am
View
Can u please suggest how can i insert multiple selection list box items into sql table's single column.
Member 10234093
26-Nov-13 1:02am
View
lstPrimaryImpactedArea and lstSecondaryImpactedArea
Member 10234093
26-Nov-13 1:01am
View
Listbox1 name--->Primary Impacted Area
Listbox2 name--->Secondary Impacted Area
Member 10234093
26-Nov-13 0:57am
View
listbox is a toolbox control
Member 10234093
25-Nov-13 1:14am
View
THANKS.SUPPOSE IF WE WANT TO USE IN CSV FORMAT HOW IT CAN BE POSSIBLE
Member 10234093
25-Nov-13 1:10am
View
It is not converting into dd
Member 10234093
22-Nov-13 7:14am
View
below is my dataaccesslayer code.Please provide me help.
SqlCommand dCmd = new SqlCommand("InsertBugsdata", conn);
dCmd.CommandType = CommandType.StoredProcedure;
try
{
dCmd.Parameters.AddWithValue("@bugnumber", bugs.BugNumber);
dCmd.Parameters.AddWithValue("@publishtopartner", bugs.PublishToPartner);
dCmd.Parameters.AddWithValue("@impactscale", bugs.ImpactScale);
dCmd.Parameters.AddWithValue("@primaryimpactedarea", bugs.PrimaryImpactedArea);
dCmd.Parameters.AddWithValue("@secondaryimpactedarea", bugs.SecondaryImpactedArea);
dCmd.Parameters.AddWithValue("@impactedentity", bugs.ImpactedEntity);
dCmd.Parameters.AddWithValue("@impacttype", bugs.ImpactType);
dCmd.Parameters.AddWithValue("@percentimpact", bugs.PercentImpact);
dCmd.Parameters.AddWithValue("@title", bugs.Title);
dCmd.Parameters.AddWithValue("@description", bugs.Description);
dCmd.Parameters.AddWithValue("@defectdiscovered", bugs.DefectDiscovered);
dCmd.Parameters.AddWithValue("@eta", bugs.ETA);
dCmd.Parameters.AddWithValue("@defectstatus", bugs.DefectStatus);
dCmd.Parameters.AddWithValue("@defectstatusdetails", bugs.DefectStatusDetails);
dCmd.Parameters.AddWithValue("@defectclosetime", bugs.DefectCloseTime);
return dCmd.ExecuteNonQuery();
}
catch
{
throw;
}
finally
{
dCmd.Dispose();
conn.Close();
conn.Dispose();
}
Member 10234093
21-Nov-13 23:12pm
View
Thank u too for the solution
Member 10234093
21-Nov-13 23:11pm
View
Thanks
Member 10234093
18-Nov-13 22:53pm
View
yes.I have created the login and registration page
Member 10234093
18-Nov-13 22:52pm
View
web pages in c#
Show More