|
Hi Uma,
I just try to help you.Let's see one by one
1)Difference between bound coloumn and template coloumn is -> you can use teplate column to insert controls(i.e checkbox,dropdownlist) in datagrid column.
2)To sort Datagrid at runtime just use order by clause in your query and fill datagrid.To make it at runtime just fill grid by order by clause at everytime when user click on sorting field(i.e.rollno)
I think it will help you.
Bye........
|
|
|
|
|
1:
A template column allows you to create a custom layout for a column based on any mixture of controls and static text and we use the BoundColumn column type in a DataGrid control to just display the contents of a field in the data source.
2:
Step 1.set AllowSorting="True" in <asp:datagrid> tag in .aspx
Step 2.set SortExpression="Column name" in BoundColumn\Templatecolumn tags in .aspx
Praveen
|
|
|
|
|
1. Data bound column will show you data from database directly but in template column you can add another controls in datagrid and can get the benefites to make ur datagrid more functional...
ye you will have to use dataviews for this and also you will have to be written an event for sorting...
Dinesh Sharma
Team Leader (Software Development)
|
|
|
|
|
Thank u.I used dataviews and also wrote an event to handle it.
Uma
Kindly send me feedback
Thanking you,
Raghuvarma.
|
|
|
|
|
Hi friends
What is difference bet
1) if (null == variableName ) And
2) if (variableName == null) is both are same ?????????
|
|
|
|
|
yogsworld wrote: is both are same ?????????
Yes, the are both the same.
The reason you might see some people using the first varient is that in some languages (e.g. C, C++), if you made a mistake and typed
if (variableName = null) by accident the compiler would accept it. (Note the single equal of assignment). By putting the constant on the left hand side of the operator the compiler would reject the assignment and the developer would realise they missed the extra equals sign.
In .NET, the langage specififcation states that the result of an if statement must be a boolean so the compiler would reject an assignment in an if statement. It will give the error message
Cannot implicitly convert type 'object' to 'bool'. If someVariable was a boolean the error message you'd get is
Cannot convert null to 'bool' because it is a value type However, there is one scenario where the compiler will accept an assignment in an if statement. That is, if the assignment evalulates to a boolean. e.g.
bool someVariable;
if (someVariable = false) {} The compiler will compile this, but issue a warning instead
Assignment in conditional expression is always constant; did you mean to use == instead of = ?
Does this help?
"On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question."
--Charles Babbage (1791-1871)
My: Website | Blog
|
|
|
|
|
hi
i didn't get your ans ... I just simply ask
difference bet if ( someVarial == null) and if (null == somevariable)
i.e position of nulll should be first or not I know both expression are evaluating same result.but if u see some code they comaore like
if (null == someVarible) i.e position of null is first why ??????
Here someVarible is an refrence type not a value type ......
YOgesh M
|
|
|
|
|
yogsworld wrote: position of null is first why ??????
I explained why. It is a historical thing. Developers who programmed in languages such as C or C++ put null first as a way of protecting themselves by having the compiler flag an error to them. The error being the accidental missing equals sign.
= means assignment
== means a comparison
These two concepts produce radically different results, yet are very very easy to accidentally mix up. Someone typing fast may miss one of the equals signs.
In C# the compiler demands that the result of the conditional expression in an if statement evaluates to a Boolean value. I demonstrated the various error messages that the C# compiler would generate that a C or C++ compiler would not likely generate.
I should clarify: Putting the null first is not completely the same as putting it second IF there is an error in the code. If the code is written correctly with the double-equals (comparison) operator then the code is the same.
Does this make sense?
"On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question."
--Charles Babbage (1791-1871)
My: Website | Blog
|
|
|
|
|
We have a system that uses Asp.net and Sql with c# as the back end, when we run the system it catches most of the RAM space,
why is this happening?
whats the solution for this problem
waiting for an reply ASAP
with regards,
KarthiBalu
|
|
|
|
|
karthiBalu wrote: when we run the system it catches most of the RAM
Because the memory manage sees that it can. If something else needs the memory then the memory manage will kick off a garbage collection and recover the memory.
"On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question."
--Charles Babbage (1791-1871)
My: Website | Blog
|
|
|
|
|
Im new in SQL, im trying to connect to sql data base but it give me exception-->(Login failed for user ''. The user is not associated with a trusted SQL Server connection.)
i think there is wrong with SqlConnection parameter, so what is the wrong?
im with sql express 2005 & vs2005
SqlConnection SQLConn;
SQLConn = new SqlConnection( " Data Source = .\\SQLEXPRESS;" + "
Initial Catalog = MTDB; " );
SQLConn.Open();
|
|
|
|
|
you did not mentioned uid and pwd.
or ty OLDDBConneciton object.
raj
|
|
|
|
|
im using Windows Authentication so what is my user id and password will be ?
|
|
|
|
|
If you are using Windows Authentication then you do not pass a user name and password.
"On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question."
--Charles Babbage (1791-1871)
My: Website | Blog
|
|
|
|
|
Does the user your process is running as (ASPNET probably) have permission to log on to the database. By default the answer is no. You must add a login to SQL Server to accept the user you are connecting as. You must also add that user to the database on the server you want to connect to.
You have not specified a user in your connection string so I'm guessing that it will just default to trying to use a trusted connection (the error message hints at this also). ASP.NET applications connect using a special locked down account (for security). That account is generally ASPNET, although on some operating systems it will use another account (Win Srv 2003 will use NT AUTHORITY\NETWORK SERVICE)
"On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question."
--Charles Babbage (1791-1871)
My: Website | Blog
|
|
|
|
|
im using Authentication: Windows Authentication, so i did not entered username or password , for this reasone i did not specified a user in my conection string, i dont know if i have to put a user , if yes i have to then what is my user will be ?
thanks
|
|
|
|
|
You might find this article useful: How To: Connect to SQL Server Using Windows Authentication in ASP.NET 2.0[^]
"On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question."
--Charles Babbage (1791-1871)
My: Website | Blog
|
|
|
|
|
the connection string should include "Integrated Security=SSPI".
that is
SQLConn = new SqlConnection( " Data Source = .\\SQLEXPRESS;" + " <br />
Initial Catalog = MTDB; Integrated Security=SSPI " );
hope this will help you.
Cheers
Ramesh.Kanjinghat
|
|
|
|
|
but your answer too late , i already did it, any way thanks
|
|
|
|
|
hi all,
ok so I have a formview thats bound to an objectsource.
within the formview, I have a listbox that I added myself.
<asp:listbox id="ListBoxObjective" runat="Server">
<asp:listitem>Item 1
<asp:listitem>Item 2
<asp:listitem>Item 3
how do I set the right value selected within this lisbox? all other
values on textboxes is being set with
Text='<%# Bind("objective") %>
but it wont allow me to put this binding on listitems.
any ideas?
thx
M
|
|
|
|
|
Hi there,
You can bind the value to the SelectedValue property of the ListBox control instead of the Text property of the ListItem.
|
|
|
|
|
Hi
I’m new to ASP and I have a problem Passing parameter to a report. I tried to pass an integer parameter to a crystal Report on a web from. So I wrote the following code:
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
Dim ParameterFields As CrystalDecisions.Shared.ParameterFields
Dim ParameterField As CrystalDecisions.Shared.ParameterField
Dim ParameterValue As CrystalDecisions.Shared.ParameterDiscreteValue
Dim DepID As Integer
DepID = 8
ParameterFields = New CrystalDecisions.Shared.ParameterFields
ParameterField = New CrystalDecisions.Shared.ParameterField
ParameterField.ParameterFieldName = "@DepID"
PArameterValue = New CrystalDecisions.Shared.ParameterDiscreteValue
ParameterValue.Value = DepID.ToString
ParameterField.CurrentValues.Add(ParameterValue)
ParameterFields.Add(ParameterField)
CrystalReportViewer1.ParameterFieldInfo = ParameterFields
Dim MyRep As New CrystalReport1
CrystalReportViewer1.ReportSource = MyRep
CrystalReportViewer1.RefreshReport()
End Sub
But It did not worked and I receive the following error:
Missing parameter field current value.
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: CrystalDecisions.CrystalReports.Engine.ParameterFieldCurrentValueException: Missing parameter field current value.
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:
[ParameterFieldCurrentValueException: Missing parameter field current value.]
. F(String , EngineExceptionErrorID
) +574
CrystalDecisions.CrystalReports.Engine.FormatEngine.internalSetReportInfo(RequestContext reqContext) +1293
CrystalDecisions.CrystalReports.Engine.FormatEngine.internalGetViewContext(ReportPageRequestContext reqContext, * viewContext) +217
CrystalDecisions.CrystalReports.Engine.FormatEngine.GetPage(PageRequestContext reqContext) +280
CrystalDecisions.ReportSource.LocalReportSourceBase.GetPage(PageRequestContext pageReqContext) +189
CrystalDecisions.Web.ReportAgent.u(Boolean N) +164
CrystalDecisions.Web.CrystalReportViewer.OnPreRender(EventArgs e) +108
System.Web.UI.Control.PreRenderRecursiveInternal() +62
System.Web.UI.Control.PreRenderRecursiveInternal() +125
System.Web.UI.Control.PreRenderRecursiveInternal() +125
System.Web.UI.Page.ProcessRequestMain() +1489
Can anyone help me??
Thanks in advance
AVA
|
|
|
|
|
Hi all,
I have a problem with WebService & WSE 3.0
When I create a web service and create a application to use my web service.
Afterward I use WSE Setting Tool to secure both my web service and application with Certificate mode (mutualCertificate11Security).
But when I start my application to call a service, this error appear:
The ex.Message as follow:
"WSE910: An error happened during the processing of a response message, and you can find the error in the inner exception. You can also find the response message in the Response property".
The Response.Fault as follow:
"System.Web.Services.Protocols.SoapHeaderException: SOAP header Security was not understood."
The InnerException as follow:
"Security requirements are not satisfied because the security header is not present in the incoming message."
Please help me solve this problem,
Thank you for you help!
Hung.
Hung
|
|
|
|
|
Hi
I have upload an ASP.net on Apachi Server. I often get the Error like
Invalid Viewstate Cleint IP X.X.X.X Disconnected.
I got a link on MSDN about this errors but can't understand how to solve this problem.
Please help me out of this problem.
Thanks in advance
Lets work it Out.........!
|
|
|
|
|
So I created a custom control.
I right click the toolbox, chose Add and it added my newly made custom control. That workd and its name appears fine on the toolbox.
So I drag the control on the form.
it produced this register tag
<%@ Register Assembly="WebControls" Namespace="ForumWebControls" TagPrefix="cc1"%>
and this html
<cc1:ForumControl runat="server"></cc1:ForumControl>
But it says the following error.
Error 11 Unknown server tag 'cc1:ForumControl'.
Error 11 Element 'ForumControl' is not a known element. This can occur if there is a compilation error in the Web site.
Does someone know something I did wrong? Do I need to register the schema or something? This works in VS2003, why not VS2005?
Thanks,
Nick
1 line of code equals many bugs. So don't write any!!
|
|
|
|