|
there's a couple of owner drawn listviews right here on codeproject.com - glacial listview is probably what you need, or carlos' articles
|
|
|
|
|
The primary key for table Attachment is AttachmentID. I wanted the file path to be unique,meaning if you have entered the repeated filepath,the system will pop up a error msg,and the file path record will be denied.
Here is the stored procedure with C#:
CREATE PROCEDURE FilePath
{
@AttachmentPath Varchar(50)
}
AS
Select AttachmentPath from Attachment where AttachmentPath=@AttachmentPath
IF @@ROWCOUNT = 0
BEGIN
INSERT INTO ATTACHMENT VALUES(@AttachmentPath)
END
RETURN @@ROWCOUNT
GO
It still can't work,why?Please help me!
Thank you!
|
|
|
|
|
Make sure you have your AttachmentID column in Attachment Table set as Identity(autonumber)
CREATE TABLE [dbo].[Attachment] (
[AttachmentID] [int] IDENTITY (1, 1) NOT NULL ,
[AttachmentPath] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[Attachment] ADD
CONSTRAINT [PK_Attachment] PRIMARY KEY CLUSTERED
(
[AttachmentID]
) ON [PRIMARY]
GO
Change Stored Procedure as
CREATE PROCEDURE FilePath
@AttachmentPath Varchar(50)
AS
Declare @count int
Select @count = count(*) from Attachment where AttachmentPath = @AttachmentPath
if @count =0
BEGIN
INSERT INTO ATTACHMENT(AttachmentPath) VALUES(@AttachmentPath)
END
GO
Note: An easiest way would be to have AttachementPath column set as Unique. Then, stored procedure would automatic generate an error in case of duplicate data
Sanjay Sansanwal
www.sansanwal.com
|
|
|
|
|
Hello,
I'm building an application were I need to fill a large dataset before using it to display a crystal report. I has been taking up to 30 sec. to retrieve all the data from the server and I need a way to assure the user that the application has not froze up during this time. I cannot get a progress bar to work in this case and have also tried to display a form with an animated gif, but the gif does not animate during the data retrieval. I would like to be able to show the user a true progress if possible, any suggestions?
-Scott
|
|
|
|
|
You can'y unlress you writ your own code to fill the dataset a set number of records at a time, kind like paging in 10 records at a time until you get all, say 1,000 records into your dataset.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I'm trying to do a custom draw on listview items, when a listview is in large icon mode. I've found lots of samples, one here on codeproject, but none seem to be geared towards the icon mode. The problem I'm getting is i'm not getting given an 835 (CUSTOMDRAW) message in the WndProc function, which the listview sends to itself (reflected message), I only get an 870 in it, which is a NOTIFY message.
I basically want to right my own listview that customises the large icon view of a listview, so for example, I could do a photo gallery with descriptive text underneath each item.
If anyone can point me in the right direction, that'd be much appreciated. I've hit a bit of a brick wall with it.
|
|
|
|
|
smallguy78 wrote:
The problem I'm getting is i'm not getting given an 835 (CUSTOMDRAW) message in the WndProc function, which the listview sends to itself (reflected message), I only get an 870 in it, which is a NOTIFY message.
Why you doing that? Just set the OwnerDraw property to true, and use the MeasuerItem and DrawItem overrides.....
top secret xacc-ide 0.0.1
|
|
|
|
|
Listview doesn't have MeasureItem and DrawItem, which is why I need to use p/invoke to do it.
There's a few examples out there, like I said, none of which work with large icon view.
|
|
|
|
|
|
With the help of ListViewEx's implementation, I've got it working. The NOTIFY message is being called ok, and the -12 (CDDS_ITEMPREPAINT) is also being called. It's all painting okay, so if anyone ever needs to do this, send me an email and I can help out (I'm doing large icons listview though, remember)
My only problem is the rectangle I'm getting back doesn't contain any width information (the Right property is the same as the Left, x same as y). I can work around this as I'm doing a custom draw, but it's a tad annoying.
|
|
|
|
|
I want to delete a file for an image but before deleting it the image is shown in a picturebox control so when i try to delete the file it tells me tht this file already in use
i tried the following but gives the same Error
First Trial
pictureBox.Image.Dispose();
Second Trial
pictureBox.Image = null;
GC.Collect()
but both trials failed
thx
|
|
|
|
|
Try to load your image from the file by using streams and then close the stream before you want to delete the file.
www.troschuetz.de
|
|
|
|
|
hi there
i have a Form Whit a DataGrid on it
in the datagrid i have a lot of data
when the Form is load
i want to see in the datagrid the last data that enterd
the last page
i dont want to scroll down the datagrid scroller any time the form is loaded
i want it to be automaticely .
how can i do it ?
thanks ... i hope somebady to help me
i am in c# - my DB is Accses
|
|
|
|
|
Set the DataGrid's CurrentRowIndex property to the number of Items in the DataGrid's DataSource property - 1. Minus one, because the row index starts at zero.
e.g.:
datagrid1.CurrentRowIndex = ((DoCastHereToTypeOfDataSource)datagrid1.DataSource).Count - 1 //Count could be Length if you use an array
|
|
|
|
|
hi,
Now i am trying to use Microsft Chat control 6.0 (COM) into my C# application. I want to bind lot of numeric data with chart control. I don't have any prior experience with vb. And i can't find any material which will give alteast little about this idea.
What about you ? You know any material which deal these senario....
**************************
S r e e j i t h N a i r
**************************
|
|
|
|
|
sreejith ss nair wrote:
And i can't find any material which will give alteast little about this idea.
Yeah i feel the same dealing with COM stuff. Docs are there, but extremely well hidden. Advice: PRAY!
top secret xacc-ide 0.0.1
|
|
|
|
|
hi,
who hide that all userful stuffs. Microsoft ????
**************************
S r e e j i t h N a i r
**************************
|
|
|
|
|
Hi gurus!
The problem domain:
1. C# defined xml comment tags are 'summary' 'remarks' etc.
2. I have decided/defined new xml tags I want to use in the same manner.
3. I want the VS developers in my company to see my tags listed in the ListItems box (Intellisense) when they click '<'.
My solution directions:
1. If there's a file/template where VS defines its tags - I'd add mine.
2. If there's a way to attach to Intellisense events and to add my tags before it shows the ListItems box, I'd write an add-in.
Known solutions which are irrelevant for me:
I've seen on the web an add-in which opens a context menu. This is not what I'm searching for, since it is not transparent to the user...
Thank,
Kfir
|
|
|
|
|
How can I disable all keys including Ctrl+alt+Del , Alt+Tab and Windows Keys when a user is interacting with my form? I have a borderless form which covers the entire screen and I have to probhit the user from getting out from it.
Thanks,
|
|
|
|
|
You cannot normally disable Ctrl+Alt+Del because it's the Secure Attention Sequence, used for bringing up the Windows Security dialog.
You can stop many other keys from having their usual effects using a keyboard hook.
Paul DiLascia documents how to do it - in C++ - in this MSDN Magazine column[^].
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
Apparently if you replace one of the system
DLLs on NT based system you can bypass
control-alt-del but I forget the name
of the DLL in question. If you google
for NT Admin Tips you might find it
and where to get the replacement DLL.
I'd advise against this modification
without client permission though.
|
|
|
|
|
Yuo can't disable the Ctrl-Alt-Del sequence unless you write your own GINA.DLL and replace the system version with yours.
You also can't write the new GINA in C# either...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
hi code guys!
1. I've an application with web browser control. I want to access all the text from loaded page.
I've used mshtml. but don't have any idea how to implement it.
2. Loaded page refreshes after every 2 minutes. Is there any event to detect refresh method of the page.
|
|
|
|
|
Recently I was creating a WinForms application. I made several seperate projects - each with a different GUI.
One of the thigns I noticed is that at random - win form apps like to delay themselves when dragging the main form around.
Try this out for yourself. make a form drag some lightweight components on there and then compile it..
make a few more with the same components - you might note - one is faster - meaning more responsive with dragging than the other.
my question is this - why is this happening and how can it be prevented??
comments? questions?
ive been beating my head against the wall trying to find out why.
Danny!
|
|
|
|
|
Hi,
MS Outlook has a cool control that's a combobox, a textbox and a label. The combobox selection (marked with a check) shows in the label and the value goes into the textbox. The control is used to select which TYPE of phone number (home,mobile...) to allow the user to alter in the textbox.
I know I could build a similar control, but I'm hoping that the control is available in some type of common control dll. Is it? Or something similar?
thanks,
Deanna
|
|
|
|