|
Just noticed something I find odd?
When you select a table you get a list of users names? the one I created is now in Database users and in Server logins but not within this table list?
How many passwords do you need for SQL????
Secure its more like fort knox!!!
Many thanks for your time and may the force be with you! (you'll need it!)
|
|
|
|
|
OK, OK, Sorry I have now got the login working but I need help with a command?
I did what you said and I can see how they create login and user accounts, Thanks.
The reason it started working for me was I deleted my simple test data table and recreated is specifing my user account instead of the 'odb' which is the default? how can I add user access to a table that is already created?
Thanks again for all this help, I owe you at least a pint!!!
Many thanks for your time and may the force be with you! (you'll need it!)
|
|
|
|
|
Dam.NET wrote:
how can I add user access to a table that is already created?
As you posted this as I was typing my other, longer, reply you should get the answer in there. But just to refresh:
GRANT SELECT ON TableOrViewName TO UserOrGroupName
Dam.NET wrote:
Thanks again for all this help, I owe you at least a pint!!!
Thanks. Cheers!
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
Not getting the response you want from a question asked in an online forum: How to Ask Questions the Smart Way!
|
|
|
|
|
Dam.NET wrote:
How many passwords do you need for SQL????
Each login has one password.
Of course, you can also add Windows users and groups which allows Windows to perform the authentication on behalf of SQL Server. All you would need to do then is log in to windows.
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
Not getting the response you want from a question asked in an online forum: How to Ask Questions the Smart Way!
|
|
|
|
|
What this means is that the account you used to log into the SQL Server does not have SELECT permission for the table Users.
The easiest way is to GRANT SELECT ON Users TO PUBLIC
This means that anyone who is a user of your database can see what is in the table, but not alter it. For more information see the SQL Server books-online: GRANT[^]
Dam.NET wrote:
I would image these SQL security options could get quiet complex for a medium/large application?
It can get complex. That is one reason I said in another thread that all objects in the database should be owned by the dbo, unless you have a very very compelling reason not to. Here is an example in narrative form:
Jack, a db_owner (can create database object, but is not a dbo), creates a table and populates it with some interesting data.
Bob, who is a sysadmin (and therefor is a dbo) sees that some of the intersteing data would be useful to others and creates a view to allow access to only part of the table. He grants permission to public on the view.
Jill, a regular user, wants to use the view and performs a "SELECT * FROM BobsViewOfJacksTable", but the security fails for some reason.
Jill checks the security settings and she has the right to use the view. She is confused and emails Bob.
Bob pastes the select statement into his query analyser and gets the rows back he expects. But doesn't understand why Jill doesn't get the same result. He calls Jack, who tries out the view and it works for him too. Everyone is very confused, because the view is accessable to public, and no-one has a specific deny access on it. Eventually, after two days of trying to work this out, Bob changes the owner of the table to dbo and everything works.
The reason: Jack has only granted select permission to members of sysadmin and db_owner to his table. Jill is neither. However, if the table is owned by the same user as the view the second security check doesn't take place. Jill has access to the view, the view is owned by the dbo, therefore anything that the view uses that is also owned by dbo does not need a second security check, anything that is owned by some other user needs an additional security check.
Does this make your head hurt? It makes mine hurt.
The way this works means that, if everything is owned by the dbo, you don't have to grant access directly to your tables. Instead you can protect them behind views and stored procedures, which the users do have permission for.
It is generally a good idea that permissions are scripted, so everything can be reset easily. Also, if you are doing that it is a good idea that any changes are reflected in the script and the script is kept in a source control system to that the history of changes can be seen easily.
I hope all this helps.
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
Not getting the response you want from a question asked in an online forum: How to Ask Questions the Smart Way!
|
|
|
|
|
Collin thanks for all your help today!!!!!!!!!!!!
Many thanks for your time and may the force be with you! (you'll need it!)
|
|
|
|
|
Hi,
When creating a "generic" WinForms application, adding the File Open / Save etc. handlers is quite some work (Load, Save, Save As, New, Close, and recent files).
I guess the core could be done by a little clever helper class. But is there already something? Or am I missing something in the framework?
we are here to help each other get through this thing, whatever it is Vonnegut jr.
sighist Fold With Us! || Agile Programming | doxygen
|
|
|
|
|
There's nothing like that in the framework. VS 2005 is comming out with a way for you to add default menus and toolbars during design time. Kinda neat, but really... it's not that bad to do it yourself.
|
|
|
|
|
how to use zedgraph to bind to the database? Help plz.
|
|
|
|
|
hi,
It's is not possible to bind the zedgraph direclty with database. What you need to do is collect your data and populate in an array of type double. This information is upto my level best.
For ultimate information please post your thread in that article where the zedgraph describes.;)
**************************
S r e e j i t h N a i r
**************************
|
|
|
|
|
hi
i am a newbie to c#
I hav a string which contains a function name and i hav some arguments for the fuction.Now how do i apply that fuction to those arguments
for example
i hav a string called func
and func="mywriteline" where mywriteline is a fuction. Now is there a way to apply this function
to the arguments which i hav in some other array
|
|
|
|
|
To accomplish this you'll have to use reflection to find the MethodInfo of the method you want to execute.
I'd suggest you read the documentation on the Type class, there are several overloaded GetMethod() methods that can give you a MethodInfo for a method name.
Once you have the correct MethodInfo you call one of it's Invoke() methods to actually execute the target method.
Arguments for this method are supplied in the form of an object array, if any.
One thing you'll have to keep in mind: You can't just "apply a function", you always need an object to execute one of it's methods (it's a parameter for MethodInfo.Invoke() ).
This code fragment should help:
MyObject obj = new MyObject();
MethodInfo mi = obj.GetType().GetMethod(func);
object[] arguments = new object[] { "arg1", 42 };
object result = mi.Invoke(obj, arguments);
Regards,
mav
|
|
|
|
|
hello iam using win xp os. I want to send a message to the user from my c# application before windows shut down how can i ??? plz help me
|
|
|
|
|
You have to register an event handler for the SessionEnding event of Microsoft.Win32.SystemEvents .
Then you'll get a notification when Windows is being shut down and you can pop up a message and cancel the shutdown process or do whatever you need.
Regards,
mav
|
|
|
|
|
Thanks for ur response.
i was doing like this
1.How can i cancel shut down process
private void HookSessionEnding()
{
Microsoft.Win32.SystemEvents.SessionEnding += new Microsoft.Win32.SessionEndingEventHandler(this.OnSessionEnding);
}
private void OnSessionEnding( object sender,Microsoft.Win32.SessionEndingEventArgs e )
{
MessageBox.Show("System Shut Down");
}
|
|
|
|
|
Could any one help me with this, im suppoused to make an application which draws polygons given the radius, center and number of sides. I know that the function polygon does this, but i have to this with out using it, any help with the algorithm which helps me determine the vertices would be greatly appreciated.
|
|
|
|
|
Your dog wants steak wrote:
any help with the algorithm which helps me determine the vertices would be greatly appreciated.
Surely you were given the mathematics behind this in your class? If so then it should be fairly easy to translate that into code. Is there any particular part of the translation you are having trouble with?
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
Not getting the response you want from a question asked in an online forum: How to Ask Questions the Smart Way!
|
|
|
|
|
Nope no help with the math part in class, Im stuck with a math teacher in computer aided desing class who thinks we should learn to program in c# little applets that dont do squat. In this case he wants us to program a little program that calculates the vertices of a n sided polygon given the radius and the center. Big big problem even more because we learned to program on c++, only two clases and he thinks this is "easy". Well if you know of some place else where i could find help with my little math project... greatly appreciated
|
|
|
|
|
Okay, my high school maths is a bit shakey these days but I'll give it a go.
The method that draws polygons takes an array of Point objects as each of the points. So for n vertices you need n points (although strictly speaking the first and last point are the same windows will draw the final vertex back to the starting point for you)
A complete rotation is 2*Math.PI. So each step will be:
rotationStep = (2*Math.PI)/numVertices
start the currentRotation at 0.0
for each point the
x = centreX + (sin(currentRotation)*radius)<br />
y = centreY + (cos(currentRotation)*radius)
You should now have a Point array which you can pass to the System.Drawing.Graphics.DrawPolygon() method.
Hopefully this maths should be enough to get you going.
Good luck with your class.
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
Not getting the response you want from a question asked in an online forum: How to Ask Questions the Smart Way!
|
|
|
|
|
me thinks u mixed cos and sin:
Colin Angus Mackay wrote:
x = centreX + (sin(currentRotation)*radius)<br />
y = centreY + (cos(currentRotation)*radius)
should be:
x = centreX + (cos(currentRotation)*radius)<br />
y = centreY + (sin(currentRotation)*radius)<br />
there are no facts, only interpretations
|
|
|
|
|
But like I said "my high school maths is a bit shakey these days", so, at least I did warn that the answer might not be completely valid.
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
Not getting the response you want from a question asked in an online forum: How to Ask Questions the Smart Way!
|
|
|
|
|
don't get angry, high school sucks anyway. and it doesn't matter for his polygon i think, but a math teacher might get annoyed
there are no facts, only interpretations
|
|
|
|
|
yoaz wrote:
don't get angry
I didn't.
yoaz wrote:
it doesn't matter for his polygon i think
Because it is circular, rather than ellipsoidal I think that's also correct.
yoaz wrote:
but a math teacher might get annoyed
Quite probably.
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
Not getting the response you want from a question asked in an online forum: How to Ask Questions the Smart Way!
|
|
|
|
|
I'm having problems enlarging images using the Graphics object. The quality of the enlarged images is bad. I get the best results by setting the interpolation mode to nearest neighbor and pixel offset mode to high quality. Even then, the image is grainy. Here's an example:
protected override void OnPaint(PaintEventArgs e)
{
if(this.image != null)
{
RectangleF source = new RectangleF(0f,0f,0f,0f)
RectangleF dest = new RectangleF(0f,0f,0f,0f)
dest.X = e.ClipRectangle.X;
dest.Y = e.ClipRectangle.Y;
dest.Width = e.ClipRectangle.Width;
dest.Height = e.ClipRectangle.Height;
source.X = dest.X / zoom;
source.Y = dest.Y / zoom;
source.Width = dest.Width / zoom;
source.Height = dest.Height / zoom;
e.Graphics.InterpolationMode =
InterpolationMode.NearestNeighbor;
e.Graphics.PixelOffsetMode =
PixelOffsetMode.HighQuality;
e.Graphics.DrawImage(image, dest, source,
GraphicsUnit.Pixel);
}
if(deleg != null)
deleg(this, e);
base.OnPaint(e);
}
Basically, what I'm looking for is something like a simple pixel resize. I've tried doing this manually, but with bigger images it takes a lot of resources. Any ideas?
|
|
|
|
|
jacal99 wrote:
the application gole is to hook the keyboard when the service starts and create a file on d:\123.txt and save all the pressed keys in this file
It sounds like you are creating spyware. If that is the case, do you really expect much help?
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
Not getting the response you want from a question asked in an online forum: How to Ask Questions the Smart Way!
|
|
|
|