473,737 Members | 1,913 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

code sample wanted: creating and populating a collection of objects from a datasource?

Trying to learn about manipulating collections of objects, and populating
these objects dynamically from datasources. Could someone post a code sample
that shows the following:

Instantiating a collection object -- say, a dictionary.
Populating that collection object with custom objects, say, Person. What I
really want to see is how to populate the properties of those Person objects
from a datasource: instantiate one Person, fill Person.FirstNam e,
Person.LastName , Person.ID with data, iterate to the next item in the
datasource, instantiate another person, fill Person.FirstNam e,
Person.LastName ...

Any help out there?

Thanks very much.

-KF
Nov 19 '05 #1
5 2289
This BarGraph web control contains a collection of Bar objects.
Full source code is included:
http://www.SteveOrr.net/articles/BarGraphs.aspx

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
<ke*****@nospam .nospam> wrote in message
news:uH******** ******@tk2msftn gp13.phx.gbl...
Trying to learn about manipulating collections of objects, and populating
these objects dynamically from datasources. Could someone post a code
sample that shows the following:

Instantiating a collection object -- say, a dictionary.
Populating that collection object with custom objects, say, Person. What I
really want to see is how to populate the properties of those Person
objects from a datasource: instantiate one Person, fill Person.FirstNam e,
Person.LastName , Person.ID with data, iterate to the next item in the
datasource, instantiate another person, fill Person.FirstNam e,
Person.LastName ...

Any help out there?

Thanks very much.

-KF

Nov 19 '05 #2
Thank you very much, Steve, that's quite helpful.

Does anyone have additional examples, or a C# example that I could look at?

Thanks
-KF
"Steve C. Orr [MVP, MCSD]" <St***@Orr.ne t> wrote in message
news:O0******** *****@TK2MSFTNG P09.phx.gbl...
This BarGraph web control contains a collection of Bar objects.
Full source code is included:
http://www.SteveOrr.net/articles/BarGraphs.aspx

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
<ke*****@nospam .nospam> wrote in message
news:uH******** ******@tk2msftn gp13.phx.gbl...
Trying to learn about manipulating collections of objects, and populating
these objects dynamically from datasources. Could someone post a code
sample that shows the following:

Instantiating a collection object -- say, a dictionary.
Populating that collection object with custom objects, say, Person. What
I really want to see is how to populate the properties of those Person
objects from a datasource: instantiate one Person, fill Person.FirstNam e,
Person.LastName , Person.ID with data, iterate to the next item in the
datasource, instantiate another person, fill Person.FirstNam e,
Person.LastName ...

Any help out there?

Thanks very much.

-KF


Nov 19 '05 #3
Hi KF,

Since the question you mentioned is a very specific one, instead of
searching some separate articles, I've made a simple test page which build
a dummy datatable and populate a "person" class's instance collection from
the datatable and bind it to a datagrid for displaying, below is the
completet code. Also, I think you can try have a look in the www. asp.net
or codeproject site to see whether there are any good examples or articles
there.

Hope helps,

