|
enipla wrote: if I pan across the different columns, I get an error "System.ArgumentException: Parameter not valid. Apparently I have a datatype it doesn't like.
Or a datatype mismatch between the datatable column and the column in the datagridview.
Also check the pre-existing schema on the ADR_BASE datatable. Just a wild guess, but if you populate it somewhere with another tables data, it could lead to problems like this.
enipla wrote: I really want to thank you for you quick responses
No problem, glad if it helped
|
|
|
|
|
The Customer Specified and Suggested this configuration. I do not have to do it that way as long as is completely free and NoLicenses are requires. The end user must have the ability to retrieve data from the LocalDatabase at any time. The Database must be updated locally after each use or run and must all be available globally to the other 11 local machines (tester) or a master or supervisor machine (Tester) MASTER1 which is updated with all the other 11 localMachines (Testers) as well as its own local data. All records must be updated after each Machine (Tester) Cycle or the Next time that the machine (tester) is turned on it needs to update accordingly. Backups will be done locally on each machine at some specified frequency defined by the customer. Each machine has its own Unique Results and 1 Master or allMust have the others information avalaible to them to Query. I have the Database Created in MS Access for the first machine Tester) but the Customer will not accept it because it Requires Office or Licensing to be installed on 12 PC Platforms. SQL Server Express 208 willnot allow you to import a Database from MS Access and Save it as a SQLServer Express 2008 Database. Hope you can help.
Regards
BC
|
|
|
|
|
BobClarkSQL wrote: The Customer Specified and Suggested this configuration. I do not have to do it that way as long as is completely free and NoLicenses are requires
So, do you have an option to use only one cenralized database?
Also is the network reliable all the time (this question actually included in the previous) or do you have to prepare for network failures? Since you have testers, I take it that information from the test run must reliably saved.
|
|
|
|
|
As long as it is free and each local machine can get its local results as well as all the other 11 platforms data and Query each other and it is fre and seamless to the end user it really doesn't matter. It does not have to be fast it just need to be reliable and accurate. Any strategy that can accomplish this for fre is acceptable as long as local and master results can be received from each local machine.
|
|
|
|
|
But in that case, the question is only in data modeling. Create a single database and the necessary tables. In those tables record the tester name (or whatever is the way you separate them). This way everyon can have own results as ell as they can use others results.
For example, if you have a table Measurement, it could have columns like:
- MeasurementID, int, primary key, not null
- Tester, int, not null, reference to Tester table
- MeasurementTime, datetime, not null
- MeasurementType, varchar(100), not null
- MeasurementResult, int, not null etc.
So when fetching results from a single tester you would restrict the query to only single Tester. But if you want to use other tseters, just modify the WHERE-clause.
And what comes to the database, you can use Sql Server 2008 Express Edition. Just not that Express edition has these limitations:
- 1 CPU
- 1 GB memory
- 4 GB of data per database
|
|
|
|
|
Hi everybody,
I've just switched to VB .NET 2008 from MS Access 2007
I'm working as an applications developer for a number of companies. I make programs that access big databases through the Internet (by big, I mean a large number of rows)
In Access, connecting through the internet was so smooth since it reads only the current record while allowing searching, filtering, updating, etc...
When I used VB .NET, I found that the dataset is filled with all the records up on loading the form, and this would make the program extremely slow (it will take 10minutes+ to start!!!)
I read about using a datareader, but, does the datareader allow full sorting, updating, and filtering just like the dataset?
In a simple sentence, how can I implement the same data access model of MS Access?
Thank you.
|
|
|
|
|
The idea is a bit different than in Access. You use for example SqlCommand in which you set the statement for your query. In that statement you restrict the rows you want to fetch i.e. you have a WHERE clause. DataReader is intended just to read the data what SqlCommand retrieves.
I suggest that you get familiar with the ADO.NET concepts. You could start for example here: Introduction to Data Access with ADO.NET[^] and Retrieving and Modifying Data in ADO.NET[^].
With a little bit of reading I'm sure you'll easily discover how powerful the whole ADO.NET is compared to Access for example.
|
|
|
|
|
Thank you for your reply
First, I've no doubt that ADO .NET is much better than MS Access
But, the only thing that I want to implement is that to make my program read only the record that I'm viewing currently on the form (or may be read no more than 5 records in order to decrease the number of reads to the database server).
What's the easiest method for implementing this?
BTW, using the SqlCommand while limiting the number of records is not the thing that I want, for example, if I use it to read 10 rows only, then only those rows will be displayed in the form, and this is not correct in my case...
|
|
|
|
|
fifothekid wrote: the only thing that I want to implement is that to make my program read only the record that I'm viewing currently on the form
This depends how you bind the data to your controls, but lets concentrate on the data fetching from the db only. If you for example want to get the data for customer which has ID equal to 5, you could have something like:
using (SqlConnection connection = new SqlConnection(connectionString)) {
SqlCommand command = new SqlCommand("SELECT * Customer WHERE ID = @Id", connection);
command.Parameters.AddWithValue("@ID", 5);
connection.Open();
SqlDataReader reader = command.ExecuteReader();
reader.Read();
...
It would perhaps be easier to use SqlDataAdapter and fill a datatable which then again is bound to the controls in the form.
fifothekid wrote: using the SqlCommand while limiting the number of records is not the thing that I want, for example, if I use it to read 10 rows only, then only those rows will be displayed in the form, and this is not correct in my case
I don't know which kind of UI structure you have in mind. If you have somekind of list of for example customers in your app, you would get the list first. When selecting from the list, you would fetch that customer only to a new form. Fetching the list and fetching the individual customer are separate operations and would most likely be implemented differently. If you fetch all the customers with all their fields to the list and pass the row to the form, you would end up to problems exactly like you described.
|
|
|
|
|
Hi i have a table with three columns
col1 col2 Result
1 4 null
2 2 null
8 3 null
6 5 null
Now i want to add col1 & col2 and insert in to column "result"
the ouput should be like this
col1 col2 Result
1 4 5
2 2 4
8 3 11
6 5 11
How to write query for this in sqlserver?
G. Satish
|
|
|
|
|
I guess its another homework question, but just for once....
update yourtablename
set Result = col1 + col2
and please buy a sql book before posting any more questions like this, its more of an insult than a question.
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
modified on Friday, January 9, 2009 10:18 AM
|
|
|
|
|
Just curious, was the formula in the statement intentional?
|
|
|
|
|
Whoops! Now correct - damned shift key
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
That's one good feature in Finnish keyboards, plus and equal characters are on different keys. So, my version of the statement is: update yourtablename set Result 0 col1 ? col2 . See, much clearer
|
|
|
|
|
So it is. Maybe I should emigrate to Finland - on second thoughts, it's too cold
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
Nooo, it's not cold at all. Last night it was only -15 degrees Celsius.
|
|
|
|
|
Positivey tropical then
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
Yeah
|
|
|
|
|
Ok, now I know why you are on the boards so much, step outside and freeze your [insert relevant anatomical part] off.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
That could be one reason
Must admit that without emoticons it was kinda hard to say whether your post was or
|
|
|
|
|
said with humour and respect. I do find it a bit frustrating coming in and looking for something to answer and seeing your moniker after most of the questions and knowing the asker has already got a solution. The MVP was well deserved.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Thanks, I really appreciate your comments!
Don't worry, I've had some extra time over the last few days but the situation is going to change Thinking afterwards I may have been a bit too eager to answer the posts.
By the way, I have few article ideas in mind and especially one of them requires a bit more work. Since I've never wrote an article with another person I think it would be interesting to do so and I believe that at least I would learn a lot from the process as well as the technologies used. Would you be interested in participating? If you are, I think we could have more conversation via email.
|
|
|
|
|
hello all,
My application in windows C#. i have two database in sql server 2005.
i want to insert record in both database but the major concern is that if any one failed its transaction then it should rollback both trasaction in both databases.
please guide me for this.....
Amit Agarwal
|
|
|
|
|
Amit Agarrwal wrote: want to insert record in both database but the major concern is that if any one failed its transaction then it should rollback both trasaction in both databases
This is called distributed transaction where you have a special coordinator which takes care of the transactions. The transactions themselves are ended using two-phase commit.
You could start here: http://msdn.microsoft.com/en-us/library/ms191440.aspx[^]
A slightly different variation is using Linked Servers.
Amit Agarrwal wrote: i have two database in sql server 2005
Just wondering what that actually means. If you have two different SQL Server instances, then you need to distribute the transaction (one way or another), but if you have two different databases inside a single SQL Server instance, you can use normal transactions.
|
|
|
|
|
What Free Database Software supports Multiple Platform PC Databases with Network Hub Update Exchanging for Records?
I will approximately 12 HP Desktop PC's.
Duo Core 3.0 GHZ 2 GB RAM 500 GB Hard Drive.
Each PC will have its own local FREE database.
When any individual database changes, either all of the other databases must be updated slowly or one dedicated SUPERVISOR PC Database has to contain all the records and updates fro the others.
Any Suggestions for FREE or LOW COST SOLUTIONS?
Please Help.
BC
|
|
|
|