visual studio 2010 - Change the default behaviour of NullValue in a DataSet -


i have used .net mysql connector import dataset of mysql schema visual studio.

visual studio has generated *.xsd file me visual representation of tables, , fields within tables in schema.

i running queries against these tables using linq.

by default, nullvalue property of every field in every table set (throw exception). means in practice if apply criteria column contains null values in query, exception thrown when try enumerate through results shown below:

exception

the easy way fix change nullvalue property of particular column either (null) or (empty), have lot of columns in lot of tables , changing of these 1 @ time pain. can't use shift key select columns either, (null) , (empty) values apply reference types , nullable value types, if, example, selection contains single integer, none of properties updated.

is there option in visual studio change default behaviour of nullvalue property on column in datatable across board?

thanks

  1. in solution explorer, right-click on .xsd file
  2. select "open with..."
  3. choose "xml (text) editor"
  4. find field you've set "(empty)" or whatever want "default" value , review of syntax of msprop:nullvalue such msprop:nullvalue="_empty"
  5. use text search-and-replace (ctrl+h default) modify rest of nullable field xml tags in file. 1 way find standard column tag , add it. example, find msprop:generator_columnpropnameintable , replace msprop:nullvalue="_empty" msprop:generator_columnpropnameintable
  6. after done making replacements, ensure sure have 1 instance of msprop:nullvalue attribute per column or you'll have dataset syntax error
  7. save file , close it
  8. double click on .xsd opens in xsd designer , save ensure have no syntax errors , designer.cs files updated.

Comments

Popular posts from this blog

c# - SVN Error : "svnadmin: E205000: Too many arguments" -

c# - Copy ObservableCollection to another ObservableCollection -

All overlapping substrings matching a java regex -