========aspx=== =========
<HTML>
<HEAD>
<title>objectPo pulate</title>
<meta name="GENERATOR " Content="Micros oft Visual Studio .NET 7.1">
<meta name="CODE_LANG UAGE" Content="C#">
<meta name="vs_defaul tClientScript" content="JavaSc ript">
<meta name="vs_target Schema"
content="http://schemas.microso ft.com/intellisense/ie5">
</HEAD>
<body>
<form id="Form1" method="post" runat="server">
<asp:DataGrid id="DataGrid1" runat="server"> </asp:DataGrid>
</form>
</body>
</HTML>
========code behind========= ===
namespace DemoWebApp
{
public class objectPopulate : System.Web.UI.P age
{
protected System.Web.UI.W ebControls.Data Grid DataGrid1;

private void Page_Load(objec t sender, System.EventArg s e)
{
if(!IsPostBack)
{
DataGrid1.DataS ource = GetPersons();
DataGrid1.DataB ind();
}
}
private DataTable GetDataSource()
{
DataTable dt = new DataTable();

dt.Columns.Add( "id",typeof(lon g));
dt.Columns.Add( "name",typeof(s tring));
dt.Columns.Add( "age",typeof(in t));
dt.Columns.Add( "email",typeof( string));

for(int i=0;i<10;i++)
{
DataRow dr = dt.NewRow();
dr[0] = i+1;
dr[1] = "Name_" + dr[0];
dr[2] = 25 + i;
dr[3] = dr[1] + "@test.org" ;

dt.Rows.Add(dr) ;
}

return dt;
}

private Person[] GetPersons()
{
DataTable dt = GetDataSource() ;

Person[] persons = new Person[dt.Rows.Count];

for(int i=0;i<persons.L ength;i++)
{
Person person = new Person();
person.Id = (long)dt.Rows[i][0];
person.Name = (string)dt.Rows[i][1];
person.Age = (int)dt.Rows[i][2];
person.Email = (string)dt.Rows[i][3];

persons[i] = person;
}

return persons;
}

#region Web Form Designer generated code
override protected void OnInit(EventArg s e)
{
InitializeCompo nent();
base.OnInit(e);
}

private void InitializeCompo nent()
{
this.Load += new System.EventHan dler(this.Page_ Load);

}
#endregion
}
public class Person
{
long _id;
string _name;
int _age;
string _email;

public long Id
{
get
{
return _id;
}
set
{
_id = value;
}
}

public string Name
{
get
{
return _name;
}
set
{
_name = value;
}
}

public int Age
{
get
{
return _age;
}
set
{
_age = value;
}
}

public string Email
{
get
{
return _email;
}
set
{
_email = value;
}
}
public Person():this(0 ,"",20,"")
{
}

public Person(long id, string name, int age, string email)
{
_id = id;
_name = name;
_age = age;
_email = email;
}
}
}

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--------------------
| Reply-To: "ke*****@nospam .nospam" <ke*****@u.wash ington.edu>
| From: <ke*****@nospam .nospam>
| References: <uH************ **@tk2msftngp13 .phx.gbl>
<O0************ *@TK2MSFTNGP09. phx.gbl>
| Subject: Re: code sample wanted: creating and populating a collection of
objects from a datasource?
| Date: Wed, 17 Aug 2005 15:17:19 -0700
| Lines: 44
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
| X-RFC2646: Format=Flowed; Response
| Message-ID: <#m************ **@tk2msftngp13 .phx.gbl>
| Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
| NNTP-Posting-Host: idea.urel.washi ngton.edu 128.95.9.12
| Path: TK2MSFTNGXA01.p hx.gbl!TK2MSFTN GP08.phx.gbl!tk 2msftngp13.phx. gbl
| Xref: TK2MSFTNGXA01.p hx.gbl
microsoft.publi c.dotnet.framew ork.aspnet:1187 52
| X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet
|
| Thank you very much, Steve, that's quite helpful.
|
| Does anyone have additional examples, or a C# example that I could look
at?
|
| Thanks
| -KF
|
|
| "Steve C. Orr [MVP, MCSD]" <St***@Orr.ne t> wrote in message
| news:O0******** *****@TK2MSFTNG P09.phx.gbl...
| > This BarGraph web control contains a collection of Bar objects.
| > Full source code is included:
| > http://www.SteveOrr.net/articles/BarGraphs.aspx
| >
| > --
| > I hope this helps,
| > Steve C. Orr, MCSD, MVP
| > http://SteveOrr.net
| >
| >
| > <ke*****@nospam .nospam> wrote in message
| > news:uH******** ******@tk2msftn gp13.phx.gbl...
| >> Trying to learn about manipulating collections of objects, and
populating
| >> these objects dynamically from datasources. Could someone post a code
| >> sample that shows the following:
| >>
| >> Instantiating a collection object -- say, a dictionary.
| >> Populating that collection object with custom objects, say, Person.
What
| >> I really want to see is how to populate the properties of those Person
| >> objects from a datasource: instantiate one Person, fill
Person.FirstNam e,
| >> Person.LastName , Person.ID with data, iterate to the next item in the
| >> datasource, instantiate another person, fill Person.FirstNam e,
| >> Person.LastName ...
| >>
| >> Any help out there?
| >>
| >> Thanks very much.
| >>
| >> -KF
| >>
| >
| >
|
|
|

Nov 19 '05 #4
Super. Awesome. This is great. Thank you so much, Steven.

Examples of this sort are surprisingly scarce: most online examples seem
work directly against the data objects rather than dyamically populating
custom objects as you've done here.

Thanks again.
-KF

"Steven Cheng[MSFT]" <st*****@online .microsoft.com> wrote in message
news:5l******** ******@TK2MSFTN GXA01.phx.gbl.. .
Hi KF,

