new fields in a dataset table

 i have a simple access database that I havea a dataset for , I have tried adding a new field in the mdb file itself in table1 called testfield

this testfield does not appear in the dataset designer of that table even after refreshing

i then tried to add from the dataset designer , but it did not appear in the raw database mdb file , 

how do I add fields to a database after it has been connected to via a dataset , via the datasources and dataset designer etc 

thanks

0
br3athe
8/12/2008 11:30:46 PM
asp.net.object-datasource 16182 articles. 0 followers. Follow

7 Replies
306 Views

Similar Articles

[PageSpeed] 39

I've never found a way to do this, so if someone can shed some light, so please do!

I've always had to delete the dataset using the designer, and just drag the table back over from the server explorer - that has worked for me.

James.


If this answered your question, please mark as an answer so others will know too.

http://wyerarch.blogspot.com
0
Wyerarch
8/13/2008 11:05:04 AM

 isnt this a bit of a major design flaw if this is the case , I will lose any custom queries that I have done in the designer on that table if I delete and then redrag over ...

it is normal for tables / fields to change as the end users needs change or if you miss something out when building the db , surely there must be a way of adding fields to a table without destroying what you have already? 

If anyone can say either way it would be a help 

thanks

0
br3athe
8/13/2008 11:48:14 AM

I completely agree with you - which is why I hope I am wrong!

In terms of custom queries, I always do those in SQL Server, and keep them with the database, and create methods that call them from a separate data access layer.


If this answered your question, please mark as an answer so others will know too.

http://wyerarch.blogspot.com
0
Wyerarch
8/13/2008 12:09:10 PM

Hi br3athe,

As far as I know, it's not supported in typed dataset. You can't refresh the table schema in designer panel when it has been changed in database. You have to delete the table and re-drag it.

For your custom queries, it's better to encapsulate them into a stored procedure in database. As a result, you will have no need to re-write them.

Thanks.


David Qian
Microsoft Online Community Support

Please remember to mark the replies as answers if they help and unmark them if they provide no help.
0
Wencui
8/15/2008 6:38:39 AM

 in this case I am using access which is  a pain to use stored procedures

I have flirted with datasets but am going to not be using them in the future 

I think they create another layer in the architecture of a project not simplifying the layers

In a standard sql server project you would

have your tables and stored procs in sql server 

connect to sql server and pass paramaters to the sql server to execute 

so an asp.net layer >> and a >> database layer 

with datasets you have an extra layer 

so asp.net layer >> calls dataset layer >> which calls sql server 

this dataset layer seems to be very inflexible , ie the problem above , where if you want to make changes to a table then you have to start again in the dataset designer 

to change a tables structure is absolutely normal ,  and I would think 99.99% of projects will change the structure in a table if the project has any longevity

so I am going back to connecting with a command object, in code , passing parameters and using a reader if needs be , dataset designer seems to move the programmer away from the raw code and rely on visual studios drag and drop generated xsd files which are pretty much unmanagable in terms of changing retrospectively.

the only good thing I can see about datasets was the instant strongly typed interface you got in visual studio editor , however you can even replicate this by writing your own classes for each table which would do the same , and if you add a new field in the table you simply edit the class with your new field 

Dont understand why the developers at microsoft have implemented something that is so hard to edit retrospectively of the initial design of the db ?!

 

thanks for your answers 

 

0
br3athe
8/15/2008 12:38:28 PM

Hi br3athe,

Typed dataset is designed to simplify your development, it can save the code and time. Also, it supports strong type, which can avoid the type mismatch errors in compile-time. However, as far as I know, it's not the best one for accessing data. For now, LINQ is a good choice, you may get to know that when you're free. Please go the Microsoft MSDN website and search for more information about it.

Thanks.


David Qian
Microsoft Online Community Support

Please remember to mark the replies as answers if they help and unmark them if they provide no help.
0
Wencui
8/18/2008 3:21:21 AM

I can do it with VS 2008 and SQL Server 2005. Just add new column to your your dataaset in the designer, in its Source property, type the column name of the database you want to bind to (The column name may not appears in dropdown list as it is added after the dataset is first created).

0
Liem
9/12/2008 2:16:15 PM
Reply:

Similar Artilces:

