16,004,782 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 .NET 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 dineshdena (Top 33 by date)
dineshdena
5-Jul-13 2:36am
View
Hello thanq for your reply i find the query for that but i want it in linq will you please help me out thanks in advance.
select year(CreatedAt),count(MemberID) from Members
where ID = 1
group by year(CreatedAt)
dineshdena
5-Jul-13 1:44am
View
im having the company started at 2001 and i want to calculate the total members who are all added to my company on every year. so 2001,2002,2003 years in want to show like year1,year2,year3 and the count of members at 2001 as year1(count) and 2001 as year2(count)
dineshdena
26-Dec-12 2:16am
View
Im having one checkbox and link (i agree the terms)in register page. on clicking the link im populating the popup with terms&condition text in that i have one button (I agree) if i click iagree button in popup i want to check the checkbox in my register page.
dineshdena
26-Dec-12 2:10am
View
My checkbox is on page not in popup
dineshdena
18-Oct-12 0:08am
View
Error means in that code its highlighting some parts in green and while i try to run the page is goes on loading page is not getting opened
dineshdena
9-Aug-12 6:40am
View
Deleted
im a beginner i did this in page load. when ever the page get load it will check the database date and it will act on it.i know it is stupid way.i heard that there is one way doing this in sql server. so only im asking here i u know plz guide me...
dineshdena
2-Jun-12 3:52am
View
no sir its showing error like same.... actually in that code eid value is get from empno... but i dnt where we giving that empno value????
dineshdena
16-May-12 7:41am
View
actually im not getting any error.......while i click update its just loading and i have label in the bottom there its showing ur data is updated....but in database its not get updated........
dineshdena
15-May-12 9:40am
View
thanku sir its solved but its showing another error //Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index// will u plz help me
dineshdena
14-May-12 22:50pm
View
I tried like this by showing all the datas in gridview and from gridview im getting the data row by row and putting in textbox by using text box im taking the to address from that textbox.My problem is when i click the button only one data from the gridview is detected in textbox and mail sent to that mailid in textbox.how to get next next datas from gridview i used for look i dnt weather its right r not plz help me...(in this the textbox and gridview are not visible)
con.Open();
SqlCommand cmd = new SqlCommand("select * from emailsubscribe", con);
SqlDataAdapter ada = new SqlDataAdapter(cmd);
DataTable dt = new DataTable();
ada.Fill(dt);
if (dt.Rows.Count > 0)
{
for (i = 0; i < dt.Rows.Count; i++)
{
TextBox1.Text = GridView1.Rows[0].Cells[1].Text.ToString();
StringBuilder sb = new StringBuilder();
MailMessage message = new MailMessage();
message.From = new MailAddress(TextBox1.Text);
message.To.Add(new MailAddress(TextBox1.Text));
message.Subject = "mail subscribe";
message.Body = "welcome";
message.IsBodyHtml = true;
try
{
SmtpClient client = new SmtpClient();
client.Host = "smtp.gmail.com";
client.Port = 587;
client.EnableSsl = true;
NetworkCredential credential = new NetworkCredential("id@gmail.com", "password");
client.Credentials = credential;
client.Send(message);
}
catch (Exception ex)
{
Label1.Text = ex.Message;
}
}
dineshdena
14-May-12 22:50pm
View
I tried like this by showing all the datas in gridview and from gridview im getting the data row by row and putting in textbox by using text box im taking the to address from that textbox.My problem is when i click the button only one data from the gridview is detected in textbox and mail sent to that mailid in textbox.how to get next next datas from gridview i used for look i dnt weather its right r not plz help me...(in this the textbox and gridview are not visible)
con.Open();
SqlCommand cmd = new SqlCommand("select * from emailsubscribe", con);
SqlDataAdapter ada = new SqlDataAdapter(cmd);
DataTable dt = new DataTable();
ada.Fill(dt);
if (dt.Rows.Count > 0)
{
for (i = 0; i < dt.Rows.Count; i++)
{
TextBox1.Text = GridView1.Rows[0].Cells[1].Text.ToString();
StringBuilder sb = new StringBuilder();
MailMessage message = new MailMessage();
message.From = new MailAddress(TextBox1.Text);
message.To.Add(new MailAddress(TextBox1.Text));
message.Subject = "mail subscribe";
message.Body = "welcome";
message.IsBodyHtml = true;
try
{
SmtpClient client = new SmtpClient();
client.Host = "smtp.gmail.com";
client.Port = 587;
client.EnableSsl = true;
NetworkCredential credential = new NetworkCredential("id@gmail.com", "password");
client.Credentials = credential;
client.Send(message);
}
catch (Exception ex)
{
Label1.Text = ex.Message;
}
}
dineshdena
14-May-12 22:49pm
View
I tried like this by showing all the datas in gridview and from gridview im getting the data row by row and putting in textbox by using text box im taking the to address from that textbox.My problem is when i click the button only one data from the gridview is detected in textbox and mail sent to that mailid in textbox.how to get next next datas from gridview i used for look i dnt weather its right r not plz help me...(in this the textbox and gridview are not visible)
con.Open();
SqlCommand cmd = new SqlCommand("select * from emailsubscribe", con);
SqlDataAdapter ada = new SqlDataAdapter(cmd);
DataTable dt = new DataTable();
ada.Fill(dt);
if (dt.Rows.Count > 0)
{
for (i = 0; i < dt.Rows.Count; i++)
{
TextBox1.Text = GridView1.Rows[0].Cells[1].Text.ToString();
StringBuilder sb = new StringBuilder();
MailMessage message = new MailMessage();
message.From = new MailAddress(TextBox1.Text);
message.To.Add(new MailAddress(TextBox1.Text));
message.Subject = "mail subscribe";
message.Body = "welcome";
message.IsBodyHtml = true;
try
{
SmtpClient client = new SmtpClient();
client.Host = "smtp.gmail.com";
client.Port = 587;
client.EnableSsl = true;
NetworkCredential credential = new NetworkCredential("id@gmail.com", "password");
client.Credentials = credential;
client.Send(message);
}
catch (Exception ex)
{
Label1.Text = ex.Message;
}
}
dineshdena
14-May-12 13:38pm
View
hi,
In this code i tried edit,update,delete except update every thing is working the update also not showing any error while running its just loading.but not update data into database.plz any one help.
dineshdena
12-May-12 1:36am
View
SqlDataAdapter add = new SqlDataAdapter(s11, c.getcon()); will u plz tell me whAT c.getcon where u have decl that c??? and this line ///arra = new string[ds2.Tables[0].Rows.Count];/// showing error. i declare arra as int is it correct
dineshdena
11-May-12 23:48pm
View
will u plz provide code for that im a begginer i dnt have much knowledge in this
dineshdena
10-May-12 6:56am
View
will u plz explain me i tried like this but it showing error
protected void change(object sender, GridViewSelectEventArgs e)
{
if (GridView1.Rows[e.NewSelectedIndex].Cells[3].Text == "Active")
{
TextBox txtAddress1 = (TextBox)GridView1.Rows[e.NewSelectedIndex].Cells[3].Text("Inactive");
}
}
dineshdena
5-May-12 7:48am
View
in my first page i have 3 dropdown used to search in database in that if the search button clicked it will searching regarding to the dropdown selected items and show detail regarding to that search in database (detail : is one column in database)it will show in gridview along with link button. if i click the link button it should be get redirected with the details of the selected row from database.
dineshdena
30-Apr-12 5:52am
View
You have called smtp.Send(mm); before the PDF object has been created./// whats the solution for this???????
dineshdena
30-Apr-12 5:32am
View
ya any thing wrong sir
dineshdena
30-Apr-12 3:42am
View
hi,
ur link is very helpfull to solve the prob.but im facing another problem(( there was an error opening this document.the file is damaged and could not be repaired)) when i open the email attachment pdf file its showing like this.what to do??? plz help me out
dineshdena
27-Apr-12 0:20am
View
thanku Mr.sandeep :)
dineshdena
20-Apr-12 1:08am
View
ok sry
dineshdena
20-Apr-12 1:08am
View
ok sry
dineshdena
20-Apr-12 0:35am
View
sir,
actually the pdf is generated dinamicaly when the client fill the quotation form in that how we give the pdf path(in client system me cant set the path). :(
plz help me.
dineshdena
19-Apr-12 1:43am
View
thanku for ur advice (you are kidding me right) i google it but i cant able to get the clear idea... i think some professionals may be in this site to explain me.
dineshdena
10-Apr-12 9:29am
View
i get solved the above problem by using EnableEventValidation = "false" in my design page
but now im facing another problem the page is getting created in pdf but in that pdf some dropdown box r shown in $$$$ symbol and other symbol how to get solve this prob
dineshdena
10-Apr-12 8:20am
View
sir,
i tried the above code but get error like this
RegisterForEventValidation can only be called during Render();
and its pointing this area
this.Page.RenderControl(hw);
how to solve this plz help me.
thanks in advance
dineshdena
9-Apr-12 1:15am
View
thanku sir its realy helped me thanku...
dineshdena
8-Apr-12 22:09pm
View
if i need to update the value in the textbox to database means how to do sir
dineshdena
8-Apr-12 21:47pm
View
great sir its working perfectly thanku thanku thanku
dineshdena
24-Mar-12 5:39am
View
Deleted
sir i tried ur code but it showing error like this(Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index)will u plz help me
private void UpdateProduct(int a, string b, string c, string d, string f, int g)
{
try
{
string constr = @"Server=KARTHIKA-PC\\SQLEXPRESS;Database=quotation;Integrated Security=true";
string query = "UPDATE tbladminreg SET Name = @b, Address1 = @c,Address2 = @d,Country = @f,Pincode = @g WHERE id = @a";
SqlConnection con2 = new SqlConnection(constr);
SqlCommand com2 = new SqlCommand(query, con2);
//com2.Parameters.Add("@a", SqlDbType.Int).Value = id;
com2.Parameters.Add("@b", SqlDbType.NVarChar).Value = txtName;
com2.Parameters.Add("@c", SqlDbType.NVarChar).Value = txtAddress1;
com2.Parameters.Add("@d", SqlDbType.NVarChar).Value = txtAddress2;
com2.Parameters.Add("@f", SqlDbType.NVarChar).Value = txtCountry;
com2.Parameters.Add("@g", SqlDbType.Int).Value = txtPincode;
con2.Open();
com2.ExecuteNonQuery();
con2.Close();
GridView1.EditIndex = -1;
GridView1.DataBind();
//BindData();
}
catch (Exception ex)
{
throw ex;
}
}
protected void update(object sender, GridViewUpdateEventArgs e)
{
GridViewRow row = GridView1.Rows[e.RowIndex];
TextBox txtid = (TextBox)row.FindControl("txtid");
TextBox txtName = (TextBox)row.FindControl("txtName");
TextBox txtAddress1 = (TextBox)row.FindControl("txtAddress2");
TextBox txtAddress2 = (TextBox)row.FindControl("txtAddress2");
TextBox txtCountry = (TextBox)row.FindControl("txtCountry");
TextBox txtPincode = (TextBox)row.FindControl("txtPincode");
int a = Int32.Parse(GridView1.DataKeys[e.RowIndex].Value.ToString());
string b = txtName.Text;
string c = txtAddress1.Text;
string d = txtAddress2.Text;
string f = txtCountry.Text;
int g = Int32.Parse(txtPincode.Text.ToString());
UpdateProduct(a, b, c, d, f, g);
}
dineshdena
24-Mar-12 1:40am
View
i tried this code but im getting error anyone plz help me
void BindGrid()
{
SqlDataAdapter add = new SqlDataAdapter("select Total from tblQuotationreg",con);
DataTable dt = new DataTable();
add.Fill(dt);
GridView1.Columns[6].FooterText = (from row in dt.AsEnumerable()select row.Field<int>("Total")).Sum().ToString();
GridView1.DataSource = dt;
GridView1.DataBind();
}
its showing error::
error points here:::(select row.Field<int>("Total"))
error is:::Specified cast is not valid.
dineshdena
22-Mar-12 10:42am
View
yes i want to sum the column values in gridview
Show More