Since the question you mentioned is a very specific one, instead of
searching some separate articles, I've made a simple test page which build
a dummy datatable and populate a "person" class's instance collection from
the datatable and bind it to a datagrid for displaying, below is the
completet code. Also, I think you can try have a look in the www. asp.net
or codeproject site to see whether there are any good examples or articles
there.

Hope helps,

========aspx=== =========
<HTML>
<HEAD>
<title>objectPo pulate</title>
<meta name="GENERATOR " Content="Micros oft Visual Studio .NET 7.1">
<meta name="CODE_LANG UAGE" Content="C#">
<meta name="vs_defaul tClientScript" content="JavaSc ript">
<meta name="vs_target Schema"
content="http://schemas.microso ft.com/intellisense/ie5">
</HEAD>
<body>
<form id="Form1" method="post" runat="server">
<asp:DataGrid id="DataGrid1" runat="server"> </asp:DataGrid>
</form>
</body>
</HTML>
========code behind========= ===
namespace DemoWebApp
{
public class objectPopulate : System.Web.UI.P age
{
protected System.Web.UI.W ebControls.Data Grid DataGrid1;

private void Page_Load(objec t sender, System.EventArg s e)
{
if(!IsPostBack)
{
DataGrid1.DataS ource = GetPersons();
DataGrid1.DataB ind();
}
}
private DataTable GetDataSource()
{
DataTable dt = new DataTable();

dt.Columns.Add( "id",typeof(lon g));
dt.Columns.Add( "name",typeof(s tring));
dt.Columns.Add( "age",typeof(in t));
dt.Columns.Add( "email",typeof( string));

for(int i=0;i<10;i++)
{
DataRow dr = dt.NewRow();
dr[0] = i+1;
dr[1] = "Name_" + dr[0];
dr[2] = 25 + i;
dr[3] = dr[1] + "@test.org" ;

dt.Rows.Add(dr) ;
}

return dt;
}

private Person[] GetPersons()
{
DataTable dt = GetDataSource() ;

Person[] persons = new Person[dt.Rows.Count];

for(int i=0;i<persons.L ength;i++)
{
Person person = new Person();
person.Id = (long)dt.Rows[i][0];
person.Name = (string)dt.Rows[i][1];
person.Age = (int)dt.Rows[i][2];
person.Email = (string)dt.Rows[i][3];

persons[i] = person;
}

return persons;
}

#region Web Form Designer generated code
override protected void OnInit(EventArg s e)
{
InitializeCompo nent();
base.OnInit(e);
}

private void InitializeCompo nent()
{
this.Load += new System.EventHan dler(this.Page_ Load);

}
#endregion
}
public class Person
{
long _id;
string _name;
int _age;
string _email;

public long Id
{
get
{
return _id;
}
set
{
_id = value;
}
}

public string Name
{
get
{
return _name;
}
set
{
_name = value;
}
}

public int Age
{
get
{
return _age;
}
set
{
_age = value;
}
}

public string Email
{
get
{
return _email;
}
set
{
_email = value;
}
}
public Person():this(0 ,"",20,"")
{
}

public Person(long id, string name, int age, string email)
{
_id = id;
_name = name;
_age = age;
_email = email;
}
}
}

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--------------------
| Reply-To: "ke*****@nospam .nospam" <ke*****@u.wash ington.edu>
| From: <ke*****@nospam .nospam>
| References: <uH************ **@tk2msftngp13 .phx.gbl>
<O0************ *@TK2MSFTNGP09. phx.gbl>
| Subject: Re: code sample wanted: creating and populating a collection of
objects from a datasource?
| Date: Wed, 17 Aug 2005 15:17:19 -0700
| Lines: 44
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
| X-RFC2646: Format=Flowed; Response
| Message-ID: <#m************ **@tk2msftngp13 .phx.gbl>
| Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
| NNTP-Posting-Host: idea.urel.washi ngton.edu 128.95.9.12
| Path: TK2MSFTNGXA01.p hx.gbl!TK2MSFTN GP08.phx.gbl!tk 2msftngp13.phx. gbl
| Xref: TK2MSFTNGXA01.p hx.gbl
microsoft.publi c.dotnet.framew ork.aspnet:1187 52
| X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet
|
| Thank you very much, Steve, that's quite helpful.
|
| Does anyone have additional examples, or a C# example that I could look
at?
|
| Thanks
| -KF
|
|
| "Steve C. Orr [MVP, MCSD]" <St***@Orr.ne t> wrote in message
| news:O0******** *****@TK2MSFTNG P09.phx.gbl...
| > This BarGraph web control contains a collection of Bar objects.
| > Full source code is included:
| > http://www.SteveOrr.net/articles/BarGraphs.aspx
| >
| > --
| > I hope this helps,
| > Steve C. Orr, MCSD, MVP
| > http://SteveOrr.net
| >
| >
| > <ke*****@nospam .nospam> wrote in message
| > news:uH******** ******@tk2msftn gp13.phx.gbl...
| >> Trying to learn about manipulating collections of objects, and
populating
| >> these objects dynamically from datasources. Could someone post a code
| >> sample that shows the following:
| >>
| >> Instantiating a collection object -- say, a dictionary.
| >> Populating that collection object with custom objects, say, Person.
What
| >> I really want to see is how to populate the properties of those
Person
| >> objects from a datasource: instantiate one Person, fill
Person.FirstNam e,
| >> Person.LastName , Person.ID with data, iterate to the next item in the
| >> datasource, instantiate another person, fill Person.FirstNam e,
| >> Person.LastName ...
| >>
| >> Any help out there?
| >>
| >> Thanks very much.
| >>
| >> -KF
| >>
| >
| >
|
|
|

