Equivalent of recordset.Edit, Movefirst,NoMatch of vb6 in vb.Net? I want to fetch records from single table of database(Sql server 2005) and collect in collections. How can we do that by dataset and dataadapter ? We want to fetch not to display.
i have a listview control with two textboxes in each row. i am to fill those and save their values in one/more than one database tables using a stored procedure.
i currently create a comma-separated string (using a string builder) of all the values, and then pass it as a parameter to the SP.
in the SP i extract the values, and put them into my tables.
I'm trying to use an ObjectDataSource's SelectMethod() to retrieve a result set from a sql server database to populate a data table with various stored procs that have any given number of parameters. My approach is to pass an object which contains the stored proc name and information about its parameters into the SelectMethod(). My issue is that I don't know how to actually set the default value. Here is the code I have so far:
namespace WebApplication1 { public class Children { public DataTable Select(object storedProc) { // do stuff here and get db values. } } }
The default value of a Parameter object is a string type. Does anyone know how to set the default value with an object or how I can pass an object into the SelectMethod?
I have a partial class extending my Entity Model. I'd like to write a method that returns a collection of types from my entity framework model. For example, I'd like to get all the states to populate a drop down list. So I've written a method called getallstates(), similar to the example below:
[Code]....
I tried returning a list of Objects, and a list of states to my calling method to be used to bind to a drop down list. However I get an error that:
Server Error in Application. Unable to cast object of type 'System.Data.Objects.ObjectQuery to type 'System.Collections.Generic.List`1[System.Object]'.
I have the following code that seems like it should set my insertParameter but everytime an insert happens it uses the default parameter. Do i need to do anything special to make this work?
I got 2 listboxes in a window form, one on left and one on right. The 1st listbox have some items while the 2nd listbox is empty. Also there are 2 buttons between the 2 listboxes which used to move item from/to the 1st and 2nd listbox.My problem here is that after I bind the data to the 1st listbox (from a dataTable, using DisplayMember and ValueMember) , and I try to move 1 of the item from this 1st listbox to the 2nd listbox and I want that the selected item is also removed from the 1st listbox by:
But the selected item is not removed from the 1st listbox.Also on deselect button when i move item from 2nd listbox to 1st listbox,it displays error message "Items collection cannot be modified when the DataSource property is set."
I have a list of objects that I want to bind to a gridview. Creating that list and binding it works fine for most of the public properties in that list.
There are some objects contained in each of those objects... for instance there is an Address object.
object.Address.Line1;
object.Address.Line2;
When I bind this to my gridview, I have no issues with stuff like object.DateRegistered, but how can I access things like object.Address.WhatEverProperty? I always get this error:
"A field or property with the name 'xxx.xxxx' was not found on the selected data source."
I have an ASP.NET app with lots of textboxes all over the page that need updating at various points through program execution.
These textboxes actually belong to a certain class, so for easy updating I thought I could create a Dictionary(Of string, object) and add the control.ID and the control to it and then for updating do something like this:
(in case of updating textbox.text):
[code]....
However the text property of the textbox does not actually get updated. I'm mainly trying to avoid having to manually do textbox.text = somestring for each one of my textboxes every time I have to update them.
I have following two collections,1. CategoryList, 2. ItemList. I need to get the collection which contains the rows shown in below in "Expected Result List".could you please provide me the LINQ query on collections to get this resulted List?
I have a gridview in which dtasource binded is a List which returns class type. If no records in list, I want to display 'No records found' in GridView.
[code]...
In else part, what code i have to write to get desired output?
I know that if I have set a cookie on a previous request, it will show up in my Request.Cookies collection. I want to update my existing Cookie. Are the cookies from my Request.Cookies collection already copied to my Response.Cookies collection? Do I need to add a new cookie with the same key using Response.Cookies.Add(), or do I need to use Response.Cookies.Set()?
I'm using HttpModule to capture requests to the web server. Before processing the page I'd like to check the values contained in some keys of the Request.Form collection and according to some logic change if necessary. I'd like to do this when BeginRequest event is fired. The problem is that the Request.Form collection is readonly.
i have a lable a textbox, and two buttons(+ and - button) on my asp.net page.
so when i click on the plus button it should add the the whole collection of controls to the page(i.e. lable, textbox and two buttons). And when i click on minus button it should remove the collection.
This should go on.meaning whenever i click on any plus button the control collection should get added to the page.
I am wondering what will be the best approach to do it.
I am getting this error after I add <head runat="server"> The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).