|
DrawToBitmap seems to work fine
Bitmap b = new Bitmap(pictureBox1.ClientRectangle.Width, pictureBox1.ClientRectangle.Height);
button1.DrawToBitmap(b, button1.ClientRectangle);
pictureBox1.Image = b;
The above code shows an image of the button in a picture box.
|
|
|
|
|
Hi i am using sql server 2005 and visual studio 2005 and have come up aganist
a break wall for inputing a insert statement from sql server 2005. below is
my stored procedure and my c# visual studio code. i am new to this so any
help would be very helpful.
THis is My SP
USE [PostBook] GO /* Object: StoredProcedure [dbo].[CreateNewPost] Script
Date: 01/17/2009 15:36:15 */ SET ANSINULLS ON GO SET QUOTEDIDENTIFIER ON GO
-- ============================================= -- Author: Mark Stewart --
Create date: 09/10/2008 -- Description: New Post Item --
============================================= ALTER PROCEDURE
[dbo].[CreateNewPost] -- Add the parameters for the stored procedure here
--@DateReceived smalldatetime , @PostFrom varchar(200), @PostTo
varchar(200), @CorrespondenceDate smalldatetime, @DateForwarded
smalldatetime, @ResponseDate smalldatetime, @Summary varchar(max), @Disposal
varchar(max), @DisposalDate smalldatetime, @ReferredTo varchar (200),
@AckDate smalldatetime, @AckBy varchar (200), @InterimReply varchar (200),
@InterimDate smalldatetime, @ReplyDate smalldatetime, @BusinessArea varchar
(200), @UserID int, @ClassID int
AS
DECLARE @i AS INT BEGIN TRANSACTION SELECT @i = COALESCE(MAX(ReferenceID),
0) FROM dbo.PostBookItems WITH (TABLOCKX, HOLDLOCK) WHERE PostBookID = 1
INSERT INTO dbo.PostBookItems(PostBookID, ReferenceID, DateReceived,
PostFrom, PostTo, CorrespondenceDate, DateForwarded, ResponseDate, Summary,
Disposal, DisposalDate, ReferredTo, AckDate, AckBy, InterimReply,
InterimDate, ReplyDate, BusinessArea,ClassID,UserID,DateUpdated) VALUES(1, @i
+ 1, GETDATE(), @PostFrom, @PostTo, @CorrespondenceDate, @DateForwarded,
@ResponseDate, @Summary,
@Disposal, @DisposalDate, @ReferredTo, @AckDate, @AckBy, @InterimReply,
@InterimDate, @ReplyDate, @BusinessArea,@ClassID,@UserID,GETDATE()) COMMIT
And this is my windows form code:-
private void saveNewPostItemMenuStrip_Click(object sender, EventArgs e) {
dtPostBookItemsBindingSource.EndEdit();
taPostBookItems.CreateNewPost(dsMain.dtPostBookItems,,
Program.PostbookID,(Convert.ToInt32(postFromTextBox.Text.ToString)
(Convert.ToString(postToTextBox.Text.ToString)
correspondenceDateDateTimePicker.Value.ToShortTimeString)
dateForwardedDateTimePicker.Value.ToShortTimeString),
responseDateDateTimePicker.Value, summaryTextBox.ToString,
disposedTextBox.ToString, disposalNotesTextBox.ToString, ValueType =
Convert.ToDateTime(disposalDateDateTimePicker.Value))
referredToTextBox.ToString, ackDateDateTimePicker.Value,
ackByTextBox.ToString, interimReplyTextBox.ToString,
interimDateDateTimePicker.Value, replyDateDateTimePicker.Value,
businessAreaTextBox.ToString, classIDTextBox)));
Help please.
|
|
|
|
|
This looks like a disaster. Where is your issue ? What is your error ? It seems to me that you're trying to alter when you should be creating. Beyond that, lines like
Montypythons wrote: Convert.ToString(postToTextBox.Text.ToString)
Tell me that you are totally clueless and should read a very basic C# book before worrying about ASP.NET or SQL.
Also, unless you're using some sort of entity framework which generates invisible wrappers, the code you posted is useless. It calls the code that calls the proc, rather than calls the proc.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Hi Guys,
I am new to C Sharp.I wanna make a software just for a comptetion.Although a/c to my knowledge it is very hard to make just for beginners.But I will try my level best.
The software is call NAPS(Network Automated Play and Editing Sytem).The main function in to play avi video files at specific time intervals.The user just adds the video files and automatically the files are run at the specifies time.
Moreover there are other navigation options too.Like to view a video file(There is a video play option also).I am attaching the link that how the software looks.
Link: http://img111.imageshack.us/my.php?image=66023203nc0.jpg
My Questions is that:
1) Which language should I use for making this software?
2) What things should I know for making this software?
3) Can I make this software using VS05?
Waiting for you replies guys?
Regards,
|
|
|
|
|
1 - C# is fine, and easy enough
2 - just some basic syntax, buy a basic C# book
3 - yes, even the Express Edition
You just need a windows media control and then you can use a timer to play videos on it.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Can you guys guide and help me how to make this software.
1) What component in VS08 should I use to make this software(like Windows forms,Class Libraries etc????)
2) I am learning C Sharp from Video Tutorials,Would that be enough?
3) Which language would you prefer for making this software?
|
|
|
|
|
a2usmani wrote: What component in VS08 should I use to make this software(like Windows forms,Class Libraries etc????)
That's a very open-ended question that can't be answered in a single post. As CG has suggested, you need to spend time to familiarize yourself with the language and the development tool.
a2usmani wrote: I am learning C Sharp from Video Tutorials,Would that be enough?
That's entirely dependent on you an your prior knowledge of programming. I often use training videos as a starting point for new technologies, but almost always read a good book on the subject in order to understand the finer points.
a2usmani wrote: Which language would you prefer for making this software?
As CG already said, C# should be fine.
/ravi
|
|
|
|
|
Hi, im working on a bare basic IDE style application in C#, Just a custom application for coding in.
I wish to be able to display a treeview or other control with details on C++ Code typed in the editor.
I have looked into using Coco/R, but i cannot find a C++.atg to use with the C# coco.exe to generate a parser.
Does anyone know any other open source libraries or such that would allow me to inspect C++ Code from a C# Application?
Thanks for your time in reading =]
|
|
|
|
|
You may want to look into GOLD[^].
/ravi
|
|
|
|
|
Thanks for the reply ravi!
Thats pretty much exactly what im looking for, it already has the C# DLLs so i can easily include in my project.
But GOLD has the same problem as COCO, it requires a grammer file, which i am not experienced enough to write, i dont know that much about C++ to write a grammer table for the whole language.
Do you know of any free available GOLD C++.cgt (Compiled Grammer Table)
|
|
|
|
|
Abydosgater wrote: Do you know of any free available GOLD C++.cgt (Compiled Grammer Table)
Sorry, I don't. Maybe you could craft your own using this[^] BNF or perhaps contact one of these[^] GOLD contributors?
/ravi
|
|
|
|
|
How to prevent the user to stop the service?
|
|
|
|
|
|
|
Acoustic wrote: what kind of service?
What difference does that make?
|
|
|
|
|
I've noticed some people a round here help people with clear malicious intent, as long as their told the answer they want to hear.
"I'm making a cafe application, that's why it can't show up in task manager"
"I'm making a service to monitor my employee's system"
etc etc
Check out the Do not allow taskmanager to close my app[^]
Guy got help despite his obvious intent.
|
|
|
|
|
It makes a huge difference. A windows service is totally different than a WCF service. Neither are like a COM service. You're not going to get a clear answer unless you explain what kind of service you're talking about.
|
|
|
|
|
Maybe, but ultimately all services reside within a process, so the question really is how do you prevent the user stopping a process?
|
|
|
|
|
|
|
...
"Well, we're getting "F"'d at work. WPF, WCF, and WWF... WTF?" --John Simmons
|
|
|
|
|
In the code, set CanStop to false.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
When the press of a button Alt + Ctrl + Delete and terminate the Service
|
|
|
|
|
hi,
i have a server application that the req from clients are answered with a seperate thread and my windows form(my user interface) is answering the user.
recently i've added a new button that would open me a savefile dialog, another button for openfiledialog and the last for folderbrowserdialog.
first button:
SaveFileDialog saveFileDialog1 = new SaveFileDialog();
if (saveFileDialog1.ShowDialog() == DialogResult.OK)
{
}
sec button:
if (openFileDialog1.ShowDialog() == DialogResult.OK)
{
textBox_bak.Text = openFileDialog1.FileName;
}
third button:
if (folderBrowserDialog1.ShowDialog() == DialogResult.OK)
{
}
thhere is a weired problem with first button and the sec button, when i hit them my thread won't work and won't answer to clients untill the (save or open)dialog is open
but button 3 is not like them.
|
|
|
|
|
i should mention that this problem occured in XP but not vista(i mean vista was ok!)
there should not be any difference, should be?
|
|
|
|
|