Last post Feb 03, 2011 11:03 AM by Mauro_Ruiz
Feb 03, 2011 05:49 AM|Mauro_Ruiz|LINK
I´m a real beginner in ASP.NET and Databases; I´ve attended a programmers course few years ago, but at the moment I m not good enough!!!
This for my is a new beginning! :)
Now I´m involved in a project that requires MySQL interaction, and I´m designing (or programming) the front end interface.
SCENARIO: I´ve a MySQL database. (Now... Imagine a Webpage.aspx). I have a table inside the page with 2 rows: The first row has 3 columns... yes, cells!!, and the another one has no columns. In the first cell (1 row, 1 column) I have a treeview with a panoramic
of my database (Treeview-Datasource: XML file that I build by myself with the hierarchy of my database).
Then, in the 2nd cell (1 row, 2 column) I have a Radiobuttonlist; the aim of this cell is show only the name of every data placed in the selected entity (located in the treeview). And in the third cell (1 row, 3 column) I have 3 buttons:
the first one is "NEW" (Should create a new item in the entity of the database - selected in the treeview)
the second one is "EDIT" (Should edit the item of my database_entity selected in the radiobuttonlist)
And the third one is "SAVE"... (No words!!)
PROBLEM: In the fourth cell (2 row, unique column)I have a FormView. To fill data, to arrange it in two columns, and to show textboxes allowing me introduce information to perform
the button actions.
I´m new in this, but I´ve seen that probably, I can make it using views (programming them in the database) or using XML files (declarating and querying my database as well as I want)
But, in any case, the two ways requires build a view or xml file for every entity of my database that I want modify.
I´m Sure that all of us know a short method or something... but please!! I need help... I have only 20 days to do that!!!
Feb 03, 2011 06:41 AM|Mazenx|LINK
Use database , xml isnt for saving forms data , it's used for configurations and data that'll change very rarely
databases also will give you constraints on your data for better integrity.
Feb 03, 2011 07:27 AM|Mauro_Ruiz|LINK
Thanks a lot for the answer, but
Did you mean database views?
Am I developing in the right way?
Thanks thanks for all!!!
Feb 03, 2011 07:33 AM|Mazenx|LINK
database views means sql server or oracle database view
something like this create view <ANY NAME>
is this what you mean ??
as this thing doesnt save data , it only retrieves data.
Feb 03, 2011 07:44 AM|Mauro_Ruiz|LINK
Yes.. actually, create views in MySQL (Create view <> ... ), and then call them (views) in ASP.net or VB.net and modify SOME camps of the entity
Is that possible?
Feb 03, 2011 07:47 AM|Mazenx|LINK
mmmmmmm I am not sure but views updating data is very advanced level , but if that's what you are using then for sure it's better than xml , but you can use direct update on your tables , not sure why you want to use view to update what you want.
Feb 03, 2011 07:55 AM|Mauro_Ruiz|LINK
It´s becasuse there are some columns in my entities that I don´t want to show!!!... for example:
I have an entity called Oscilloscope, see below:
SET('Parallel port','Serial port','VXI','LAN','USB', 'GP-IB','LXI','PXI','PCI','Serial bus')
Parallel port, VXI, LAN, USB, GP-IB
ENUM (‘Sa/s’, ‘‘kSa/s’’, ‘M_Sa/s’, ‘G_Sa/s’)
E.g. 500MHz, 1GHz
ENUM (‘Hz’, ‘kHz’, ‘MHz’, ‘GHz’, ‘THz’)
Max. input voltage
E.g. bus analyzer, current probe
But, in my front end, I dont want perform any action on Oscilloscope ID, Last_update, Price, Reference number, BUT, in the another atributtes
I want update them (Frequency range,voltage, and so on) whit the buttons previously showed!
Thank s a lot again!
Feb 03, 2011 08:01 AM|Mazenx|LINK
I am not so familiar with mysql views but if you wanted to update all columns then you'll create another function , so what you do is that you create one function that updates everything but you send null values to your function and it doesnt update values
with null columns , anyway do what you feel suitable , and if you want to test performance between views and xml exactly you can write this code to measure time taken
System.Diognastics.StopWatch stpWatch = new System.Diognastics.StopWatch();
long x = stpWatch.ElapsedMilliSeconds;
this shows u exactly how much time it took , but perform thousand to 100,000 updates to feel true difference.
Feb 03, 2011 08:04 AM|Mauro_Ruiz|LINK
OK.. I will do it... I will try programing a single function for query my database and then with XML...
Thanks a lot!!!!...
Feb 03, 2011 10:31 AM|Lannie|LINK
Views of single tables can be updated in the view.
Views with multiple tables by JOINS, each table has to be updated one at a time.
So just update the data table directly and not mess with updating the view,
and the view will be refreshed with the new data when the view is opened again.
XML the great promise of data portability, etc.... NOT.
I have used it for small number of rows, static lookup values, like a system setting.
Feb 03, 2011 11:03 AM|Mauro_Ruiz|LINK
Hey... Lannie.. thankssss...
I was reading something about the difference, but now I will focus only in data views and routines!!!... you, and some others
comments that I´ve found were helpfull and were pointing to the same point (work only with the database!!)!!!!...
I will respond when it works!!!...
Thanks!!! : )