Thursday, November 26, 2026

Re: [DotNetDevelopment] File.Copy

You need to assign permissions on the directory itself for the said user. I would also make the user(s) also sign in to hit the file. What kind of authentication method are you currently using?

Keidrick Pettaway
Web:
http://www.kpettaway.com
Twitter:
http://twitter.com/kpett
Linkedin:
http://www.linkedin.com/pub/keidrick-pettaway/8/705/b58


From: Jamie Fraser <jamie.fraser@gmail.com>
Date: Wed, 18 Nov 2009 11:25:15 +0000
To: <dotnetdevelopment@googlegroups.com>
Subject: Re: [DotNetDevelopment] File.Copy

IIS runs as a specific user.

That user must have permissions on the file share.

On Tue, Nov 17, 2009 at 11:49 AM, Pratiksha Saxena <pratiksha.saxena@gmail.com> wrote:
Hi,

i have a web application in which on button_click i have written code for File.Copy

 File.Copy(@"e:\Text.txt", @"\\okh-lb-labs-030\\D$\\MT\\Text.txt"); 


but i gives error Logon failure: unknown user name or bad password.

The files are in Intranet.
Source is   e:\Text.txt
Destination is \okh-lb-labs-030\\D$\\MT\\Text.txt

If i copy on my local system it is fine but on network it gives error.i tried even giving rights to MT folder but no use.

Please help.

Pratiksha

Wednesday, March 10, 2010

Re: [DotNetDevelopment] Redirect with ADO.NET

Replace

Response.Redirect(dr["permission"+".aspx"].ToString());

With

Response.Redirect(dr["permission"] & ".aspx");


On Tue, Mar 9, 2010 at 9:39 AM, santhoshvkumar <santhosh.vkumar@gmail.com> wrote:
Hi all,
    Today I tried to design a login page of my own. Which contains
username and password. In database SQL I hav 3 column username,
password, permission. What I exactly need is I need to redirect to the
page under the name of permission if user name and password get
matches. So I tried the following coding.
con = new SqlConnection();
       string xx;
       con.ConnectionString = "Data Source=santhosh;Initial
Catalog=ec;User ID=sa;Password=test";
       con.Open();
       SqlCommand cmd = new SqlCommand();
       cmd = con.CreateCommand();
       cmd.CommandText = "select username, password from logi where
username=@username and password=@password";
       cmd.Parameters.Add("@username", SqlDbType.VarChar);
       cmd.Parameters["@username"].Value = TextBox1.Text;
       cmd.Parameters.Add("@password", SqlDbType.VarChar);
       cmd.Parameters["@password"].Value = TextBox2.Text;
       SqlDataReader dr = cmd.ExecuteReader();
       if (dr.Read())
       {

         Response.Redirect(dr["permission"+".aspx"].ToString());
       }
       else
           MessageBox.Show("buzz");

But this Response.Redirect(dr["permission"+".aspx"].ToString());--- is
not working it shows array out of bound exception what I have to do
now.

Thanks in Advance,
Santhosh V Kumar

Re: [DotNetDevelopment] ASP.NET GridView Question

Hi Greg,

You need to add a CommandField to your GridView, such as

<asp:CommandField ShowSelectButton="True" SelectText="Select" />

This will fire the following event

Protected Sub GridView1_RowCommand(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewCommandEventArgs) Handles GridView1.RowCommand

On Tue, Mar 9, 2010 at 11:29 AM, Greg Hile <greg@keepthemsmiling.com> wrote:

I put a gridview on a page and populate it. But nothing in the gridview is selectable.

 

How can I make items in the gridview selectable?

 

Here is the code.

 

 

Thanks to all.

 

Greg

 

HTML:

<form id="form1" runat="server">

    <div>

        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="True"

            CellPadding="4" ForeColor="#333333" GridLines="None" Height="240px"

            Width="248px">

            <RowStyle BackColor="#EFF3FB" />

            <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />

            <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />

            <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />

            <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />

            <EditRowStyle BackColor="#2461BF" />

            <AlternatingRowStyle BackColor="White" />

        </asp:GridView>

        <br />

        <br />

        <asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Button" />

    </div>

    </form>

 

 

CODE:

using System;

using System.Collections.Generic;

using System.Linq;

using System.Web;

using System.Web.UI;

using System.Web.UI.WebControls;

using System.Data;

 

public partial class _Default : System.Web.UI.Page

{

    DataTable DT;

  

    protected void Page_Load(object sender, EventArgs e)

    {

        if (!IsPostBack)

        {

            DT = new DataTable();

            DT.Columns.Add(new DataColumn("Data1", Type.GetType("System.String")));

            DT.Columns.Add(new DataColumn("Data2", Type.GetType("System.String")));

            DT.Columns.Add(new DataColumn("Data3", Type.GetType("System.String")));

            DT.Columns.Add(new DataColumn("Data4", Type.GetType("System.String")));

            DT.Columns.Add(new DataColumn("Data5", Type.GetType("System.String")));

            Session["Cart"] = DT;

           

           

        }

      

       

 

    }

 