Nov 19 '05 #5
You're welcome KF,

Glad that it is of assistance. :-)

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--------------------
| Reply-To: "ke*****@nospam .nospam" <ke*****@u.wash ington.edu>
| From: <ke*****@nospam .nospam>
| References: <uH************ **@tk2msftngp13 .phx.gbl>
<O0************ *@TK2MSFTNGP09. phx.gbl>
<#m************ **@tk2msftngp13 .phx.gbl>
<5l************ **@TK2MSFTNGXA0 1.phx.gbl>
| Subject: Re: code sample wanted: creating and populating a collection of
objects from a datasource?
| Date: Wed, 17 Aug 2005 20:45:54 -0700
| Lines: 268
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
| X-RFC2646: Format=Flowed; Original
| Message-ID: <O2************ **@TK2MSFTNGP12 .phx.gbl>
| Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
| NNTP-Posting-Host: idea.urel.washi ngton.edu 128.95.9.12
| Path: TK2MSFTNGXA01.p hx.gbl!TK2MSFTN GP08.phx.gbl!TK 2MSFTNGP12.phx. gbl
| Xref: TK2MSFTNGXA01.p hx.gbl
microsoft.publi c.dotnet.framew ork.aspnet:1187 90
| X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet
|
| Super. Awesome. This is great. Thank you so much, Steven.
|
| Examples of this sort are surprisingly scarce: most online examples seem
| work directly against the data objects rather than dyamically populating
| custom objects as you've done here.
|
| Thanks again.
| -KF
|
| "Steven Cheng[MSFT]" <st*****@online .microsoft.com> wrote in message
| news:5l******** ******@TK2MSFTN GXA01.phx.gbl.. .
| > Hi KF,
| >
| > Since the question you mentioned is a very specific one, instead of
| > searching some separate articles, I've made a simple test page which
build
| > a dummy datatable and populate a "person" class's instance collection
from
| > the datatable and bind it to a datagrid for displaying, below is the
| > completet code. Also, I think you can try have a look in the www.
asp.net
| > or codeproject site to see whether there are any good examples or
articles
| > there.
| >
| > Hope helps,
| >
| > ========aspx=== =========
| > <HTML>
| > <HEAD>
| > <title>objectPo pulate</title>
| > <meta name="GENERATOR " Content="Micros oft Visual Studio .NET 7.1">
| > <meta name="CODE_LANG UAGE" Content="C#">
| > <meta name="vs_defaul tClientScript" content="JavaSc ript">
| > <meta name="vs_target Schema"
| > content="http://schemas.microso ft.com/intellisense/ie5">
| > </HEAD>
| > <body>
| > <form id="Form1" method="post" runat="server">
| > <asp:DataGrid id="DataGrid1" runat="server"> </asp:DataGrid>
| > </form>
| > </body>
| > </HTML>
| >
| >
| > ========code behind========= ===
| > namespace DemoWebApp
| > {
| > public class objectPopulate : System.Web.UI.P age
| > {
| > protected System.Web.UI.W ebControls.Data Grid DataGrid1;
| >
| > private void Page_Load(objec t sender, System.EventArg s e)
| > {
| > if(!IsPostBack)
| > {
| > DataGrid1.DataS ource = GetPersons();
| > DataGrid1.DataB ind();
| > }
| > }
| >
| >
| > private DataTable GetDataSource()
| > {
| > DataTable dt = new DataTable();
| >
| > dt.Columns.Add( "id",typeof(lon g));
| > dt.Columns.Add( "name",typeof(s tring));
| > dt.Columns.Add( "age",typeof(in t));
| > dt.Columns.Add( "email",typeof( string));
| >
| > for(int i=0;i<10;i++)
| > {
| > DataRow dr = dt.NewRow();
| > dr[0] = i+1;
| > dr[1] = "Name_" + dr[0];
| > dr[2] = 25 + i;
| > dr[3] = dr[1] + "@test.org" ;
| >
| > dt.Rows.Add(dr) ;
| > }
| >
| > return dt;
| > }
| >
| > private Person[] GetPersons()
| > {
| > DataTable dt = GetDataSource() ;
| >
| > Person[] persons = new Person[dt.Rows.Count];
| >
| > for(int i=0;i<persons.L ength;i++)
| > {
| > Person person = new Person();
| > person.Id = (long)dt.Rows[i][0];
| > person.Name = (string)dt.Rows[i][1];
| > person.Age = (int)dt.Rows[i][2];
| > person.Email = (string)dt.Rows[i][3];
| >
| > persons[i] = person;
| > }
| >
| > return persons;
| > }
| >
| > #region Web Form Designer generated code
| > override protected void OnInit(EventArg s e)
| > {
| > InitializeCompo nent();
| > base.OnInit(e);
| > }
| >
| > private void InitializeCompo nent()
| > {
| > this.Load += new System.EventHan dler(this.Page_ Load);
| >
| > }
| > #endregion
| > }
| >
| >
| > public class Person
| > {
| > long _id;
| > string _name;
| > int _age;
| > string _email;
| >
| > public long Id
| > {
| > get
| > {
| > return _id;
| > }
| > set
| > {
| > _id = value;
| > }
| > }
| >
| > public string Name
| > {
| > get
| > {
| > return _name;
| > }
| > set
| > {
| > _name = value;
| > }
| > }
| >
| > public int Age
| > {
| > get
| > {
| > return _age;
| > }
| > set
| > {
| > _age = value;
| > }
| > }
| >
| > public string Email
| > {
| > get
| > {
| > return _email;
| > }
| > set
| > {
| > _email = value;
| > }
| > }
| >
| >
| > public Person():this(0 ,"",20,"")
| > {
| > }
| >
| > public Person(long id, string name, int age, string email)
| > {
| > _id = id;
| > _name = name;
| > _age = age;
| > _email = email;
| > }
| > }
| > }
| >
| > Steven Cheng
| > Microsoft Online Support
| >
| > Get Secure! www.microsoft.com/security
| > (This posting is provided "AS IS", with no warranties, and confers no
| > rights.)
| > --------------------
| > | Reply-To: "ke*****@nospam .nospam" <ke*****@u.wash ington.edu>
| > | From: <ke*****@nospam .nospam>
| > | References: <uH************ **@tk2msftngp13 .phx.gbl>
| > <O0************ *@TK2MSFTNGP09. phx.gbl>
| > | Subject: Re: code sample wanted: creating and populating a collection
of
| > objects from a datasource?
| > | Date: Wed, 17 Aug 2005 15:17:19 -0700
| > | Lines: 44
| > | X-Priority: 3
| > | X-MSMail-Priority: Normal
| > | X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
| > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
| > | X-RFC2646: Format=Flowed; Response
| > | Message-ID: <#m************ **@tk2msftngp13 .phx.gbl>
| > | Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
| > | NNTP-Posting-Host: idea.urel.washi ngton.edu 128.95.9.12
| > | Path: TK2MSFTNGXA01.p hx.gbl!TK2MSFTN GP08.phx.gbl!tk 2msftngp13.phx. gbl
| > | Xref: TK2MSFTNGXA01.p hx.gbl
| > microsoft.publi c.dotnet.framew ork.aspnet:1187 52
| > | X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet
| > |
| > | Thank you very much, Steve, that's quite helpful.
| > |
| > | Does anyone have additional examples, or a C# example that I could
look
| > at?
| > |
| > | Thanks
| > | -KF
| > |
| > |
| > | "Steve C. Orr [MVP, MCSD]" <St***@Orr.ne t> wrote in message
| > | news:O0******** *****@TK2MSFTNG P09.phx.gbl...
| > | > This BarGraph web control contains a collection of Bar objects.
| > | > Full source code is included:
| > | > http://www.SteveOrr.net/articles/BarGraphs.aspx
| > | >
| > | > --
| > | > I hope this helps,
| > | > Steve C. Orr, MCSD, MVP
| > | > http://SteveOrr.net
| > | >
| > | >
| > | > <ke*****@nospam .nospam> wrote in message
| > | > news:uH******** ******@tk2msftn gp13.phx.gbl...
| > | >> Trying to learn about manipulating collections of objects, and
| > populating
| > | >> these objects dynamically from datasources. Could someone post a
code
| > | >> sample that shows the following:
| > | >>
| > | >> Instantiating a collection object -- say, a dictionary.
| > | >> Populating that collection object with custom objects, say, Person.
| > What
| > | >> I really want to see is how to populate the properties of those
| > Person
| > | >> objects from a datasource: instantiate one Person, fill
| > Person.FirstNam e,
| > | >> Person.LastName , Person.ID with data, iterate to the next item in
the
| > | >> datasource, instantiate another person, fill Person.FirstNam e,
| > | >> Person.LastName ...
| > | >>
| > | >> Any help out there?
| > | >>
| > | >> Thanks very much.
| > | >>
| > | >> -KF
| > | >>
| > | >
| > | >
| > |
| > |
| > |
| >
|
|
|

