KushMishra 38 Senior Technical Lead

Thank you adatapost many times you've helped me but I don't know how to thank you...You simply rock and there's no match of you over Daniweb...Thanks again :)

KushMishra 38 Senior Technical Lead

Sorry adatapost for being so rude but unfortunately I have a very short span of time left and I have no idea how to do this all.

Hope you understand and please help me also.

Thanks in advance.

KushMishra 38 Senior Technical Lead

Please help me someone its really urgent...

Thank you very much(in advance)

KushMishra 38 Senior Technical Lead

Thanks very much adatapost, its working for now but a new problem has arisen that I want to retrieve the news and their corresponding headlines from a database and my question is that how can I make such a page in which the links of headlines (in Hindi) open their corresponding news(in Hindi) ?

Please give some source codes as it is a matter of urgency else I would not have asked for the full source codes.Please do something to help me.

Thank you very much(in advance)

KushMishra 38 Senior Technical Lead

Hello To All,

Its very very urgent...
I want a page in which the daily news should come(IN HINDI) and there are two conditions:

1. On the first page there must be only the headings and a brief introduction about each news(ALL IN HINDI).

2. Secondly, on clicking on the links(which are in Hindi), the page redirects to the corresponding page which contains the whole news.

Please tell me the best and quickest way because it is a matter of great urgency.

Thank you all and May God bless you all.

KushMishra 38 Senior Technical Lead

That's perfectly fine with me because in the end you provided me an awesome logical answer.
Thanks again.

KushMishra 38 Senior Technical Lead

Thank you very much happygeek and I am really happy that you've given a straight forward suggestion leading to the correct path.
I would like to tell you that through your kind reply, I've got my appropriate answer however this answer could be given ages ago or a question like Ancient Dragon asked could have been asked that time only but anyways I've got my answer.
Thanks again.

KushMishra 38 Senior Technical Lead

Thanks Ancient Dragon, I really appreciate your kind concern towards my last post and I would definitely look forward to the point mentioned by you.
The abbreviations were Knowledge Process Outsourcing(KPO), Business Process Outsourcing(BPO),HCL(Hindustan Computers Limited--A 5$ Billion Indian Corporate Sector Which Is Also Known For Its Information Technology Sector) and Bachelor Of Technology(B.Tech.).

So, now I hope everyone got some information on these terms and I will look forward to a relevant, quick and a logical reply related to the question I asked at the top.

KushMishra 38 Senior Technical Lead

Thank you very much for no answer to an urgent question and I am really happy.

KushMishra 38 Senior Technical Lead

Is there nobody to answer my question ???

KushMishra 38 Senior Technical Lead

Hello,

I just wanted to know that does a KPO experience counts in an IT industry of developers and programmers.
I was placed in my college in HCL BPO and I worked there for 4 months just to learn some new things and communication standards but I left that company as I've done B.Tech. in Computer Science And Engineering in 2010 and it was not of my interest.
I've done ASP.Net with C# and developed my own college website using that.I also know C and C++.
I searched for jobs but didn't get any.
Now I've been placed in another company iYogi but a KPO this time.
So, I just wanted to know that whether it is better to join a KPO or should I continue searching for jobs.
Please reply as soon as possible as it is a matter of my career.

Thank you very much in advance.

KushMishra 38 Senior Technical Lead

Hello, I got your problem and may be it is a simple one if you could please check the "Validated To" field in the properties.

KushMishra 38 Senior Technical Lead

Hi, I am eager to help you for this and you just need to paste in the code in which you're facing the problem...
Thanks.

KushMishra 38 Senior Technical Lead

Hello Dee, In my point of view .Net should be preferred because its a new technology and obviously a new technology comes with some new enhancements and .Net provides you the security,robustness,reliability and faster web pages although I don't know much about PHP but still its very obvious to think that why most of the programmers have switched to .Net from PHP.
There may be many articles on the Internet and its just like a question : Whether you want to eat an orange or an apple?
What does it matter to you if you're getting something to eat and the major point is that you're not empty stomach after eating either of the two fruits i.e., your same work is done with both of the technologies.So, decision is yours whether you choose an old language or a new one.
Hope that helps.
Thanks.

