|
The Undefeated wrote: How do i get a program to have a different user name like SYSTEM
By launching the process as that user.
The SYSTEM process is the highest level privilege in Windows - it has more rights than Administrator. To start a program as SYSTEM you have to be extremely confident it cannot compromise, or be used to compromise, the security of your system.
My: Blog | Photos
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucious
|
|
|
|
|
How do i do that, you can do run as and whatnot, but how do you get it to be run by the system, puting the username as SYSTEM, doesnt quite work.
|
|
|
|
|
You can't "Run As..." SYSTEM.
You can create windows services that can run under the system account. However, the question is, what do you want to do that requires that level of priviledge? There are very few legitimate needs to run a program with that level of access.
My: Blog | Photos
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucious
|
|
|
|
|
I have a application that has is develop using c#
B4 this all my data processing is done thourgh the tsql statment, now i want to switch the thing to stored procedure..
1.) but my management wnt to know is they any way we can hide the code in stored from the database administrator like the 1 in the trigger where we can encrypt the trigger..
2.) one more thing can we populate the stored procedure from c#..
so every update i will create 1 EXE for them to run and i will update the stored procedure without using any sql util...
thanks...
Jalil
Jalil
|
|
|
|
|
|
i'm trying t exncrypt the code inside stored procedure.
so that when anyone open the stored procedure they can not read it
or is the any where we can prevent the user from access the stored procedure
even administratr cannt see the code..
|
|
|
|
|
Abdul Jalil Mohamed wrote: we can hide the code in stored from the database administrator like the 1 in the trigger where we can encrypt the trigger
Yes, you can encrypt stored procedures.
Abdul Jalil Mohamed wrote: can we populate the stored procedure from c#..
Yes, you can put your creation script in a SqlCommand object and ExecuteNonQuery()
Does this help?
My: Blog | Photos
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucious
|
|
|
|
|
how do we encrypt stored procedure
an example will be gooo
thanks fot the reply
|
|
|
|
|
See the documentation for CREATE PROCEDURE[^]
My: Blog | Photos
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucious
|
|
|
|
|
Thanks guys
this really help me
thanks a lot
|
|
|
|
|
you can declare your SQL Stored procs using the WITH ENCRYPTION statement, this will encrypt them in SysComments and they should execute fine. I have never tried using this but i have it on good authority that it works.
Using WMI for SQL server you should be able to create stored procedures; create a management object and the execute your SP text using it.
HTH
Russ
|
|
|
|
|
Hello
I have a datagrid that is filled using the dataadapter. The datagrid that can be edited. Once the customer has completed the editing l want to update the new contents of the datagrid. This is what l have so far:
<br />
da.SelectCommand = cmd;<br />
da.Fill(ds,"Product");<br />
<br />
this.grdCustomerPurchase.SetDataBinding(ds,"Product");<br />
<br />
<br />
Many thanks in advance,
Steve
|
|
|
|
|
How can I open a web page(url string) from a web forms button that I've placed on my web.aspx application?
|
|
|
|
|
Well you can do:
this.Response.Redirect(name of web page / file to download etc)
or
this.Server.Transfer(url or whatever - will not work when linking to a file for downloading etc.)
The first one is better, but with the second, it doesnt change the url in the address bar on the browser so if you wanted to keep the full url a secret...
|
|
|
|
|
Thank you!
this.Response.Redirect(name of web page) works well, but I need it to open in its own window.
I think my prasing was incorrect...
|
|
|
|
|
Well, i asked that a short while back as well, you'll have to use a html button and in the onclick bit put:
window.open("website url","one_word_id_type_thing","resizable=0,width=550,height=400")
resizable=0 means you cant resize it 1 means that you can.
Just thought, to open a page in a new window, and keep the web forms button, add:
using System.Diagnostics;
then in the button put:
Process.Start("website url");
that should open it in a new window.
|
|
|
|
|
Hi.. I would like to ask about C# web application.I have created a calendar. I would like to ask that if i click the date on the calendar,how can i retrieve the database ?? I have tried butit seem like is not working. Below is the code, could anyone help me with it as i'm totally lost?? Thanks!! The code:
private void Radcalendar2_SelectionChanged(object sender, System.EventArgs e)
{
TBDate1.Text = CAL1.SelectedDate.ToLongDateString();
SqlConnection conn=new SqlConnection("my connection string");
SqlCommand cmd = conn.CreateCommand();
cmd.CommandText = "SELECT * FROM Particulars WHERE DateField = @Date";
cmd.Parameters.Add("@Date", SqlDbType.DateTime).Value = DateTime.Parse(TBDate1.Text);
}
I just want to retrieve(view) the user's login/logout time of date we have click on the calendar. Anyone who can help me..You can also edit from here or a new code... Thanks!!
Cheers!
|
|
|
|
|
I'm sorry to say this, but your question is not very clear. Is English not your native language?
Here's what I *think* the problem is:
If you have a DateTime value, do NOT use the ToLongDateString() method as it formats the date depending on the user's Windows settings. Rather, use DateTime.ToString("yyyy-MM-dd") or whatever format the database accepts the date string in.
HTH.
Cheers,
Vikram. "When I read in books about a "base class", I figured this was the class that was at the bottom of the inheritence tree. It's the "base", right? Like the base of a pyramid." - Marc Clifton.
|
|
|
|
|
Hi, Vikram.. Thanks for replying.. Actually, maybe what i explained is not very clear to you.. But actually, what i wants to do is that i've create a calendar and what i need to do now is that when i click on the date i've select it will show out the database of the user.. Is it clearer for you. As you've mention earlier on that i shouldn't write the ToLongDateString() if i using DateTime.ToString().. Can i ask you, then now how should i write the code so that it'll show out the database when i click on the date. Thanks!!
Cheers!
|
|
|
|
|
saddies wrote: what i need to do now is that when i click on the date i've select it will show out the database of the user
What do you mean by 'database of the user'?
Let's say you want to retrieve all the details of employees who joined on a certain date, from a table Employee. Assume that the user chose the date 01 Sept 2004, and that it is contained in the DateTime value userDate. Your query should look like:
string selectQuery = "SELECT * FROM Employees WHERE JoiningDate='" + userDate.ToString("yyyy-MM-dd") + "'";
Of course, the details will differ in your application, but you should get the general idea.
Cheers,
Vikram. "When I read in books about a "base class", I figured this was the class that was at the bottom of the inheritence tree. It's the "base", right? Like the base of a pyramid." - Marc Clifton.
|
|
|
|
|
Well done, the OP was actually using paramaterized queries and you just taught him how to introduce Sql Injection attacks to his code.
|
|
|
|
|
Jamie, I took a look at your reply below and it's interesting - I didn't know that parameters are automatically converted at runtime. Thanks!
But what do you mean by 'introducing SQL injection attacks'?
Cheers,
Vikram. "When I read in books about a "base class", I figured this was the class that was at the bottom of the inheritence tree. It's the "base", right? Like the base of a pyramid." - Marc Clifton.
|
|
|
|
|
|
Thanks, Jamie. Glad to have learnt something useful today.
Cheers,
Vikram. "When I read in books about a "base class", I figured this was the class that was at the bottom of the inheritence tree. It's the "base", right? Like the base of a pyramid." - Marc Clifton.
|
|
|
|
|
Hi, I can see from your code that when a user selects a date, you display it to him apsolutely 100% perfectly!! It will be formatted according to HIS/HER windows settings
This line is perfect!
TBDate1.Text = CAL1.SelectedDate.ToLongDateString();
However, take 1 step backwards:
DateTime selectedDateTime = CAL1.SelectedDate;
Without the .ToLongDateString() call, you have a DateTime Object.
The only place you went wrong below is that you tried to parse the string back into a Date, which at best is unnecessary and at worst will not work.
SqlConnection conn=new SqlConnection("my connection string");
SqlCommand cmd = conn.CreateCommand();
cmd.CommandText = "SELECT * FROM Particulars WHERE DateField = @Date";
cmd.Parameters.Add("@Date", SqlDbType.DateTime).Value = DateTime.Parse(TBDate1.Text);
The beauty of parameters (especially date ones) is that the ADO.NET provider will take care of any conversion for you... so change the last line to:
cmd.Parameters.Add("@Date", SqlDbType.DateTime).Value = CAL1.SelectedDate;
simple, huh?
|
|
|
|