|
Put the security within the webmethod call itself. I have a service that does that .. some methods are "public" others are only accessible by users in particular security groups.
So the secure web methods have an if around all the code that checks if the user is allowed to use it. The Webservice implements Integrated Windows Authentication so the user's identity is available and I have a procedure that decides whether a user is authorised or not.
|
|
|
|
|
Could you provide me some example / code snippet to do that.
Gurpreet
|
|
|
|
|
Well, not really because I don't know how you want to secure it.
In my webmethods I have eg
if (isUserAuthorised(this.User.Identity.Name))
{
} else
{
}
The isUserAuthorised method takes a string that is the user name and you can then do whatever you want to determine if they are infact allowed access. It depends on how you secure things. If you use AD groups then check whether the user is in the appropriate group (google for DirectoryEntry - there should be loads of examples out there and you'd be looking for something with objGroup.Invoke("IsMember" ...) I can't remember the exact syntax). If you have some database that says whether they're allowed in then call a stored procedure.
|
|
|
|
|
|
Redesign your data, lesson 101 of normalised data is that you only store information 1 time table 4 should have BookID, AuthorID and PubID not the information.
BTW I hope that is not the name of your table.
If you want to learn about this try and get hold of microsoft Pub demo database, it deals with this exact industry.
Also please read the guidelines for posting.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
oops i am sorry........thanks for the reply
|
|
|
|
|
This is the wrong forum.
Remove this message from here and post it in the "General database" forum - this will help you in getting a better response.
My signature "sucks" today
|
|
|
|
|
Hi ever1,
I have listBox and via coding add sth to it. I would like after I add item it select.
I eana this approach for delete and undo an item from list box.
string[] Field = new string[9];
private string SaveDataBeforDel(string Fr_Name, string Sr_Name, string St_Id, double Lb_Mark, double Ass1, double Ass2, double Fnl, double TotalMark, string Grade)
{
Field[0] = Fr_Name;
Field[1] = Sr_Name;
Field[2] = St_Id;
Field[3] = Convert.ToString(Lb_Mark);
Field[4] = Convert.ToString(Ass1);
Field[5] = Convert.ToString(Ass2);
Field[6] = Convert.ToString(Fnl);
Field[7] = Convert.ToString(TotalMark);
Field[8] = Grade;
CleabTxtBox();
return string.Empty;
}
private void LstBox_SelectedIndexChanged_1(object sender, EventArgs e)
{
if (LstBox.SelectedIndex != -1)
{
ITECH3219Student s = (ITECH3219Student)LstBox.SelectedItem;
Assigningdata_Totextbox(s.Fr_name.ToString(), s.Sr_Name.ToString(), s.St_Id.ToString(), s.Lb_Mark, s.Ass1, s.Ass2, s.Fnl, s.TotalMarkCalculation(),s.Grade.ToString());
}
}
private void Btn_Del_Click(object sender, EventArgs e)
{
Btn_Del.Enabled = false;
Btn_undo.Enabled = true;
SaveDataBeforDel(Txt_name.Text, Txt_surname.Text, Txt_Id.Text,Convert.ToDouble(Txt_lbmark.Text), Convert.ToDouble(Txt_ass1.Text), Convert.ToDouble(Txt_ass2.Text), Convert.ToDouble(Txt_final.Text),Convert.ToDouble(Txt_total.Text), Txt_grade.Text);
LstBox.Items.RemoveAt(LstBox.SelectedIndex);
}
private void Btn_undo_Click(object sender, EventArgs e)
{
Btn_Del.Enabled = true;
Btn_undo.Enabled = false;
Student_Manipulation s = new Student_Manipulation();
LstBox.Items.Add(s.AddStudent_Tolist(Field[0], Field[1], Field[2]));
Txt_lbmark.Text = Field[3];
Txt_ass1.Text = Field[4];
Txt_ass2.Text = Field[5];
Txt_final.Text = Field[6];
Txt_total.Text = Field[7];
Txt_grade.Text = Field[8];
ITECH3219Student s1 = (ITECH3219Student)LstBox.SelectedItem;
Assigningdata_Totextbox(Field[0], Field[1], Field[2], Convert.ToDouble(Field[3]), Convert.ToDouble(Field[4]), Convert.ToDouble(Field[5]), Convert.ToDouble(Field[6]), Convert.ToDouble(Field[7]), Field[8]);
Do u have any idea how can I remove an item from list box. then undo that. aftyer undo that item select.
thx in advance
|
|
|
|
|
Hello,
I am using an .exe file at my client but it gives me the error "The application failed to initialize properly(0xc0000135).Click on OK to terminate the aplication".
Earlier I used to use the same .exe file which is made in the debug folder of project for other clients but I didnt face this issue.Can you please tell what must be the problem. The OS is Windows 2000 for client and I am using Windows XP.
Pritha
|
|
|
|
|
You probably need to install the .Net Framework on that computer. I think the highest version of the .Net Framework that will work on Windows 2000 is 2.0. By the way, Google is your friend.
|
|
|
|
|
The application developer used the .Net Framework, just install the framework and Re-run the application
Remember to Reboot
HAPPY WORKING
|
|
|
|
|
Hello,
Thanks for your replies.
But I have executed .exe on the PCs which do not have .Net Framework.
Are you sure that I need to load .Net Framework
Pritha
|
|
|
|
|
|
Thanks Amaan
Thanks for cooperating
|
|
|
|
|
0xc0000135 is the error code you get when your system does not include the expected version of .NET
.NET has many versions (from 1.0 up to 4.0), they can coexist (you can have many on one system), and your EXE by default needs a very specific version; the good approach is to have all of them available on your system.
Some Windows versions have some .NET versions preinstalled; XP and Vista often include 1.1, 2.0 and 3.0;
which are present can be seen by looking in C:\Windows\Microsoft.NET\Framework; the folder names (all but one) represent installed versions.
Some more details are available here[^].
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read formatted code with indentation, so please use PRE tags for code snippets.
I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).
|
|
|
|
|
Thanks for your answer.
Does the same hold true for different versions of Excel.
Say if I have included a certain version of Excel.
Microsoft Excel 5.0 Object Library added as a reference in my project then it should work with the client only if it has that version of Object Library
Pritha
|
|
|
|
|
Excel is native code, not managed code, so it should always run fine, even without .NET present.
Excel automation through PIA (Primary Interop Assembly) may be different, and different versions of Office may require different PIA versions, I don't know any details.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read formatted code with indentation, so please use PRE tags for code snippets.
I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).
|
|
|
|
|
thanks for all your clarification
|
|
|
|
|
you're welcome.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read formatted code with indentation, so please use PRE tags for code snippets.
I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).
|
|
|
|
|
Hi All,
I am writing a .net application that calls a COM interface. I can use / call this interace through out the program, just fine. But calling the same interface fails in the class destructor. I need to call it there because the COM interface has something like "disconnect" method that i need to call before exiting my app.
The error that i get (only when calling the interface from destructor):
"Unable to cast COM object of type 'MyCOMObject' to interface type 'MyCOMInterface'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{9EA75075-57E3-4DCE-AACC-B87637142867}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE))"
Anybody knows what I am missing or doing wrong?
Thanks in advance!
-Chris
|
|
|
|
|
You possibly need to implement the IDisposable pattern.
This will help you clean up your unmanaged resources and also call disconnect (possibly) before the Dispose() method is called.
My signature "sucks" today
|
|
|
|
|
Hello!!
I'm pretty new in .Net and now I'm using C# to do some test automation with System.Windows.Automation.
I Need to do a click on an specific area of the main window from the application that I want to test, this is defined as WindowPattern, Do you know how could I do this??
modified on Tuesday, June 1, 2010 3:01 PM
|
|
|
|
|
I'm trying to determine if its possible to get the row index of the data combination while avoiding the interation for-loop?
Here's an example below
DataTable may look like this (with variable named "datTab":
Name Number1 Number2 Number3 Number4
Ron 60 43 33 40
Sco 83 43 33 42
Alb 60 43 32 40
Hei 34 32 45 55
Ant 23 43 33 23
Now, the question is... is it possible to get the row index number if I would find the number combination with 4 numbers? Such as I would say to find 60, 43, 33, 42 and it would find the row index = 1. I understand it can do for one column, such as
int indexTab = datTab.Rows["Number1"].IndexOf("00");
but with multiple columns? I just thought of it as I use it in my code and the software is really sluggish with muliple columns using For-loop and if-statement inside the loop.
I hope someone can answer this. I'm hoping this will provide better performance.
Thanks!
|
|
|
|
|
select ROW_NUMBER() OVER(ORDER BY Name) AS RowNumber,Name,Number1,Number2,Number3,Number4
Then use a RowFilter on the default view to narrow down to the record you want and get the value of the RowNumber column.
|
|
|
|
|
can you provide an example? I'm not sure if I quite understand what you're saying.
|
|
|
|