KushMishra 38 Senior Technical Lead

Hello,

There's a little code you've forgotten to add in the Default.master....
After belowContentInfo, you've not added bottomFooter...So after </div> just try to add the following code...

<div id="bottom" class="clearfix">
        <div class="wrapper clearfix">
            <asp:ContentPlaceHolder ID="bottomFooter" runat="server">
            <!--THIS WAS MISSING-->
            </asp:ContentPlaceHolder>
        </div>
    </div>

And one more thing is that under the belowContent in the Default.master the class should be "wrapper clearfix" instead of "wrapper clear" as it does not exist...

KushMishra 38 Senior Technical Lead

Great...thank you very much for your kind advice...and I've found the solution to my confusion...

KushMishra 38 Senior Technical Lead

Hello, gppuddinpie I think you are facing the problem of adding your new web page in the master page....So, please post the xhtml code of both the master page and the new web page so that it would become easier to solve your problem as quickly as possible.

KushMishra 38 Senior Technical Lead

Thanks for your kind and quick reply Ancient Dragon..That was a great help..However, another query of mine is I am confused that whether I should begin with the C++ basics only or should I try learning C# first because C# is a new language, so what should I do first?

KushMishra 38 Senior Technical Lead

Hello fuston05, AndreRet is correct and in my point of view, it would be better for you to opt for a certified course that is known as MCSD (Microsoft Certified Solutions Developer) which is only for the Microsoft products like .Net.

With this certificate you can get the jobs more easily.Hope that helps.

KushMishra 38 Senior Technical Lead

Hello,

I am really confused and not able to make decision about how to begin learning programming languages.
I've done C,C++ and 2 projects of ASP.Net with C#.
But, now I've forgotten most of the concepts of C++(like constructors,structures,classes and even the basic programs like Fibonacci series and other tricky programs) and I am confused that whether I should begin with the C++ basics only or should I try learning C#?

I am in a great confusion.Any relevant help would be very highly honored.Please provide me the best E-Books,learning material or something like that which would help me learning these languages and kindly inform me how to begin from the start.

Thanks in advance.

KushMishra 38 Senior Technical Lead

are you sure that

allow users="?"

....I think it should be

deny users="?"
KushMishra 38 Senior Technical Lead

Hi there....,saw ur post and found that the same problem was faced by me too and the solution to such a problem is as follows...

protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        if (e.CommandName == "cmd")
        {
            string filename=e.CommandArgument.ToString();
            string path=MapPath("~/PDF FOLDER IN WEBSITE/" + filename);
            byte []bts=System.IO.File.ReadAllBytes(path);

            Response.Clear();
            Response.ClearHeaders();

            Response.AddHeader("Content-Type", "Application/pdf");
            Response.AddHeader("Content-Length",bts.Length.ToString());
            Response.AddHeader("Content-Disposition","attachment; filename=" + filename);
            Response.BinaryWrite(bts);
            Response.Flush();
            Response.End();
        }
    }
KushMishra 38 Senior Technical Lead

Hello,

Actually you're facing a very common problem in SQL.........My opinion to you is that you should replace the spaces by "CamelCasing" or just by "Underscores"......If you're using a datagrid or gridview etc. to display those items,just go to their properties and write in the "AlternateDataString" column or something likewise........
Hope this helps ya.......

KushMishra 38 Senior Technical Lead

Server=ServerName\theInstanceName;Database=myDataBase;Trusted_Connection=True;

For "Server" go to Sql management studio and copy the whole thing like......KM\\SQLEXPRESS........but remember to write it as KM\SQLSERVER in the Server....Hope this helps....

KushMishra 38 Senior Technical Lead

Are you using the C# code behind as well ????.......If yes then plz check the MakerID coloumn name in that.........

KushMishra 38 Senior Technical Lead

Thanks dnanetwork......the last reply of yours worked.....You're indeed a genius....Thanks again...

KushMishra 38 Senior Technical Lead

still facing the same prob.....

KushMishra 38 Senior Technical Lead

Hi guys,

I've recently developed a gridview with edit,delete and update panel.....
All is working fine except the Update button.....the error shown is......

[B]Object reference not set to an instance of an object.[/B]
Source Error:

