Using A Grid That Isn't Related To A Datasource?
Jun 10, 2010
What i want to do is have a grid i can add rows and columns and cells. each cell i want to have an image button in. I want to do this in a windows form. Is this posible? I was looking into the gridview/datagridview but that wasn't what i wanted.
View 1 Replies
Similar Messages:
Mar 5, 2010
Inserting Related Entities?
View 14 Replies
Jun 30, 2010
I'm getting some Xml back from a service. I would like it to be the datasource of a grid view on my aspx page. Here is a sample of the Xml
<?xml version="1.0" encoding="utf-16" ?>
<ArrayOfTripTollCompleteDC xmlns:xsi=[URL]"
xmlns:xsd=[URL]>
<TripTollCompleteDC>
<TripTollId>5</TripTollId>
<DMSLaneModeID xsi:nil="true" />
<HOVOnly>false</HOVOnly>
<CreateDateTime>2010-06-07T15:54:01.023</CreateDateTime>
<ConfigVTMSDelaySeconds>5</ConfigVTMSDelaySeconds>
</TripTollCompleteDC>
and here is my code that parses the xml and tries to bind the grid. What am I missing here?
var retVal = service.GetTripDetailsByTripID(tripId);
var xmlTrips = XDocument.Parse(retVal);
var tripTolls =
from t in xmlTrips.Elements("TripTollCompleteDC")
select new {
TripTollId = (int)t.Element("TripTollId")
, DMSLaneModeID = (int?)t.Element("DMSLaneModeID")
, HOVOnly = (bool)t.Element("HOVOnly")
, CreateDateTime = (DateTime)t.Element("CreateDateTime")
, ConfigVTMSDelaySeconds = (int)t.Element("ConfigVTMSDelaySeconds")
};
grdTripDetails.DataSource = tripTolls;
grdTripDetails.DataBind();
I realize these are anonymous types. Is that a problem? I have verified the service is returning the Xml as stated above. Can anyone out there point me in the right direction? Just for completeness, here is the grid markup <asp:GridView runat="server" ID="grdTripDetails" />
View 1 Replies
Jun 2, 2010
I have the folloing sql server error from my ASP.NET website.
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
This seems to be a network related issue. But on the same machine where IIS is running, I have another C# application running that is not experiencing this problem. This happens after the website has been running for a few weeks. Will this be because the database connections are opened but not closed properly?. I wrote a test web page where i just open connection but not close it and I got Time out error when connection pooling is maxed out. Is this memory issue? Memory that are allocated are not deallocated in timely fashion?..
Everything is working fine for a few weeks and after that I get the above network error.
View 2 Replies
Feb 28, 2011
I have a formview with an entityDataSource. I need to include columns from related fields. I have seen many demos, with AdventureWorksDB, that imply that you can do this by using INCLUDE in the entitydatasource declaration. I have tried made many attempts and it just does not seem to work as demonstrated. I have attached the errors below and the EDS. I have also attached a JPEG of the model I am working in. Three errors demonstrating 3 different attempts to include a related table:
DataBinding: 'TmModel.tbICObjectBase' does not contain a property with the name 'Group'
the code declaration for error 1:
<asp:Label ID="Label1" runat="server" Text='<%# Bind("Group") %>' />
DataBinding: 'TmModel.tbICObjectBase' does not contain a property with the name 'tbICTagBase'.
the code declaration for error 2:
<asp:Label ID="Label1" runat="server" Text='<%# Bind("tbICTagBase.Group") %>' />
DataBinding: 'System.Data.Objects.DataClasses.EntityCollection`1[[TmModel.tbICTagBase, TmModel, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]' does not contain a property with the name 'Group'.
the code declaration for error 3:
<asp:Label ID="tbICTagBasesLabel" runat="server" Text='<%# Bind("tbICTagBases.Group") %>' />
EntityDataSource
<asp:EntityDataSource ID="entDSObjectBase" runat="server" AutoGenerateWhereClause="True"
ConnectionString="name=IntouchDBContainer" Include="tbICTagBases"
DefaultContainerName="IntouchDBContainer" EnableFlattening="False"
EntitySetName="tbICObjectBases" EnableDelete="True" EnableInsert="True"
EnableUpdate="True" EntityTypeFilter="tbICObjectBase">
<WhereParameters>
<asp:SessionParameter SessionField="Tag" Name="RecID" Type="Int64" />
</WhereParameters>
</asp:EntityDataSource>
You can see the model at [URL] Or [URL]
View 3 Replies
May 5, 2010
How to delete related data.
Ex:
Tables:
1) Account: ID,UserName,Pass
2) Campaign: ID,AccountID,Date,Balance
3) CampaignSpec: ID,CampaignID,Spec,Color
Note: Account.ID = Campaign.AccountID and Campaign.ID = CampaignSpec.CampaignID
View 1 Replies
May 17, 2010
I want to get record count from below example.
I made two tables. One is club_info and another one is club_members.
And each table has data like following
[club_info]
club_id
club_name
:
[club_members]
mem_id
club_id
:
I want to get club_name and the member count for selected club_id and want to return the result as sqldatareader.
View 8 Replies
Mar 19, 2010
Let say you read a customer record into Customer object. Do it read all the related records across tables at the same time Or it only reads when you do from o in customerobject.orders
View 2 Replies
Jun 8, 2010
My dataset table data is from multiple tables (showing on a gridview),How to update the database tables using batch udpate on clicking submit, if the data is from a signle table, no problem, but I am not sure how to handle if the datais from mulitiple tables? If I have related tables, do I need put them in differet tables in the dataset?
View 6 Replies
Jan 19, 2010
I have a basic CMS which I'm adding to a site to display some downloads organised into groups. I have two tables, one for the groups and one for the downloads. I'm using a repeated to display the groups with another repeater inside to display the children. This works perfectly.
However some of my download groups may not have any downloads related to them and I'd like to handle this by filter the groups so that only those with a relate download record(s) are shown.
I'm trying to do this with the query which populates the top repeater based on some ideas I read but I must be going wrong with the syntax.
Here is what I'm using to try and only select downloads groups which have downloads linked to them by the download group ID.
[Code]....
Can anyone offer any thoughts on how I should construct the query to perform this?
View 1 Replies
May 21, 2010
I am using Asp.Net MVC 2.0 for creating a user and assigning properties to the user at the same time. I am using my Windows account to access database on my local computer. I am using pre-installed MVC code o create a user with unique user name and password. User is created OK. Then I want to add profile properties like First and Last name at the same time.
I am creatingProfileBase object:
ProfileBase profileBase = ProfileBase.Create(profileInformation.UserName);
where profileInformation is a RegisterModel and has user info.
When I am trying to:
profileBase.SetPropertyValue(.....);
I am getting the following error # 2147467259 A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Shared Memory Provider, error: 40 - Could not open a connection to SQL Server)"}
Why is my connection string works fine the first time and not working now? And how to configure connection to use TCP-IP?
I have SQL Server Browser running ander Local account and openned port in my Firewall.
View 4 Replies
Mar 30, 2010
I have- empId - PK, CurrentUserId in one table,mpId- FK in other table.now i want to get empId of related currentUserId ,and want to add empId in other table having FK,using Repository,what will be in create method?
View 4 Replies
Apr 22, 2010
Following is the error I am getting while accessing some of the pages on my website.
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections.
(provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
It is trowing an exception and giving the about mentioned error.
View 5 Replies
Feb 28, 2010
i get error A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: TCP Provider, error: 0 - No connection could be made because the target machine actively refused it.)
View 4 Replies
Jan 16, 2011
i have one grid and one button when i click on that button then it expand and showing another grid under the row of parent grid how to do that.
View 2 Replies
Jul 30, 2010
I need to set a dictionary as datasource to a GridView. The dictionary contains objects with for example the attributes start and finish. I have only found information about connecting datasets, resultsets, sql adapters and so on to GridViews. The GridView im trying to present my dictionary with, should also be editable, but I guess the NO1 issue is to just connect it.
View 2 Replies
Jan 21, 2010
Im trying to display many to many relationship in a grid, with entity framework
I have Users and Roles, how would i display that in a simple grid with a column for Username and a hyperlink column for Roles divided by a space.
View 1 Replies
Feb 21, 2010
Is it possible to get a Activity, year, monthly pivot from a table for a clientID? And I need to show it in a control (grid or ?)
My table has tblActivities (ActivityID, ActivityDate, ClientID)
And I have a lookup tblLookupActivities (ActID, Activity)
I need something that looks like:
Activity | Year | Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Nov|Dec|
CPR | 2007 | 1 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 3 |
Jump| 2008 | 2 | 1 | 1 | 1 | 0 | 2 | 1 | 1 | 0 | 0 | 0 | 1 | 3 |
View 2 Replies
Apr 22, 2010
I have a grid which displays a set of columns and I m trying to display only those rows in grid based on the options chosen or searched.
I filter options are
1) search for (textbox) - search from (listbox with columns product, product id , userid )
2) Date filter - choose 1 checkbox out of 3 checkboxes(create Date, submit date, Approve ) and whateevr is selected for the criteria we choose between date from and to calender.
3) Status - listbox with status ID 's Basec on this three filter options I need to frame a LINQ to SQL query that gives me results in grid any option can either be choosen or can be left blank I am using 3 - tier architecture and passing all this fields as parameters in a method from UI.cs to UI.DAL where I am writing a query to generate grid view rows. I think I need to use Dynamic LInq and I have not done that before !!
View 2 Replies
Feb 8, 2010
I have to in sert the gridview values into database, the values can be single or more than one values, so here i have to use the XML to store the data, but my question is?
i have to sent the values as a string, to the database, so how i convert that, and how could i retrieve the values as it is, and stored or display to the another gridview.
im using asp.Net 2005
View 4 Replies
Dec 7, 2010
How to create a Grid view with 3 blank Row without any Datasource or use (Datatable ) in code behind
it means
Sl.no ID Name
1
2
3
it means no blank ID ,Name
View 8 Replies
Jan 12, 2010
I have been chasing this erorr all day and coming up blank. I created a stored proceudre(fairly complicated logic), added it to the context, and set the return type to a specific entity type.
It generated this:
[Function(Name="dbo.usp_ServiceTemplateSelectByFkID")]
public ISingleResult<ServiceTemplate> usp_ServiceTemplateSelectByFkID([Parameter(Name="FkId", DbType="Int")] System.Nullable<int> FkId)
{
IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())), FkId);
return ((ISingleResult<ServiceTemplate>)(result.ReturnValue));
}
I call it from my service with the following method:
public ISingleResult<ServiceTemplate> GetByFkId(int FkId)
{
return Db.usp_ServiceTemplateSelectByFkId(FkId);
}
I have tested the stored procedure and it returns the results I want. When I make the service call from the controller, it doesn't error out, however, it should return 4 records in this instance and instead, it returns the same 4 records (repeating the first record 4 times).
In addition, in my controller code, I am using the MVCContrib ToPagedList() method which doesn't appear to work with the ISingleResult interface (forward only cursor, I'm guessing). I have attempted converting the service results to IQuery, List, and Array, however, I still have the problem with the first record being repeated 4 times.
View 3 Replies
Mar 10, 2010
Not sure if this is for SQL or .net! I have 3 tables which looks like
table1
ID Name
1 Jon
and
table2
ID Number Job
1 1 IT
2 1 Web
3 1 Admin
table1
ID ContractType
1 Temp
1 Perm
An inner join makes one table with 3 rows (I excluding the ID from table 2 for the join) which is saved as a view
viewTable
ID Name Number Job ContractType
1 Jon 1 IT Temp
2 Jon 1 Web Temp
3 Jon 1 Admin Temp
4 Jon 1 IT Perm
5 Jon 1 Web Perm
6 Jon 1 Admin Perm
I want to display these results on a web page via the grid view. However, I don't want to show the user 6 times! I want to show the user name once, the contract type once and each Job! What is the best way to do this? Is there a fault with the database design already? I assume the easiest answer is to not join them in a view but query each section 3 times from the website but I'd rather 1 connection only!
View 10 Replies
May 19, 2010
Problem in YUI:I am using YUI grid,my dataset contains some special character.i bind my dataset into the grid,but its not displayed in my grid? how to solve this
View 1 Replies
Nov 10, 2010
I have 50000 record in two tables which need to show in grid? and the records in the table use to insert , update and delete frequently. I need to load fast all the records. which method i should bind to get as quick as early as possible. Which z best method to bind whether using SQL datasource, creating views, using datatable, creating stored procedure etc?
View 8 Replies