How reference field in table of dataset object??
I am having trouble referencing a field value in a DataSet object. In ASP I would do this: Session("Username") = rsMyRecordSetObject("username").value Session("Fullname") = rsMyRecordSetObject("fullname").value How do I do that with a dataset object that contains one table created with a Select statement that returns one row? : "SELECT * FROM [MyUserTable] Where UserID = 1" Thanks for your help. are we talking about datasets or recordsets, there is quite a difference especially since ado.net doesn't even have a reco...

How to update dataset (xsd) if a new field was added into based table?
I created dataset object from "Add new item" named it as myOrder.xsd. It is based a table Order. How to update myOrder.xsd if a new field was added into Order? I have to delete myOrder.xsd and then re-create it. It is kind of stupid  way. I'm afraid that stupid way is the only way.There is no conveient way in vs.net to synchronize them. hi, I think you can first update the dataset, and use the dataset up the database refer to this post update a database from a DataSet object http://support.microsoft.com/kb/307587Jessica CaoSincerely,Microsoft Online Co...

Adding a new field to a table with image field
Hi, I have a concern about adding a new field to a table with image field - which is huge. Will there be a problem with some databases, where they have a hard time locating data correctly after such a large field? Previously this happened to me, and what was advised to put all the big fields at the end of the table. Thanks.   I have not heard of such impact caused by the order of columns. When SQL search table to locate a row, it either uses table scan (when no index exists on the table) from the IAM page, or utilize indexes (clusetered/nonclustered)...

unable to extract field from dataset/dataset table
-i am trying to populate the dropdownlist from a dataset.If my dataset have a table "table1" with 4 columns as below col1 col2 col3 col41 56 xsd  asdf2 78 abc xyz - The DataValueField of dropDownList should  contain the value in col1- DataTextField of dropDownList should contain the concatenated value from col3 and col4 with space in the middle (e.g xsd asdf, abc xyz) How do i do that? - i have tried assigning the dataSource of ddl to dataTable and tried to loop thru data rows and data columns to put the values in dataValueField and Data...

Which object does remember the dataset object in .net for distribution case?
Hi, If I use dataset to connect to database server which disconnects to DB after loading the data then call open method of connection to connect again. How does the database server or certain object know which dataset it is? how does it work internally? Thanks a lot!    I am not certain exactly what you mean, but perhaps this will help.  A DataSet is a disconnected data store, it never knows nor cares about where it came from.  A Data Adapter (for the appropriate provider, such as Sql DataAdapter, OleDbDataAdapter) is required to get data into the data...

ADO.NET table fields pass to a VB.NET variable
Hi, please help, have a ADO.NET code. 1 Dim conn As New Data.SqlClient.SqlConnection 2 Dim sql As New Data.SqlClient.SqlCommand 3 4 conn = New Data.SqlClient.SqlConnection("Provider=SQLOLEDB.1;Password=dbsystematics;Persist Security Info=True;User ID=sa;Initial Catalog=SARS;Data Source=4G") 5 conn.Open() 6 sql = New Data.SqlClient.SqlCommand("select * from users", conn)   Then i would like to pass the values that the above ADO.NET to a variable.how?please help. JFRBPH12™ You can execute the ...

Adding new tables and fields to ASPNETDB and create new user wizard
I'm trying to add a new table and some fields like FirstName and LastName the the aspnetdb.mdb, so when my users register I can collect that information also. I have managed to create a 2nd table with UserID, firstname and lastname. I can get the unique userid to work in my new table but the firstname and lastname fields give me the error message below. I have modified the stored procedure aspnet_Membership_CreateUser to add in firstname and lastname. I have also created a view as with the other tables in the database. What am I missing? Any ideas would be greatly appreciated. Than...

one dataset table to multiple table dataset...
Hi,I have a dataset datatableselect ORDER ,DESCRIPTION,FIRSTNAME,LASTNAME,ADDRESS,ZIPFROM Order               I need to select only FIRSTNAME,LASTNAME,ADDRESS,ZIP and insert in to new table called CONTACTS which has identity column CONTACTKEY. Then i need to select order and description and insert in to new table ORDERS which has ORDERID as identity column with one more column CONTACTKEY which has a foreignkey relationship to order table so when i am inserting the rows for orders the same contactkey should be updated in to...

Dataset into new table
Hi All,Does anyone know how to insert the contents of a dataset into a new table (with slightly different field names)?...