Line 48:         GridView1.EditIndex = -1;
Line 49:         conn.Open();
Line 50:         SqlCommand cmd = new SqlCommand("update Info set Name=''" + Namet.Text + "'',Username=''" + Usernamet.Text + "'',Email=''" + Emailt.Text + "'',Contact=''" + Contactt.Text + "'',Address=''" + Addresst.Text + "'',Country=''" + Countryt.Text + "'',Password=''" + Passwordt.Text + "'' where UserID=" + UserIDl.Text + "", conn);
Line 51:         cmd.ExecuteNonQuery();
Line 52:         conn.Close();

It's showing error in the sqlcommand method (Line 50)

It's really urgent guys so please help me out of this....

My full codes are as follows.......

UpdateUsers.aspx

<%@ Page Language="C#" MasterPageFile="~/Admin-IMKM/KMAdmin.master" AutoEventWireup="true"
    CodeFile="UpdateUsers.aspx.cs" Inherits="Admin_IMKM_UpdateUsers" %>

<asp:Content ID="KMContent1" ContentPlaceHolderID="KMAdminCPH" runat="server">
    <table cellpadding="0" cellspacing="0" align="center">
        <tr>
            <td align="center">
                <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="false" AllowSorting="True"
                    AutoGenerateDeleteButton="True" AutoGenerateEditButton="True" OnRowEditing="GridView1_RowEditing"
                    OnRowCancelingEdit="GridView1_RowCancelingEdit" OnRowUpdating="GridView1_RowUpdating"
                    OnRowDeleting="GridView1_RowDeleting" BackColor="#FF8080" BorderColor="SaddleBrown"
                    BorderStyle="None" CellPadding="4" ForeColor="#333333" GridLines="None" PageSize="5">
                    <Columns>
                        <asp:TemplateField HeaderText="User ID">
                            <ItemTemplate>
                                <asp:Label ID="UserIDl" runat="server" Text='<%#Eval("UserID")%>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Name">
                            <ItemTemplate>
                                <%#Eval("Name")%></ItemTemplate>
                            <EditItemTemplate>
                                <asp:TextBox ID="EditNamet" runat="server" Text='<%#Eval("Name") %>'></asp:TextBox>
                            </EditItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Username">
                            <ItemTemplate>
                                <%#Eval("Username")%></ItemTemplate>
                            <EditItemTemplate>
                                <asp:TextBox ID="EditUsernamet" runat="server" Text='<%#Eval("Username") %>'></asp:TextBox>
                            </EditItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Email">
                            <ItemTemplate>
                                <%#Eval("Email")%></ItemTemplate>
                            <EditItemTemplate>
                                <asp:TextBox ID="EditEmailt" runat="server" Text='<%#Eval("Email") %>'></asp:TextBox>
                            </EditItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Contact">
                            <ItemTemplate>
                                <%#Eval("Contact")%></ItemTemplate>
                            <EditItemTemplate>
                                <asp:TextBox ID="EditContactt" runat="server" Text='<%#Eval("Contact") %>'></asp:TextBox>
                            </EditItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Address">
                            <ItemTemplate>
                                <%#Eval("Address")%></ItemTemplate>
                            <EditItemTemplate>
                                <asp:TextBox ID="EditAddresst" runat="server" Text='<%#Eval("Address") %>'></asp:TextBox>
                            </EditItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Country">
                            <ItemTemplate>
                                <%#Eval("Country")%></ItemTemplate>
                            <EditItemTemplate>
                                <asp:TextBox ID="EditCountryt" runat="server" Text='<%#Eval("Country") %>'></asp:TextBox>
                            </EditItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Password">
                            <ItemTemplate>
                                <%#Eval("Password")%></ItemTemplate> …
kvprajapati commented: Please do not email or PM forum staff with your support questions. -2
KushMishra 38 Senior Technical Lead

sql server 2005.......table name is "Info"..........table field is "Username"...and it is a dropdown list....plz reply as soon as possible.....

KushMishra 38 Senior Technical Lead

your code's working fine but I'm facing a new prob....

In the database, the values are deleted (this should happen).But at the runtime of my application dropdown list shows double values including the one which I've deleted.