    private void FillCart()

    {

        DT = (DataTable)Session["Cart"];

        DataRow DR = DT.NewRow();

        DR["Data1"] = "test1";

        DR["Data2"] = "test2";

        DR["Data3"] = "test3";

        DR["Data4"] = "test4";

        DR["Data5"] = "test5";

        DT.Rows.Add(DR);

       

        Session["Cart"] = DT;

        GridView1.DataSource = DT;

        GridView1.DataBind();

    }

 

    protected void Button1_Click(object sender, EventArgs e)

    {

        FillCart();

    }

}

 


Re: [DotNetDevelopment] Redirect with ADO.NET

String concatenation mixed with datatable data selection.
Check the statement.
...dr["permission"+".aspx"]...

On Tue, Mar 9, 2010 at 3:09 PM, santhoshvkumar <santhosh.vkumar@gmail.com> wrote:
Hi all,
    Today I tried to design a login page of my own. Which contains
username and password. In database SQL I hav 3 column username,
password, permission. What I exactly need is I need to redirect to the
page under the name of permission if user name and password get
matches. So I tried the following coding.
con = new SqlConnection();
       string xx;
       con.ConnectionString = "Data Source=santhosh;Initial
Catalog=ec;User ID=sa;Password=test";
       con.Open();
       SqlCommand cmd = new SqlCommand();
       cmd = con.CreateCommand();
       cmd.CommandText = "select username, password from logi where
username=@username and password=@password";
       cmd.Parameters.Add("@username", SqlDbType.VarChar);
       cmd.Parameters["@username"].Value = TextBox1.Text;
       cmd.Parameters.Add("@password", SqlDbType.VarChar);
       cmd.Parameters["@password"].Value = TextBox2.Text;
       SqlDataReader dr = cmd.ExecuteReader();
       if (dr.Read())
       {

         Response.Redirect(dr["permission"+".aspx"].ToString());
       }
       else
           MessageBox.Show("buzz");

But this Response.Redirect(dr["permission"+".aspx"].ToString());--- is
not working it shows array out of bound exception what I have to do
now.

Thanks in Advance,
Santhosh V Kumar



--

Santhosh V
http://techplex.wordpress.com

Re: [DotNetDevelopment] Dropdown menu horizontaly with submenu also

Try this
 
 
 


 
On Sat, Mar 6, 2010 at 6:54 AM, vamsi <vamsipunukollu@gmail.com> wrote:
trying using DHTML menus, try searching them in google.

Regards,
Vamsi.




On Sat, Mar 6, 2010 at 05:41, kp <kldpptl@gmail.com> wrote:
> I wanna design a dropdown menu that is horizontal and also the submenu
> in this format:
>
> File    | Edit           | Format
> New   | Open      | Save    |.....
>
> right now my menu is displayed in below format
>
> File    | Edit           | Format
> New
> Open
> Save
> ...
>
> I have not used ASP menu control. Instead i have used <ul> and <li>
> tag.
>

Re: [DotNetDevelopment] Re: UrlRewrite in IIS 6.0

Or u may write ur own handler for URL rewriter..
 
 
On Fri, Mar 5, 2010 at 11:55 PM, Ronak <ronak.802000@gmail.com> wrote:
Thanks for the reply
I will try it

On Mar 4, 4:10 pm, Nishant Gautam <nishant.gaut...@gmail.com> wrote:
> IIRF is good and will solve your problem,. I am also using IIRF in my
> website to remove .aspx
>
> Nishant Gauttam
> SchoolSearch.INhttp://www.schoolsearch.in
>
> On Thu, Mar 4, 2010 at 4:34 PM, Ronak <ronak.802...@gmail.com> wrote:
> > Hii,
>
> > I am using IIS 6.0 with shared server.
> > I want to do url rewrite for my website.
>
> > I have tried tools likeISAPI rewrite, nurlrewrite for URL rewrite, but
> > my problem is
> > not solved yet.
>
> > actually I need to openwww.abc.com/aaa.shtmby typing urlwww.abc.com/aaa
>
> > so please help me I dont want to use page extension anywhere in my
> > website
>
> > please help me urgently
>
> > thank you

Re: [DotNetDevelopment] Interface and Abstract class??

Thanks to all...

On Tue, Mar 9, 2010 at 1:32 PM, Processor Devil <processor.dev1l@gmail.com> wrote:
Easy answer... With interfaces you can create a code using class functionality before class is really made...

Good example. You are working in a team on some client/server application. Your goal is to create a communication between opened sockets using a new Connection class. But... this class is not coded yet.
For this class, interface IConnection was created which basically tells you what public methods and properties are inside.
This way you can have methods, which calls and uses functionality of class that is still in development.

Example of usage:
interface IConnection
{
  public void SendData(string data);
  public bool Result
  {
    get;
  }
}