Detailsview fields contain data from a table and then insert a new record in the table using that same data.
Hi Good Day,I have a detailsview that is getting data from a db, so the fields in the detailsview is already populated with data from the db; however I want to be able to change data in anyone of the fields and then insert a new record in the table in my db. ?Inorder to get the detailsview populated with data from my db i make the D.V by default mode 'edit' however when i do that and change data the existing data changes and i dont' want this i want a new record to be inserted. It i put the detailsview default mode to be insert the fields are blank and i don't want it.&n...

In XSD(typed dataset) file newly added Coloum to a table is not listed when calling dataset object
Dear All, I am working on a project using XSD files as the typed dataset.    Everything is going right but the problem is when I add a new column to the table in the XSD dataset file that added column is not listed when calling the dataset object. Can you please provide a solution, so that I am very thankful to you?  Thanks, JitendraJitendranadh Palaparthi...

DataSet.Tables.Rows vs DataSet.Tables.Columns?
I working with dynamic modification of the contents of a datagrid's cells. I have used the columns: Dim i As Integer For Each myTable in DS.Tables i = 1 For Each myColumn in myTable.Columns myBoundColumn = New BoundColumn() myBoundColumn.DataField = myColumn.ColumnName myBoundColumn.SortExpression = myColumn.ColumnName myBoundColumn.HeaderText = myColumn.ColumnName next next but recently saw an example of using the rows: For i as Integer = 0 to DS.Tables(0).Rows.Count - 1 Dim newAllFields as New AllFields newAllFields.N...

table = table object
hi, how to copy the all rows of a table to temporary table using javascript i have tried like this but it's not working ex:document.getelementbyId('tmpTable')=document.getelementbyId('baseTable'); is there any way to do this..?? thanks... icanmakeiteasy put both tables in 2 divs and do div1.innerHTML = div2.innerHTML;MAKMark as Answer if this reply helps youMVP ASP/ASP.NetASP.Net Hosting : Host DepotMy Site : ASPSnippets i have tried that tooo... not workingicanmakeiteasy you are doing right. just change thisvar tempTable ;tempTable=document.gete...

DataSet Table Field Validation
Hi- I am a newbie to ASP.NET. I have a dataset. I am using a for loop to check for field validations in the dataset table. How do I display rows which have errors in a datagrid. My code is : foreach (DataRow dr in ds.Tables["t1"].Rows) { if( dr["t1"].Equals(DBNull.Value)) { ErrorData =" t1:Null Value"; } } I want to display the row which has error in the table in the datgrid not in the textbox(ErrorData). Any help would be appreciated. Thanksabusaco You could  constuct a new dataset, that adds the error rows to it. Then you bind your new dataset to the gri...

Web resources about - new fields in a dataset table - asp.net.object-datasource

UAH satellite temperature dataset - Wikipedia, the free encyclopedia
The UAH satellite temperature dataset , developed at the University of Alabama in Huntsville , attempts to infer the temperature of the atmosphere ...

Data : Where can I get large datasets open to the public?
Answer (1 of 91): Here's the ones I've found most useful: CrunchBase, US Census, Google Public Data, Infochimps, Timetric, Factual, Freebase, ...

YouTube - Hans Rosling: Let my dataset change your mindset
Hochgeladen am 31.08.2009 http://www.ted.com Talking at the US State Department this summer, Hans Rosling uses his fascinating data-bubble software ...

The Mindset, Skillset, Dataset Approach to Social Media
... Social media is comprised primarily of unstructured data, which is difficult to analyze. A new approach called Mindset, Skillset, Dataset can ...

Sending large datasets to Amazon? Use the Post Office
Amazon has introduced a new method to move large amounts of data to and from …

IDG Contributor Network: Are datasets truly anonymized? Two well-suited researchers are going to find ...
With little fanfare or formality, Adam Smith , associate professor of computer science and engineering in Penn State's School of Electrical Engineering ...

House GOP looks to shed light on EPA secret datasets
House Republicans have introduced a bill that would block the Environmental Protection Agency from crafting regulations based on “secret” scientific ...

Google Making It Easier to Transfer Huge Datasets on the Cloud
... Cloud Import services are now in preview mode, but could later be available on a widespread basis to help enterprises move their large datasets ...

Environmental datasets, reverse auction legislation and military email
News and notes from around the federal IT community. The White House's Data.gov has added five datasets to the Ecosystem Vulnerability theme ...

Easily Manipulate Terabyte-Sized Datasets With GraphLab
Easily Manipulate Terabyte-Sized Datasets With GraphLab

Resources last updated: 12/21/2015 2:34:47 AM