|
|
Thanks I will look into it.
|
|
|
|
|
|
i am trying to develop some user forum type page. where i have a datalist in which main forum topics are binded. its working. now i need to display the replys or suggetion on just below the particular topic(particular row inside the datalist).it will be like this
datalist
topic 1
reply 1
reply 2
reply 3
topic 2
reply 1
reply 2
reply 3
like this .
i have binded the topics in datalist . but dont know how to do the other part . can anyone help me out
this is the code i used for datalist
Sub binddata5()
Dim mycommand As New SqlCommand("SELECT * from alltopics", con)
con.Open()
topics.DataSource = mycommand.ExecuteReader
topics.DataBind()
con.Close()
datalist design
<asp:DataList ID="topics" runat="server" DataKeyField="id"
RepeatColumns="1">
<ItemTemplate>
<div>  <strong><asp:Label
ID="detail" runat="server" Text='<%#Container.DataItem("topicdetails")%>'></asp:Label></strong>   on   <asp:Label ID="date" runat="server" Text='<%#Container.DataItem("ondate")%>'></asp:Label></td></tr>
</div>
</ItemTemplate>
</asp:DataList>
the replys to any topics are stored in another table named tblreply.
|
|
|
|
|
You might get a better response by posting this in the correct forum[^].
Binding 100,000 items to a list box can be just silly regardless of what pattern you are following. Jeremy Likness
|
|
|
|
|
Hi Guys,
I have a small big question.
What does the
using System
using System.Data
actually do when a program is executing?
To the best of my knowledge it loads a DLL related to those namespaces into the memory and then accesses the methods,but recently I came to know that <pre lang="c#">using</pre> tells the system to use the namespace and access the methods,but how is it possible to use the namespace and access the methods without actually loading the DLL into program execution memory?This recently came up in a discussion with a team member and he shattered my belief in .NET
using
Sastry
|
|
|
|
|
The using keyword just makes your code a little simpler by allowing you to not specify namespaces when accessing classes. For example, if you have this class:
namespace Tester
{
class Test
{
private void TestMethod()
{
}
}
}
Without a using statement, you would use it like this:
var x = new Tester.Test();
With a using statement, you can have:
using Tester;
var x = new Test();
Provided you don't have a class name collision (which namespaces are used to avoid in the first place), you end up with 'simpler' code (for a given value of simpler). However, they aren't essential.
The DLL references are managed by the project file and then passed directly to the compiler, not using these statements.
Incidently, this isn't a specifically C# thing, the using namespace construct in C++ works in the same way.
Does that answer your question?
|
|
|
|
|
Got it,but does that load the DLL into the program memory while it is executing ?
for example in DataAccess.dll I have:
Using System.Data;
namespace A
{
Class DataAccess
{
}
}
in business layer/application project I refer the DataAccess DLL and I say
using A;
using System;
namespace B
{
Class c
{
DataAccess daObj = new DataAccess();
}
}
does the above line load the dll System.Data into the execution of the program when class C instance is accessed as we are accessing DataAccess class which refers to System.Data?
5@S3
|
|
|
|
|
Generally speaking a DLL will be loaded at the first method call whose code is part of the DLL. Thus in your example above it will be loaded at the call to the DataAccess() constructor. However, there is lots of optimisation in .NET so it is quite possible it gets loaded through some 'look ahead' code to speed up the program.
Binding 100,000 items to a list box can be just silly regardless of what pattern you are following. Jeremy Likness
|
|
|
|
|
Ok,so that means even if refer to the name spaces in multiple project also the DLL gets loaded only once.
For example referring to the Microsoft.Practices.EnterpriseLibrary.Data in business layer and data access layer will ensure that DLL having the namespace is loaded only once through out the entire program execution.
Sastry
|
|
|
|
|
Sastry_kunapuli wrote: so that means even if refer to the name spaces in multiple project also the DLL gets loaded only once.
This has nothing to do with the using statement, or with the number of projects that it is used in. A DLL is a code library that is used by an executable program, and is loaded into memory when some code in the executable makes a call to one of its methods. Having a using statement in your source code merely allows the compiler to satisfy references to methods or classes that are not defined within any of the source modules of the project. However, if no direct references are made from the program that contains the using statement, then the associated DLL will not be loaded.
Binding 100,000 items to a list box can be just silly regardless of what pattern you are following. Jeremy Likness
|
|
|
|
|
So referring the namespace in multiple project/class libraries does not affect the number of times a DLL into memory.
Something like referring to
Microsoft.Practices.EnterpriseLibrary.Data in BusinessLayer.DLL and DataAccess.DLL,will ensure that .NET loads the
Microsoft.Practices.EnterpriseLibrary.Data.dll only once ?
Sastry
|
|
|
|
|
It doesn't "do" anything, it simply instructs the compiler where to look (in referenced DLL's or in .NET language, "assemblies"). They aren't evaluated during runtime at all, it's only used in the preprocessor during the linking phase of the compilation process.
Like the other poster said, if you don't use the "using" statement, you have to explicitly identify where to find certain functions in the included assemblies. It essentially just saves a lot of typing as stated.
Oddly enough, the "using" statement can also be used to re-assign namespaces and class names. You can use it to "alias" namespaces.
Another "using" keyword is to limit the scope of a variable and do automatic clean-up, like:
using (SolidBrush sb = new SolidBrush(Color.Red))
{
//Use the solid brush here
}
//Here the solid brush no longer exists, and the object is correctly disposed.
|
|
|
|
|
I need insert,delete and update data from SQL database in gridview.Please help me.Thanks
|
|
|
|
|
|
Permission granted! Please, proceed.
...or did you mean to ask a question in there somewhere??
|
|
|
|
|
<asp:FileUpload ID="FileUpload1" runat="server" />
<asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Button" />
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.IO;
public partial class we : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
DateTime creationTime = File.GetCreationTime(FileUpload1.FileName);
Label1.Text =creationTime.ToString() ;
}
}
shah k .j
|
|
|
|
|
I'm not going to split my effort over two identical questions. So pop back over to your original post and answer my latest response.
Alan.
|
|
|
|
|
I am interested in the most efficient way to store values from an object array containing dates, string, double, integer, Boolean, and null values. The values will then be restored back to the array by reading the file at a later date.
BinaryFormatter is very slow and inefficient and looking for another solution.
Need to stay in .NET Framework 3.5
Ken Eldridge
|
|
|
|
|
When I want to write out data quickly and efficiently I tend to implement the ISerializable interface directly on the classes I want to serialise and manage the writing out myself. The reason the BinaryFormatter is so slow is because it's using reflection to work out what to serialize. By specifying this yourself you save the formatter from having to do this which results in a much faster implementation.
|
|
|
|
|
Pete, are you available for paid consulting? If so how can I reach you to discuss project scope?
|
|
|
|
|
I need to pass an array from C#.net application to oracle stored procedure. Can anyone please let me know how to go about it? Also, which OracleType type do I use in C# when passing input parameter to stored procedure?
FYI, am using System.Data.Common.DbConnection in my C#.
|
|
|
|
|
Asking the same question again as you asked yesterday isn't going to get you an answer any faster. People answer the questions on a volunteer only basis, so it's rude to attempt to bump your post like this.
|
|
|
|
|
Did you try to pass it as XML, as suggested yesterday?
Bastard Programmer from Hell
|
|
|
|
|
Yes. I tried it by passing it as XML and works fine.
Thanks a lot.
|
|
|
|