|
Rharzkie wrote: DataSet21
Rharzkie wrote: OleDbDataAdapter2
Wow! Have you ever thought of actually giving your variables descriptive names? What does DataSet21 mean to anyone anyway?
Upcoming events:
* Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ...
"I wouldn't say boo to a goose. I'm not a coward, I just realise that it would be largely pointless."
My website
|
|
|
|
|
It's the result of dropping data access components onto the form designer, which I would go as far as to call worst practice.
|
|
|
|
|
You can still edit the properties and give it a decent name without ever having to go near the code. Whilst I agree that the drag n drop data components are evil, thier use is no excuse for bad naming
|
|
|
|
|
Just answer my question ok..
To run your program properly and to write the correct codes are more important that giving a descriptive name. I can run my program properly even though i did not change the name of my variables...
|
|
|
|
|
Rharzkie wrote: To run your program properly and to write the correct codes are more important that giving a descriptive name
I beg to differ - If you wrote this mess in the company I work for no-one would be happy with you. If you wrote this, then disappeared off (or got yourself fired - which, if you are writing code in this way, would be quite likely) and someone else had to maintain it, they would definitely be very unhappy with you.
Upcoming events:
* Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ...
"I wouldn't say boo to a goose. I'm not a coward, I just realise that it would be largely pointless."
My website
|
|
|
|
|
But giving things descriptive names is part of good programming practice. It is never acceptable to leave something in place that cannot be easily identified at a later stage. The important thing to remember here is that it only takes you a couple of seconds to rename them before there is any code present, but as soon as you have code that refers to it, you have to take much more care and this takes time.
|
|
|
|
|
hello everyone,
I have a small doubt regarding SQLReporting services.I want to generate a reports using reportmanager and sqlreporting services.Can anybody suggest how to generate a report ..PLz tell fast it is very urgent for me.
ok byeee
Murali
Murali
|
|
|
|
|
SQL SERVICES[^]
ballameharmurali wrote: PLz tell fast it is very urgent for me.
This is not good practice.
We are all here to help depneds upon our free time.
Regards,
Satips.
Don't walk in front of me, I may not follow;
Don't walk behind me, I may not lead;
Walk beside me, and just be my friend. - Albert Camus
|
|
|
|
|
If you have visual studio installed, then you can generate reports through there.
|
|
|
|
|
I can't update my a record because when i run my program, my program stops when i click the update button. A dialog box appear and it says:
An unhandled exception of type 'System.IndexOutOfRangeException' occurred in system.data.dll
Additional information: There is no row at position 10.
My codes for the update button is:
<font color=blue>DataSet21.studentsubjects.Rows(ctr).BeginEdit()</font><br />
dr("grade") = txtgrade.Text<br />
DataSet21.studentsubjects.Rows(ctr).EndEdit()<br />
OleDbDataAdapter2.Update(DataSet21, "studentsubjects")<br />
MsgBox("The grade is recorded")
Is there anything wrong with my codes? The error is maybe at first line? How can i correct this?
|
|
|
|
|
Check whether the
DataSet21.studentsubjects.Rows(ctr) is not null...
before you do the edit!!!!
I was born dumb!!
Programming made me laugh !!!
--sid--
|
|
|
|
|
Ah ok., it means that all my records have already data and not null, thanks...
|
|
|
|
|
Simply, you dont have record at position 10
I Love SQL
|
|
|
|
|
ok, thanks. i already put a data in each record so i can already update it but the problem is, the data that i enter goes in other row instead of the correct row.
Example:
my table goes like this: i have 3 fields-
1. ID(primary key)
2. Studname
3. grade
i have 4 records:
The 4 studname are- 'rissa', 'kristine', 'cherry', 'glenda'
i have to enter a grade for each. The data written in their grade is "no yet grade" so that it can't be null.
i search ID '1' which is for 'rissa', then i enter a grade for 'rissa which is '95', but the grade goes in the record of 'kristine'
what is the problem in that? how can i correct?
|
|
|
|
|
1. Drag one label in your form and name it lblID
2.In your GridView1 selectedIndexChange event (I am giving this example for asp.net) set text of selectedrow and specify cell's text then set text to lblID.
(In this case select row which contain name Risa)
lblID.Text = GridView1.SelectedRow.Cells[1].Text;//Instead index 1 in Cells property can differ from my example
3. In Update button set update command :
" Update YourTableName set Grade='95' where [ID]='"+lblID.Text+"'";
4.Then bind GridView1.
GridView1.DataBind();
I Love SQL
|
|
|
|
|
I'm developing a record keeping s/w for retirement plans.There are two user catagory;Plan Sponsor & Participant;each having unique id Ps_id&Emp_id.Only if he has a Ps_id or a Emp_id he can register into th site.
When he enters his catagory id, Register_btn has to check for this id in Plan Sponsor details and Employee details.If any of the table contains the id,then only he can go to th registration page.
Hw can I perform th checking for th catagory id in two different tables;Ps_details & Emp_details?
Delin
|
|
|
|
|
If exists( (select query with where clause for 1st table) or (select query with where clause for 2nd table))
----implies that there is a record according to the condition in either of the tables.
gauthee
|
|
|
|
|
Hello all,
I have an old C++ program that uses sql2000. Now I need to migrate the database to sql 2005 express. I don't have access to the program fonts.
The thing is that this program creates some tables with names such as "S7:[PLC1|VFD1|S7online]DB118,B28,1" (yes, all of that...). Now, after the installing sql2005, the C++ program can not create the tables any more, displaying the message:
CADORecordset Error
Code=80040e14
Code meaning=IDispatch error#3092
Description=An object name or column is missing or empty. Verify is all the columns of the SELECT INTO instructions have names. At the other instructions, search for empty alias names. Alias defined as " " or [] are not alowed. Add a name or unique space as a alias name.
I've tried to set the compatibility mode to sql80 using the
"EXEC sp_dbcmptlevel dbname, 80" instruction. After that, the error message has stopped, but still no tables are created.
I actually can create a table with the name "S7:[PLC1|VFD1|S7online]DB118,B28,1", executing a "create table" at the management studio. But I can only creat it if the table name is between doble quotation marks ("). I suspect that the C++ program puts the table name between single quotation marks ('), or no quotation marks at all. If I try in this way at the management studio I get an error.
Anybody have any ideas of how I can make this work whitout changing the C++ program??
Thanks
Peterson
|
|
|
|
|
If it's stored as a plain string in the original app you might be able to use a hexeditor.
Another option is asking over on http://forums.microsoft.com[^]. They're normal pretty good over there.
|
|
|
|
|
Ok, now I´ve manage to solve the inicial problem. The problem was with the sql2005 instace name, and I figured out how to change the connection string.
The c++ program created the tables, but now when it tries to store any data, I get an "SqlException: The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value" error message.
When I change the connection string to connect in the sql2000, everything works fine. I tryed changing the windows regional settings, but nothing happened...
Any ideas?
Thanks
Peterson
|
|
|
|
|
I improved on an application that was found on this site (OQuery). I made it so that it could access different types of DBMS such as MySQL, Oracle (which is originally did), MS-SQL 2000. I had two people ask me if I used ODBC which I replied that I used ADO.
I'm a little confused because now I'm having trouble with the differences between ADO and ODBC. I thought ADO ends up using ODBC....right?
I've also heard that an ODBC connection is 10 slower than that of ADO....can someone confirm this. And should I be using ODBC?
Thanks
Tom Wright
tawright915@gmail.com
|
|
|
|
|
Yes, ADO is a wrapper to ODBC. But I think you really mean ADO.Net?
|
|
|
|
|
Yes...ADO.NET. So why am I being asked if I used ODBC. Is there some ODBC secret that's not being shared that I should know about?
Thanks
Tom Wright
tawright915@gmail.com
|
|
|
|
|
lol, not at all. ODBC is very old and low level. ADO.net, however, is a new(er) implementation for data access and pretty fast. For one, it allows for disconnected datasources which, in itself, is much more efficient for the server (server doesn't have to manage connections). Perfect for web apps. ODBC was used more for the old client/server connected model.
It almost sounds like you're being asked about ODBC because the datasource they want to use doesn't have an ADO.NET connector available?
|
|
|
|
|
That's possible...although all of the options that I've added to my app have a .NET connector.
I'm also wondering is they are asking that because have a different provider for each type of database is not really important.
Between you an Mike, you'ver really cleared this up....now I look and sound smarter.
Thanks
Tom Wright
tawright915@gmail.com
|
|
|
|