|
Hi, I am using the following code to display the contents in gridview. but it displays only the headings not its contents. Please help me what i did wrongly.
Code .aspx Page
<asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="false">
<Columns>
<asp:TemplateField HeaderText="Employee Id">
<ItemTemplate>
<asp:Label ID="lblEmployeeId" Text='<%Eval("EmployeeId")%>' runat="server"></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Last Name">
<ItemTemplate>
<asp:Label ID="lblLastName" Text='<%Eval("LastName")%>' runat="server"></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="First Name">
<ItemTemplate>
<asp:Label ID="lblFirstName" Text='<%Eval("FirstName") %>' runat="server"></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Title">
<ItemTemplate>
<asp:Label ID="lblTitle" Text='<%Eval("Title") %>' runat="server"></asp:Label>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
.aspx.cs Page
(created db connection to access and load query in data adapter and filled dataadapter into ds after that).
GridView2.DataSource = ds;
GridView2.DataBind();
Thanks in advance.
Regards,
Pryan data adapter and filled dataadapter into ds after that).
GridView2.DataSource = ds;
GridView2.DataBind();
Thanks in advance.
Regards,
<div class="ForumSig">Prya</div>
|
|
|
|
|
replace Text='<%Eval("fieldname")%>'
with
Text='<%#databinder.eval(container.dataItem,"fieldname")%>'
u will get the content on teh grid
yuvaraj
|
|
|
|
|
hi yuvaraj,
Thank u so much. Its working. But a small doubt for me, is when we have use Only Eval("fieldname") instead of #databinder.eval(container.dataitem,"fieldname").
Regards,
Prya
|
|
|
|
|
hi,
Thanks.
now gridview is displaying all the contents. and i added extra commandbutton for edit as <asp:CommandButton Headertext="edit" showeditbutton=true> like this. but in runtime when i click edit link it displays error: Gridview Gridview1 not handled any rowediting event.
Please guide me how to add rowediting event and how to update the editions.
Thanks in advance,
Regards,
Prya
|
|
|
|
|
iam using .net 2005 in atlas and iam getting problem for image uploading
regards
sunil
Sunil Tvl
|
|
|
|
|
And the problem is...?
---
It's amazing to see how much work some people will go through just to avoid a little bit of work.
|
|
|
|
|
that narrows it down.
It could be....
|
|
|
|
|
Hi All,
Can we send Query String to IFRAM page if yes then how.
|
|
|
|
|
Yes. Just include the querystring in the URL.
---
It's amazing to see how much work some people will go through just to avoid a little bit of work.
|
|
|
|
|
Hi,
When trying to connect to sqlserver 2000 I am getting this error. I am having Windows 2003 server, VS.NET 2003, Sql Server 2000 in my machine.I tried lot of articles but no use.Can anyone help me ?
Thanks in Advance
Phanindra...
|
|
|
|
|
HI Kumar
Go to SQL server 2000 enterprise manager and expand sql server group under your server name will display.right click on that server name ,choose properties and select "Security Tab".in that Security tab choose Authentication as "SQL server and Windows"
Regards
RPL
r_palanivel83 10:01 4 Jan '06
|
|
|
|
|
Hi,
Thanks for reply. Eventhough I changed authentication type from 'Windows' to Mixed mode, I am getting the same error. But when I am trying to remove identity impersonate="true" in web.config i encountered a different error like:
Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection.
Any help in this issue ?
Thanks
Phanindra...
|
|
|
|
|
HI
Create a new User for your database and give the permission for all tables and sp's for that user.
-- Create New User
Expand your Server on SQL enterprise manager,Open Security->Logins. Here u can create a New user for your database
after that u have to set userid, password for your connection(trusted SQL mean Userid,password must)
Regards
RPL
r_palanivel83 10:01 4 Jan '06
|
|
|
|
|
Hi,
I had done everything you said. But the problem persists. I am getting the same error "Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection.". When i am trying to use the same connection string in another application it is working fine. I am confused!
Thanks
Phanindra...
|
|
|
|
|
HI
check your IIS Configuration is Anonymous.if it is checked this problem should go
Regards
RPL
r_palanivel83 10:01 4 Jan '06
|
|
|
|
|
I checked both the anonymous and integrated authentication. But no use. I also tried without integrated authentication.
Thanks
Phanindra...
|
|
|
|
|
Here I want to replace string.
e.g My string is
"Add new message in newthing"
here I want to replace "new".But when I used string.replace then it replaces
"newthing" also.In short I want to replace whole word.
Swapnil Bhavsar
|
|
|
|
|
Do the replacement using a regular expression for the word, where you add the word boundary code before and after the word:
theNewString = new RegEx("\\b" + RegEx.Escape(theWord) + "\\b").Replace(theString, theReplacement);
---
It's amazing to see how much work some people will go through just to avoid a little bit of work.
|
|
|
|
|
Hi, I am creating a forum and I am in great problem. I need to make an access that the users can upload their picture as a logo of their names. How can I make this happen? They upload their pictures and the picture I want it to be saved in their profile.
Any help pls?
Adrian De Battista: .Net Programmer, Java Programmer and Web Designer.
|
|
|
|
|
|
This must be homework since the exact question has been posted my a few different people.
|
|
|
|
|
Hi,
How can i send a parameter from my ASPX form, to a RDL Report?
Thanks.
|
|
|
|
|
I know that when there is a postback, id's for dynamic controls get re-created and they change. i know that we all get null reference exceptions when we try to retrieve them. I only have one problem that i tried looking for a solution on google but havent found it.
I have a aspx page with a list of link buttons databound to a collection taken from a database. on the right of that is a user control.
In that user control i have all these properties where GUID's are assigned every time some clicks buttons to re generate a new form to display. I get that null reference exception when i try to retrieve the values of the controls before the form is generating a new form. I tried re creating the fomr using the ID's i have now (in properties) but still get the same error that i could not generate my form because my id's were null?
I am stuck from here and dont know where to go. Does anyone have a hint of what i can start doing to get myself going?
|
|
|
|
|
You will never be able to reference an object that has not been instantiated. Try using the object after the form has been created.
|
|
|
|
|
I would like to create a .net SOA web service through Visual studio IDE 2005. Is there any sample available on the web.
I don't want SOA concepts. I need practical sample or How to type answer based on PEACE.
Thanks in advance
|
|
|
|