Nov 19 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

242
13401
by: James Cameron | last post by:
Hi I'm developing a program and the client is worried about future reuse of the code. Say 5, 10, 15 years down the road. This will be a major factor in selecting the development language. Any comments on past experience, research articles, comments on the matter would be much appreciated. I suspect something like C would be the best based on comments I received from the VB news group. Thanks for the help in advance James Cameron
14
1693
by: Ian Richardson | last post by:
I'm writing a large Javascript application (uncompressed source around 400K) which is doing almost all the initialisation it needs to in a just-in-time manner. However, I have included an option for almost all of this to be done when the application first starts. Under this circumstance, and since the last few nightly builds of Mozilla, I've been getting: Script warning:
9
1502
by: Steve Jorgensen | last post by:
First, an example - today, I wanted to print out the parameter values in a querydef object at a break point in the code for subsequent manual debugging of the query. In the past, I would have had to either manually write down the values from the watch window, or break the code, write a custom procedure to print the values for me, then run the code to the breakpoint again. By now, though, my library of collection-oriented tools makes such...
4
2846
by: Filippo Pandiani | last post by:
I have a grid that shows the file list from a folder. On the postback, how do I get a Dataset from this grid? Thanks, Filippo.
3
1372
by: MattC | last post by:
Hi, I have a collection class derived from ArrayList, it stores colletions of objects from my objet model. I Didn't want to have to create a specialised collection for each object type so I created the following static method. public static MyCollection CreateGenericCollection(DataTable rates, Assembly a, Type t) { MyCollection c = new MyCollection(); // create new collection
6
5516
by: Paolo Pignatelli | last post by:
I have an aspx code behind page that goes something like this in the HTML view: <asp:HyperLink id=HyperLink1 runat="server" NavigateUrl='<%#"mailto:" &amp; DataBinder.Eval(Container.DataItem,"StoreEmail") &amp; "&amp;Subject=" &amp; DataBinder.Eval(Container.DataItem,"ProductName") ....
4
5041
by: Larry Grady | last post by:
Anyone up for a challenge? I've been struggling with this for a few days and was hoping someone could help me. Pouring through all the messageboards I just can't find the solution. We have a GridView that needs to be dynamically designed, depending on what collection of fields our uses want to edit for their product data. We have 400+ fields of information per product so they're selecting a subset of those fields to edit.
13
1264
by: Woody Splawn | last post by:
From a Winform I am calling the sub routine that follows in a module Public Sub PopulateWithStates(ByVal myform As Contracts, ByVal FieldName As String) Select Case FieldName Case "txtST" myform.txtST.Items.Clear() myform.txtST.Items.Add("CA") myform.txtST.Items.Add("WA") End Select
15
2965
by: CR | last post by:
I've noticed that the trend these days is to declare variables in the middle of code instead of at the top. What is the advantage of this? It seems like it makes it hard to reuse variables. Here is how all the examples I've seen so far create an OleDbCommand Object: Dim cmd as new OleDbCommand("Select * FROM Table1",cnn) I had to figure out that it was the same as this:
0
8966
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9467
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9331
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9204
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6749
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4567
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4823
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2744
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2192
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.