For Example........
If entries in dropdown list are.....
KM499
KK499
Kush
Microsoft etc.

And if I delete KK499 then result comes as follows....
KM499
KK499
Kush
Microsoft
KM499
KK499
Kush
Microsoft

What should I do for this...please help me.......

Thanks in advance............

KushMishra 38 Senior Technical Lead

Hello guys,

I am asking a very simple thing to be done in my project (May be I've forgotten the syntax).........

I've taken a drop-down list in which diff. user-names are coming and added a delete button to delete the full row which contains the selected drop-down list user-name.

I've written the code as............

SqlConnection con2 = new SqlConnection(ConfigurationManager.ConnectionStrings["KMCon"].ToString());
SqlCommand cmd2 = new SqlCommand("delete * from Info where Username=[B]???????[/B], con2);
con2.Open();
cmd2.ExecuteNonQuery();
con2.Close();

What and how should be the syntax to write in the ???????

Thanks in advance........

KushMishra 38 Senior Technical Lead

Actually I'm askin how to add multiple content types in a single Response.Headers() ???????

KushMishra 38 Senior Technical Lead

Hello to all,

I've written this thread because I want to know the different content types used like.................

Response.AddHeader("Content-Type", "Application/octet-stream");

It was used for software and It was successful........But what for Music,Pictures and E-Books ???????????

Thanks in advance...........

KushMishra 38 Senior Technical Lead

I must say that you're a total genius for me bro...This was the only problem that I was facing for many days and because of you I've found my solution and the end of my project too....May u get whatever you need........Thanks a lot man........

KushMishra 38 Senior Technical Lead

Its for a single file i.e., test.zip.......But I'm getting a list of software stuff from the database into the gridview........How can I code for every file????

KushMishra 38 Senior Technical Lead

Error coming as..........

'System.Web.HttpResponse' does not contain a definition for 'ClearHeader' and no extension method 'ClearHeader' accepting a first argument of type 'System.Web.HttpResponse' could be found (are you missing a using directive or an assembly reference?)
KushMishra 38 Senior Technical Lead

If I'm not wrong then I think You've missed the con.open();

Hope this helps........

KushMishra 38 Senior Technical Lead

May be you should go for the form authentication in asp.net

Here's a demo code for you.......

</configSections> // after this in your web.config add the following.
<appSettings/>
<connectionStrings>
<add name="KMCon" connectionString="initial catalog=KM; data source=DEVELOPER\SQLEXPRESS; Integrated Security=SSPI"/>
</connectionStrings>

And give location path which you want to be accessed by all (including your Images,CSS,Javascipt etc. folders also for their proper working)...........

<location path="Pics.aspx">
    <system.web>
      <authorization>
        <allow users="*"/>
      </authorization>
    </system.web>
  </location>
  <location path="Reg.aspx">
    <system.web>
      <authorization>
        <allow users="*"/>
      </authorization>
    </system.web>
  </location>

Now add the following code for which you want a resticted and secure access..........

</compilation> // after this in your web.config add the following.
<authentication mode="Forms">
<forms loginUrl="Admin-IMKM/AdminLogin.aspx" defaultUrl="Admin/WelcomeAdmin.aspx"></forms>
</authentication>

Hope this helps ya........

KushMishra 38 Senior Technical Lead

Hello to all,

I've designed a website to provide Software and all the data is coming into the gridview.The entries in database are......

SoftName : Name of the software

SoftType : Type of the software (like windows,mac etc.)

SoftUrl : Path of the software file in the website
(It is a folder "Soft")

Now I want to add a download link into the gridview that'll make the user to download directly my software from the Gridview.

Thanks in advance.......

KushMishra 38 Senior Technical Lead

Thanks for your kind and quick response.

Can you also tell me how to make a download link for the Songs retrieved in gridview......

KushMishra 38 Senior Technical Lead

Again facing the same problem.
Here's my complete code........

<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="Pics.aspx.cs" Inherits="Pics" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<table cellpadding="0" cellspacing="0" align="center">
<tr>
<td align="center">
<div align="center">
<asp:GridView ID="Picg" runat="server" Width="700px" Height="650px" AutoGenerateColumns="False"
BorderWidth="1px" BackColor="White" CellPadding="3" BorderStyle="None" BorderColor="#CCCCCC"
Font-Names="Arial">
<FooterStyle ForeColor="#000066" BackColor="White"></FooterStyle>
<PagerStyle ForeColor="#000066" HorizontalAlign="Left" BackColor="White"></PagerStyle>
<HeaderStyle ForeColor="White" Font-Bold="True" BackColor="#006699"></HeaderStyle>
<Columns>
<asp:BoundField DataField="PicID" HeaderText="ID" />
<asp:BoundField DataField="PicName" HeaderText="Name" />
<asp:BoundField DataField="PicCategory" HeaderText="Category" />
<asp:TemplateField HeaderText="Image">
<ItemTemplate>
<asp:Image ID="Image1" runat="server" ImageAlign="Middle" ImageUrl='<%# (string) FormatImageUrl( (string) Eval("PicUrl")) %>' Height="100px" Width="100px" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:LinkButton ID="DownloadPicl" runat="server" Text="Download" PostBackUrl='<%# Eval("PicUrl","~/{0}") %>'>
</asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
</Columns>
<SelectedRowStyle ForeColor="White" Font-Bold="True" BackColor="#669999"></SelectedRowStyle>
<RowStyle ForeColor="#000066"></RowStyle>
</asp:GridView>
</div>
</td>
</tr>
</table>
</asp:Content>

And here's the c# code...........

using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.SqlClient;

public partial class Pics : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["KMCon"].ToString());
SqlDataAdapter da = new SqlDataAdapter("select PicID,PicName,PicCategory,PicUrl from Pics order by PicName", con);
DataSet ds = new DataSet();
da.Fill(ds);
Picg.DataSource = ds;
Picg.DataBind(); 
}
protected string FormatImageUrl(string url)
{
if (url != null && url.Length > 0)
return ("~/" + url);
else return null;
}
}
KushMishra 38 Senior Technical Lead

