|
hey guys..i try to make a login panel and authorization..first i created a StoredProcedure like below
ALTER proc [dbo].[sp_KullaniciYetkiDegistir]
(
@KullaniciNo int,
@Yetki0 int,
@Yetki1 int,
@Yetki2 int,
@Yetki3 int,
@Yetki4 int
)
As
Begin
update Izin set ErisebilirMi = @Yetki0 where KullaniciNo = @KullaniciNo and YetkiNo = 1
update Izin set ErisebilirMi = @Yetki1 where KullaniciNo = @KullaniciNo and YetkiNo = 2
update Izin set ErisebilirMi = @Yetki2 where KullaniciNo = @KullaniciNo and YetkiNo = 3
update Izin set ErisebilirMi = @Yetki3 where KullaniciNo = @KullaniciNo and YetkiNo = 4
update Izin set ErisebilirMi = @Yetki4 where KullaniciNo = @KullaniciNo and YetkiNo = 5
End
in here i give some authority according to the KullaniciNo(here Erisebilirmi column is set as bit..so i can give or not give authority to the user)...and in my button's click i wrote like that
cmd = new SqlCommand("sp_KullaniciYetkiDegistir", conn);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue("@KullaniciNo", System.Data.SqlDbType.Int).Value = KullaniciNo;
cmd.Parameters.AddWithValue("@Yetki0", System.Data.SqlDbType.Bit).Value = chkAdmin.Checked;
cmd.Parameters.AddWithValue("@Yetki1", System.Data.SqlDbType.Bit).Value = chkKullaniciEkle.Checked;
cmd.Parameters.AddWithValue("@Yetki2", System.Data.SqlDbType.Bit).Value = chkKullaniciSil.Checked;
cmd.Parameters.AddWithValue("@Yetki3", System.Data.SqlDbType.Bit).Value = chkYekilendir.Checked;
cmd.Parameters.AddWithValue("@Yetki4", System.Data.SqlDbType.Bit).Value = chkProjeGor.Checked;
if (cmd.ExecuteNonQuery() == 1)
MessageBox.Show("Authorities Are Set", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
else
MessageBox.Show("Authorization Error", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
here cmd.ExecuteNonQuery() drops directly Else block..what is wrong here??
any help will be appreciated
|
|
|
|
|
Your sproc updates a number of things, and that would cause ExecuteNonQuery to return an int larger than 1. How about assigning the result to a variable and displaying that, just to make sure?
I are Troll
|
|
|
|
|
thanks friend..i did what u said and i noticed that i made mistake in my if block..so it was working already but it is seen like it gives errror because of my wrong idea
thanks for help
|
|
|
|
|
You're welcome
|
|
|
|
|
Guys,
I hope this is the community , where people having experience in developing products, I am a Rookie coming slowly into Industry. I am developing a product for free ware on C#-Windows, I want some skins for better apperance, I googled a lot but no result, Please help me some skins for my UI, or some links. so that my UI looks rich...
Thanks in Advance
|
|
|
|
|
|
Hi,
try to check following link:
http://www.sunisoft.com/irisskin/
but unfortunately this components are not free. when you want to make you application much more "attractive" consider to migrate on WPF.
Regards
Robert
|
|
|
|
|
|
|
Write a macro, and start the macro from within the IDE
I are Troll
|
|
|
|
|
Hello,
how is it possible to check, that the client is connected, before i response to that? I have a lot time-intensive tasks, doing with HttpRequests and i don't want to work in my application and the client is disconnected.
Is there any way?
Thank you
|
|
|
|
|
No, because Http doesn't maintain a connection to the server. The connection is only around long enough to request the page and wait for the HTTP response to be returned. If you've got processing during the Response, then you can assume the client is still there. If you're doing the processing outside of the Response, there's no way to reliably determine if the client is still around from the server side.
|
|
|
|
|
Hello Experts,
I have an image which i want to print. it works successfully but it's qualtity is not fine.
So please suggest me how to improve the quality of image.
private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
{
e.Graphics.DrawImage(PrintImage, 0, 0, PrintImage.Width, PrintImage.Height);
}
Thanks
If you can think then I Can.
|
|
|
|
|
How does it differ from the original?
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
|
|
|
|
|
My Image is in BMP Format.
If I am saving it's it is very fine and clear image. but after printing this it is not fine image.
If you can think then I Can.
|
|
|
|
|
That's because the image resolution on the monitor is much lower than decent print resolution.
|
|
|
|
|
Then How to manage it?
If you can think then I Can.
|
|
|
|
|
You need a copy of the image at a higher resolution - typically you'd be looking for a 300DPI image.
|
|
|
|
|
Dear Sir,
Actually my screen resolution is 96 and my Printer resolution is 600. So in that case my image is bluring.
So i want to know that how Can i get the best Print.
Thanks
If you can think then I Can.
|
|
|
|
|
Short of creating a 600DPI image from the 96 DPI version (it's going to be tough figuring out what the other 504 dots per inch actually are), you'd need 2 versions - the 96 DPI for the screen and the 600 DPI for the printer.
|
|
|
|
|
I want Fine Printing From MY Software. How can I Set the Printing DPI same as Screen.
If you can think then I Can.
|
|
|
|
|
I give up. I've told you what the problem is, and you want to ignore me. Fine - ignore the reason that WPF was designed to be resolution independent and the reason that designers work in resolutions other than 96 DPI.
|
|
|
|
|
Can i print BMP to same as Independent Mata File?
If you can think then I Can.
|
|
|
|
|
Check your printer settings - it may be set to draft or similar by default.
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
|
|
|
|
|
Hey guys,
I've seen a couple apps (client apps, not websites) that enable you to update your twitter, facebook, etc statuses all at once. I'm trying to develop a simple application to share a url from my pc instead of having to go to the website.
Can anyone PLEASE direct me to some tutorial in C#... I've been scouring the net but all I can find are ASP.NET examples :/
Thanks guys.
In life truth does not matter. What really matters is what others believe to be the truth. (The Up and Comer - Book)
|
|
|
|