class MyClass
{
  public MyClass(IConnection myConnection)
  {
      this.myConnection = myConnection;
  }
  public bool SendData(string data)
  {
     this.myConnection.Send(data);
     return this.myConnection.Result;
  }
  IConnection myConnection;
}

Using interfaces means you can implement classes that don't even exist, because you know, how the logic will work.
You don't need to wait and no one needs to wait for your work after some Connection class is really created.

2010/3/8 crazy <crazysanker@gmail.com>

sensible points and thanks ...
all the things u have described about interface is having Abstract class right?
then why we ned interface? we can use abstract class always

On Mon, Mar 8, 2010 at 10:01 AM, Raghupathi Kamuni <raghukamuni@gmail.com> wrote:

Interfaces are used to define the peripheral abilities of a class.
An abstract class defines the core identity of a class and there it is used for objects of the same type.

An interface cannot have access modifiers for the functions and properties everything is assumed as public.
An abstract class can contain access modifiers for the functions and properties.

An interface cannot provide any code, just the signature.
An abstract class can provide complete, default code and/or just the details that have to be overridden.


On Mon, Mar 8, 2010 at 12:34 AM, crazy <crazysanker@gmail.com> wrote:
Hi,
I gone through a lots of  articles regarding Abstarct class and Interfaces..
What is the extra thing in interface but not in Abstract?  Not in the C# conepts whole in OOPS.
why we cant use  abstarct classes instead of Interfaces  ?
in C# , if we need to implement  multiple inheritance,we can use it anything extra??
 
thanks
--
"People who never make mistakes, never do anything."

dEv




--
"People who never make mistakes, never do anything."

dEv




--
"People who never make mistakes, never do anything."

dEv

Tuesday, March 9, 2010

Re: [DotNetDevelopment] What type of a class is DataRow()?????

Thanks a lot!!!

On Tue, Mar 9, 2010 at 10:46 AM, Arsalan Tamiz <sallushan@gmail.com> wrote:
You should first need to now "why" then you should go to "how"

"Why" we need this? i.e. creating a class which cannot be instantiated by the end user but can be instantiated by some other class
-----
As Jamie described in its earlier post there are scenarios where we require this type of functionality that some class must NOT be initialized by the end user of our class. For example in this scenario that creating a DataRow in "air" does NOT make any sense because columns are necessary parameter. Which are obviously part of DataTable class. Thats why DataTable actually initializes the DataRow supplying the necessary parameters defined in DataTable.

"How" we can achieve this?
------
This can be achieved by defining the class constructor with access modifier "internal" for C# or "Friend" for VB. In this way this constructor can only be called by the same assembly's classes. The external assembly cannot access it.

On Mon, Mar 8, 2010 at 11:10 PM, crazy <crazysanker@gmail.com> wrote:
ok.. then how can i create a class which will not allow to create objects itself and another class allowing it to create object.
If possible,I would like to know the class architeture using in .net behind this concept...
( I am doing some R&D in .Net class architecture)
 
Thanks
Vipin

On Mon, Mar 8, 2010 at 3:04 PM, Jamie Fraser <jamie.fraser@gmail.com> wrote:
Think of the DataTable in this case as being a pseudo-factory that is responsible for creating DataRows.

In a semantic sense, a datarow MUST have an associated table (to begin with) - a row cannot exist without a table.


On Fri, Mar 5, 2010 at 9:00 PM, crazy <crazysanker@gmail.com> wrote:
hi All,
 
DataTable oDT=new DataTable();
 
DataRowoDR=null;
 
Case 1:
oDR=new DataRow() ;
 
Case 2:
oDR=new oDT.DataRow();
 
 
why Case 1 showing error?
.Net doesnt allowing to create a object to that DataRow() class.But it allowing DataTable to create a object to DataRow().
If so , what type of class is DataRow()?
 
One scenario is there, if DataRow() class contains only private Constructor s and it contains a public static method which will create a new row . But in Datarow ,using Wincv I have checked available public methods , but i cant able to find such a public static method in DataRow().
 
Then  what type of architecture using  in DataRow() ?
 
 


--
"People who never make mistakes, never do anything."

dEv




--
"People who never make mistakes, never do anything."

dEv




--
"People who never make mistakes, never do anything."

dEv

Re: [DotNetDevelopment] Dropdown menu horizontaly with submenu also

i have developed my website in ASP.net and i have used html controls with css implemented on it.
is ther eany other solution.

[DotNetDevelopment] Re: Text Box data - How to keep the current data in the text box, when validating text boxes.

Thanks for your feedback Cerebrus. I finally got a hold of our
corporate web group and we are allowed to use the validation control
but it has to be on the client and server side.

Everything is good here.

Thanks again,

William.

On Mar 2, 12:33 am, Cerebrus <zorg...@sify.com> wrote:
> Is Viewstate turned on for the page ?
>
> The code appears to be correct and you are using Webcontrols, so there
> shouldn't be a problem, normally.