Sorry adatapost, It's showing the same error again.......

KushMishra 38 Senior Technical Lead

I've recently used the following code in Pics.aspx........

<asp:TemplateField>
<ItemTemplate>
<asp:LinkButton ID="DownloadPicl" runat="server" Text="Download" PostBackUrl='<%# (string) FormatImageUrl1( (string) Eval("PicUrl")) %>'>
</asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>

And in Pics.cs, I've used.........

protected string FormatImageUrl1(string url1)
{
if (url1 != null && url1.Length > 0)
return ("~/" + url1);
else return null;
}

And the error is as follows...........

The HTTP verb POST used to access path '/KMWorld/Pictures/fatmanpolarbear.jpg' is not allowed.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Web.HttpException: The HTTP verb POST used to access path '/KMWorld/Pictures/fatmanpolarbear.jpg' is not allowed.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[HttpException (0x80004005): The HTTP verb POST used to access path '/KMWorld/Pictures/fatmanpolarbear.jpg' is not allowed.]
   System.Web.DefaultHttpHandler.BeginProcessRequest(HttpContext context, AsyncCallback callback, Object state)
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +3391004
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +161
KushMishra 38 Senior Technical Lead

Sorry to all experts but I'm still unable to find an appropriate solution.
If anyone who knows how to resolve my problem then show your kind response as soon as possible.......

KushMishra 38 Senior Technical Lead

actually I don't know how to do it all.........I've taken a button field here's the .aspx code.......

<asp:TemplateField HeaderText="Download Link">
<ItemTemplate>
<asp:Button ID="DownloadPicb" runat="server" Text="Download" OnClick="DownloadPicb_OnClick" />
</ItemTemplate>
</asp:TemplateField>

and I'm asking what to write in.........

protected void DownloadPicb_OnClick(object sender, EventArgs e)
{
        ??????? 
}

Hope you'll make a quick reply as earlier.

Thanks.

KushMishra 38 Senior Technical Lead

Hello guys,
I'm a newbie to asp.net....I've recently designed a website in which I've taken a gridview control and added a button in the itemtemplate field of the gridview........What I want is that if anyone clicks on this button then the data in the particular row of the gridview comes for the download to user (like open,save etc.).....please make your response as soon as possible.
Thanks in advance.