|
How to display an image in a datagrid in vb.net from the SQL Server where the image is stored in byte form in IMAGE field...
|
|
|
|
|
Does anybody know open source list of countries, cities, states in varius languages in any DB format (SQL SERVER, ORACLE, ACCESS, MYSQL etc...)?
Thanks in advance!
ilan.
|
|
|
|
|
Hi.
I use VS 2005 and ADO.NET 2.0.
The simplest example:
I have DataSet with one DataTable ('Person')
The 'Person' Table has 3 columns:
1.ID -> Autoincrement=True
2.LastName
3.FirstName
On my form I have DataGridView Control and BindingNavigator.
Using BindingNavigator's 'AddNewItem' button, I add new
DataRow to my 'Person' Table then
ID = 1 and i repeat this 3 times.
After that I use BindingNavigator's 'DeleteItem' to remove
last DataRow (ID = 3) from 'Person' Table.
Now, when I add NewItem once again I have new DataRow with
ID = 4.
How can I reset this value back to '3' in autoincrement column?
Somebody can help me, please?
Thanks.
|
|
|
|
|
I have no idea how to accomplish this with either an Autoincrement property or using triggers with sequences. But I do know that since these types of columns are mostly used for primary keys, where the values typically have no relationship to the rest of the data in the row, what reason do you have for wanting some control on the next value after some delete operation has occurred. Consider as well, what happens when you delete where ID = 2; Should the next add do an insert with a value of 2 and then the next add use 4?
Chris Meech
I am Canadian. [heard in a local bar]
When I want privacy, I'll close the bathroom door. [Stan Shannon]
BAD DAY FOR: Friendly competition, as Ford Motor Co. declared the employee parking lot at its truck plant in Dearborn, Mich., off limits to vehicles built by rival companies. Workers have to drive a Ford to work, or park across the street. [CNNMoney.com]
Nice sig! [Tim Deveaux on Matt Newman's sig with a quote from me]
|
|
|
|
|
Typically you shouldn't need to set it back to '3' (and if you DO need to set it back, then there may be a fault in your design). It is common to have these "holes" in key/identity columns in databases. My recommendation would be don't worry about it... leave it as '4'.
~Steve
www.roundpolygons.com
|
|
|
|
|
Hi Guys.
Thank you for all respondings.
Answering to Steve's question: My only problem was,
if I do everything OK (just out of sheer curiosity).
Now I know that it's a problem which isn't open to discussion.
Once again Thanks.
|
|
|
|
|
Hi database people,
If I have a table with one columm (col) and these rows:
A
A
B
C
C
C
NULL
NULL
and I run the query:
select col, count(col) group by col
I get:
A 2
B 1
C 3
NULL 0
How would I change it so that I got the count of nulls (ie. 2) rather than 0?
Any help appreciated!
Regards,
Rob Philpott.
|
|
|
|
|
Give NULL a value that can be counted.
SELECT
ISNULL(col,'NULL') AS col,
COUNT(col)
GROUP BY
col
|
|
|
|
|
yeah, that would do it. Thanks for the reply but if I want to see the count of null alongside the other results?
eg.
A 2
B 1
C 3
NULL 2
?
Regards,
Rob Philpott.
|
|
|
|
|
I believe it does put it alongside.
|
|
|
|
|
Quite right! Genious. Perhaps I should have tried it first...
Thanks for your help.
Regards,
Rob Philpott.
|
|
|
|
|
select count(col) from urtable where col=NULL
_____________________
Proud to be Albanian
_____________________
|
|
|
|
|
this will do it:
SELECT tt.col, Count(isnull(tt.col, 'NULL'))<br />
FROM TempTesting tt<br />
GROUP BY tt.col
~Steve
www.roundpolygons.com
|
|
|
|
|
I think you need to change
SELECT tt.col, Count(isnull(tt.col, 'NULL'))
to
SELECT isnull(tt.col, 'NULL'), Count(tt.col)
and the group by needs the isnull check also.
Chris Meech
I am Canadian. [heard in a local bar]
When I want privacy, I'll close the bathroom door. [Stan Shannon]
BAD DAY FOR: Friendly competition, as Ford Motor Co. declared the employee parking lot at its truck plant in Dearborn, Mich., off limits to vehicles built by rival companies. Workers have to drive a Ford to work, or park across the street. [CNNMoney.com]
Nice sig! [Tim Deveaux on Matt Newman's sig with a quote from me]
-- modified at 13:23 Wednesday 22nd March, 2006
|
|
|
|
|
select sum case when tt.coll is null then 1 else 0 end
There are many ways as we can see
Hear,See,Learn,Understand,Practice <hslup>
Many can be good,but only ONE can be the best keep practicing
|
|
|
|
|
Hi,
managed to forgot how to figure out blob size in oracle 8.
In oracle 9 and after it's simple:
xyz blob column;
abc table;
select length(xyz) from abc;
But in oracle 8, length doesn't accept blobs.
I have vague memory it involved "lob describe" somehow or maybe vsize???
Thanks!
|
|
|
|
|
How can I do to make a procedure that return the number of rows of any table.? ... @var int OUTPUT as....
|
|
|
|
|
Execute the following SQL Statement using ExecuteScalar
SELECT COUNT(*) FROM MyTableName
|
|
|
|
|
Run this procedure in Query Analyser
CREATE PROC Usp_RowCount AS<br />
SELECT count(*) FROM fc_Employee<br />
Go
"Aim to go where U have never been B4 and Strive to achieve it"
http://groups.yahoo.com/subscribe/dotnetforfreshres
http://himabinduvejella.blogspot.com
|
|
|
|
|
Great, thank you very much....
|
|
|
|
|
Hello
I need some good free e-Books or any Web Site Links for learn Stored Procedure....
N.Rajakumar B.E.,
Application Developer,
www.newdreamz.tk
|
|
|
|
|
|
U can even have a look at this KB article
http://www.dotnetspider.com/kb/Article1131.aspx[^]
All the best
"Aim to go where U have never been B4 and Strive to achieve it"
http://groups.yahoo.com/subscribe/dotnetforfreshres
http://himabinduvejella.blogspot.com
|
|
|
|
|
Hi all,
I have VS 2005 Professional, which comes with SQL Server 2005 Developer Edition. I'm in a crossroad thinking whether to install it or not.
Does ASP.net application requires SQL Server installed? Not that I'm developing asp.net, but I may need to in the future. I mainly do offline apps (Win32 /w C++).
Thanks.
|
|
|
|
|
It's not madatory that u only need Sql server
U many use Oracle .But any one database is must to store data in the back end
Sqlserver is the preferable one
"Aim to go where U have never been B4 and Strive to achieve it"
http://groups.yahoo.com/subscribe/dotnetforfreshres
http://himabinduvejella.blogspot.com
|
|
|
|