473,394 Members | 1,960 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

DataSet designer won't let me set GenerateDBDirectMethods to true

Hello,

I am trying to persuade VS2005 to let me use a DataSet to insert to a
table. I add a DataSet item to the App_Code folder, and the wizard comes
up. I go through the steps, but when I get to the step where it asks if
I want to fill or return a datatable, the third option, to generate
methods for insert, update and delete is greyed out.

According to MSDN... "This option is unavailable when the original SQL
statement does not provide enough information or the query is not an
updateable query. This situation can occur, for example, in JOIN queries
and queries that return a single value (scalar)." I can't see how this
is relevant as I tried it with the simplest of SQL queries.

The really weird thing is that some of the tables in the database allow
the option to be set, and some do not. I have stared stupidly at these
tables trying to spot some difference, but I can't.

Anyone any ideas? TIA

--
Alan Silver
(anything added below this line is nothing to do with me)
Jul 20 '06 #1
1 3522
In article <B3**************@nospamthankyou.spam>, Alan Silver
<al*********@nospam.thanx.invalidwrites
>Anyone any ideas? TIA
In case it helps anyone, I discovered that if you use "select * from
table" for the SQL, it works. You can then look at the properties of the
adapter, and open the query builder for the select command. This will
replace the * with the field names, at which point you can either just
save it, or edit the field list and then save it.

Having said that, I did discover further that you don't actually need
this feature at all. Once you have the adapter set up, you can just add
a new query, set it to be an insert and it will create a nice method for
you. Much easier, and it only creates the methods you want, rather than
extras that you don't want.

I still think the behaviour I observed was a bug, but I'm not going to
bother with it.

HTH

--
Alan Silver
(anything added below this line is nothing to do with me)
Jul 20 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: John Holmes | last post by:
I have a web interface where the user types in ID's one at a time. After an ID is typed in, a button is clicked and the button click event has code that does a query and returns a data reader and...
1
by: Wil | last post by:
I'm very new to developing in .NET and even newer to XML. The past few days have been pretty frustrating for me because I'm trying to perform a transform on data in a dataset and it's not working....
8
by: drg | last post by:
I have a DataSet with a DateTime field. I am using an EventRow r, to update it with values from a TextBox in a DataGrid. Suppose a DataGrid in edit mode had a field with value: 7/7/2005. Then the...
12
by: Bishoy George | last post by:
I have a dataset called ds1 filled with 2 tables Employees and Customers from Northwind database. I have dropdownList called ddLastName with the following properties: ddLastName.DataSource =...
2
by: Steve | last post by:
I would not have thought that getting a DataGrid connected to a DataSet (read in from an XML file) would be this complicated. I cannot get this to work. I have read everything I could find and...
12
by: chreo | last post by:
I GIVE UP...I can't refresh datagrid (dataset) I have datagrid = dgrPaczki Datasource of that datagrid = DataSetPaczki1.PACZKI_PAKOWALNIA (forgive me Polish words) Dataadapter which fills my...
2
by: Nick Hustak | last post by:
Hi, I've been trying to work with the XSDs and ran into a few road blocks. 1. Stored procedures that uses temp tables, i.e. #TempTable. The wizard complains that #TempTable is an invalid...
5
by: Monty M. | last post by:
Hello; I was wondering if anyone can assist me with this problem. Here are the tools I am using: Language: C# Database: MS SQL Server 2000 Application: Visual Studio 2005 1. I have a...
4
by: Matt F | last post by:
I have an application that utilizes a dataset. I've found just today, that if the regional language settings are changed at the point of where I instantiate the DataSet an error is thrown of:...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.