|
Services are pretty easy. I'm sure google will provide plenty of articles.
As for communicating between your service and an application, that's just normal Inter Process Communication ( IPC ). WCF is the technology de jour.
Nick
----------------------------------
Be excellent to each other
|
|
|
|
|
hi there, I am using sql 2008 express to keep orders and each time I finish with the orders, I want to reset the identity value. I manipulate the database over c#, how can I reset the identity value when I deleted all the records? (I already have the code to read and write to database) Thanks in advance
|
|
|
|
|
teknolog123 wrote: how can I reset the identity value when I deleted all the records?
From SQL (haven't tried to execute it over a SqlCommand , but I guess that it would work);
DBCC CHECKIDENT (yourtable, reseed, 6798) Would start the numbering at 6798, which is a good a place to start counting as any
I are Troll
|
|
|
|
|
thanks where and how can I put that code below?
SqlConnection sqlBaglanti = new SqlConnection();
SqlDataAdapter sqlAdaptor;
SqlCommandBuilder sqlKomut;
DataTable dtTablo = new DataTable();
private void masaCubuk_MouseDown(object sender, MouseEventArgs e)
{
sqlBaglanti.ConnectionString = @"Data Source=SOUNDMAXP\SQLEXPRESS;
Initial Catalog=Kafe;Integrated Security=SSPI;";
sqlAdaptor = new SqlDataAdapter("Select * From dbo.Masa1", sqlBaglanti);
sqlKomut = new SqlCommandBuilder(sqlAdaptor);
sqlAdaptor.Fill(dtTablo);
for (int i = 0; i < dtTablo.Rows.Count; i++)
{
dtTablo.Rows[i].Delete();
}
sqlAdaptor.Update(dtTablo);
sqlBaglanti.Close();
sqlBaglanti.Dispose();
}
|
|
|
|
|
teknolog123 wrote: thanks where and how can I put that code below?
If you paste code, then highlight it and press on the "code block" button; that makes it somewhat more readable. I assume that you'd execute a SqlCommand[^].
You'd need to do something similar to this at the end of your method;
const string myConnectionString = @"
Data Source=SOUNDMAXP\SQLEXPRESS;
Initial Catalog=Kafe;
Integrated Security=SSPI;";
const string myCommandText = @"
DBCC CHECKIDENT (yourtable, reseed, 6798)";
using(SqlConnection con = new System.Data.SqlClient.SqlConnection())
{
con.Open();
using(SqlCommand cmd = con.CreateCommand())
{
cmd.CommandText = myCommandText;
cmd.ExecuteNonQuery();
}
con.Close();
}
This can be further adapted to use your connection-object, off course
I are Troll
|
|
|
|
|
Hi All
I want to print the report using the Microsoft Report without showing the report on the screen (Print Direct When I Click On Button Name Print Report)
thanks
Thaer
|
|
|
|
|
Thaer Hamael wrote: Hi All
I want to print the report using the Microsoft Report without showing the report on the screen (Print Direct When I Click On Button Name Print Report)
Are you waiting for our permission? If, then consider it given.
Or are you too lazy to use google: MSDN - Walkthrough: Printing a Local Report without Preview[^]
All those who believe in psycho kinesis, raise my hand.
|
|
|
|
|
Dear users am new on this web dont know really how to use it but still ..want to ask a Question.
Q: I have made a WEbcam Recording software..but the problem is that the video gets saved but i cant Play it...Plz help its my Project of IT.
|
|
|
|
|
If you're sure the video is saved correctly (i.e can be played with another application so you know it's valid) then we'll need to so the code that attempts to play it.
Dave
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
I think we may need a little more detail...
1) Why not? What happens when you try?
2) How are you trying to play it?
3) How are you saving it?
Try to include some of the code which has a problem - use the code block widget to preserve your formatting and check with preview - but don't just cut and paste everything! No one is going to wade through huge amounts of code, so just show us the bit with the problem.
All those who believe in psycho kinesis, raise my hand.
|
|
|
|
|
Hi
I want to create a program that will make it easy for the user to fill in the forms without a Database, NO DATABASE IS NEEDED!!!!!
1. I want to have a form with some Text Boxes or other elements.
2. When the user presses the submit button all of the field data will be sent to a CR (Crystal Report) and then printed in a premade shape and order.
NO DATABASE!!!!!!
It does not need any database, I just want to send the data to CR and print it, How should I do that?????????
I searched many forums but they say just create a db and so on, but I do not want any db.
Please Help me Please!!!
|
|
|
|
|
|
Really thanks for your great answer.
But unfortunately, the webpage you gave me does not load here and I cannot find it, but I will try it.
Again: Thanks a million.
|
|
|
|
|
Hi.
You should add some Paramter to your Report File(Crystal Report)at design time.
Then you can access it in your Code.Like this:
crystalReport1.Parameter_Name.CurrentValues.AddValue("Ali");
crystalReport1.Parameter_Last_Name.CurrentValues.AddValue("Jalali");
Then show your report viewer.
Good luck.
CanI
|
|
|
|
|
I used to access that way, but I found mayor disadvantage. This approach is good if it is meant to put data that does not include Table like display.
|
|
|
|
|
Hi All,
I want to retrieve username from event logviewer in my c# application.
Is there any way ?
|
|
|
|
|
Yup, enumerate the EventLogEntry 's and check out the UserName [^] property in there.
A quick remark, copied from MSDN: This property is often blank for events in logs other than the Security log.
Good luck
I are Troll
|
|
|
|
|
I have a form and a png image file (with a transparent shadow in its border) and what I want is to make a drop shadow effect on the form. I know there are CS_DROPSHADOW solution for this, but I think it doesn't look too good. So I create a "fake" form using CreateWindowEx (via DllImport), and draw the png image file into the fake form.
void CreateFakeForm()
{
WNDCLASSEX wndClsEx = new WNDCLASSEX();
wndClsEx.Init();
wndClsEx.style = CS_VREDRAW | CS_HREDRAW;
wndClsEx.lpfnWndProc = m_DefWndProcDelegate;
wndClsEx.cbClsExtra = 0;
wndClsEx.cbWndExtra = 0;
wndClsEx.hInstance = GetModuleHandle(null);
wndClsEx.hIcon = IntPtr.Zero;
wndClsEx.hIconSm = IntPtr.Zero;
wndClsEx.hCursor = IntPtr.Zero;
wndClsEx.hbrBackground = IntPtr.Zero;
wndClsEx.lpszClassName = m_WndClsName;
wndClsEx.lpszMenuName = null;
bool success = RegisterClassEx(ref wndClsEx) != 0;
UInt32 dwExStyle = WS_EX_LAYERED |
WS_EX_TRANSPARENT |
WS_EX_NOACTIVATE |
WS_EX_LEFT;
UInt32 dwStyle = WS_VISIBLE | WS_OVERLAPPED;
FakeWndHandle = CreateWindowEx(dwExStyle
, m_WndClsName
, null
, dwStyle
, X
, Y
, PngImg.Width
, PngImg.Height
, MainFormHandle
, IntPtr.Zero
, GetModuleHandle(null)
, IntPtr.Zero
);
}
The problem is my fake form always in the topmost position. Is there a way to put the fake form behind the main form?
In other words, how do I set z-order between the main form and the fake form so that the fake form placed at the bottom of the Z order?
How to hide the fake form whenever the main form minimized or maximized, and move or resize the fake form whenever the main form moved or resized?
Thanks.
|
|
|
|
|
Why don't you override CreateParams instead of creating FakeWindow?
This example overrides default border and replace it with AERO. to get WS_ numbers, go to your Windows SDK and look under window.h for decleration
protected override CreateParams CreateParams
{
get
{
CreateParams cp = base.CreateParams;
unchecked
{
cp.Style |= (int)0x80000000;
cp.Style |= 0x40000;
}
return cp;
}
}
|
|
|
|
|
Thanks for the reply,
I'm using Windows XP, so I think there are no WS_ for AERO.
|
|
|
|
|
when i said WS_ i meant WS_EX_NOACTIVATE and other. The one I post was uses AERO. It isn't limited for aero. It has all same as unmanaged code
|
|
|
|
|
When you say override CreateParams, did you refer to the main form's CreateParams? But then, where do I draw the png image files into?. Sorry, but I'm new in this so I'm still confused.
|
|
|
|
|
for painting try look into OnPaint event or you can even ovverride
roshihans wrote: When you say override CreateParams, did you refer to the main form's CreateParams?
That is correct
|
|
|
|
|
Saksida Bojan wrote: for painting try look into OnPaint event or you can even ovverride
I thought if I paint form's border with a transparent-shadow background (using png file), it will not become transparent unless I set the main form transparent too. And how to paint the shadow into the border which is located in non-client area?
|
|
|
|
|
roshihans wrote: And how to paint the shadow into the border which is located in non-client area?
Special 'Graphics' Objects to Draw Anywhere on your Window[^]
roshihans wrote: it will not become transparent unless I set the main form transparent too
To enable Form transparecy you need to enable transparent color.
this.SetStyle(ControlStyles.SupportsTransparentBackColor | ControlStyles.DoubleBuffer, true);
|
|
|
|