|
Actually, this may already be “second” or “third” hand …
He’s already promised someone that he’ll do it for $25.00; now he needs to find someone whole will do it for less than that … and so on; and so on.
(Just give them the source code to “anything”; they’ll never know the difference).
|
|
|
|
|
Hi Techies,
I am using .NET framework 4 chart controls in my system .I have a pie chart which represents the percentages of the user answering questions for each subject(e.g. history,maths etc).So,when the user answers few questions and then views the pie chart, it will show how many answers are correctly answered in each subject. I need to show the percentage of wrong answers in a subject within the pie slice showing the correct percentage (e.g: user answers 5% questions correctly, and 1 % wrong which has to be showed in a different colour ). So,basically I need to show a shaded region in a different colour within a pie slice which has its own colour which is set. E.g: In a blue region,I need to show a part of it as red.Is there any way this could be done??
It would be really helpful if you could give me some ideas on how to do this.
Thanks a lot for the help.
|
|
|
|
|
Dear Sirs,
I've looked and looked and can't seem to come up with the perfect solution. So, since CodeProject is perfect, this will cure my problem.
I'm getting System.String datetimes from a server (Microsoft CRM if you care). They're in SQL format ("2010-07-23T17:14:40-04:00"). I want to read that in as a .net System.DateTime type with the timezone information preserved, then convert it to local time. This process happens in various timezones, and I'm having trouble staying in synch. Basically, I get lots of CRM records from CRM server (which seems to stamp all the timezones with this Brazilian time (-4)), and I want to write down in my config file the latest one I saw (so I don't go back and pick up values that I already have). I would like to write it down in local time, though. Here's a distillation
I want to take the string "2010-07-23T17:14:40-04:00" and, run some code
System.Datetime Get_Local_DT(string val);
that will return "2010-07-23 15:14:40" in Central time (-6) and "2010-07-23 16:14:40" in Eastern Time (-5). Let me know what you think.
In Christ,
Aaron Laws
http://ProCure.com
|
|
|
|
|
See the System.DateTimeOffset datatype.
|
|
|
|
|
Hi,
I wanna know if is possible to put a iframe in masterpage file and the contentplaceholder inside the iframe.
Thanks.
|
|
|
|
|
This has nothing to do with C#. You'll want to ask this in the ASP.NET Forum[^].
|
|
|
|
|
Yes its possible, you could try that instead of spending time in writing question.
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKQUFK[M`UKs*$GwU#QDXBER@CBN%
R0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
-----------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
Hi all,
I'm developing a custom WebPart written in C# for MS Project EPM 2007 (Sharepoint 2007 engine), using Visual studio 2008, VseWss 1.3 and the .Net framework 3.5.
I also installed the ASPAJAXExtSetup.msi file and added the AjaxToolKit.dll binary into my project.
My Webpart display a simple DateTime.Now (among others). I wish to use an updatePanel and a Timer to refresh my string every second but unfortunately it doesn't work...
Here is my code:
protected override void CreateChildControls()
{
base.CreateChildControls();
try
{
if (ScriptManager.GetCurrent(this.Page) == null)
{
this.Controls.Add(new ScriptManager()
{
EnablePartialRendering = true
});
}
UpdatePanel updatePanel = new UpdatePanel();
updatePanel.UpdateMode = UpdatePanelUpdateMode.Always;
this.Controls.Add(updatePanel);
lblTimer = new Label();
lblTimer.Text = DateTime.Now.ToString();
updatePanel.ContentTemplateContainer.Controls.Add(lblTimer);
Timer timer = new Timer();
timer.Enabled = true;
timer.Interval = 2000;
timer.Tick += new EventHandler<EventArgs>(t_Tick);
}
catch (Exception ex2)
{
Literal ex2b = new Literal();
ex2b.Text = ex2.ToString();
this.Controls.Add(ex2b);
}
}
protected void t_Tick(object sender, EventArgs e)
{
lblTimer.Text = DateTime.Now.ToLongTimeString();
}
What is the problem?
Thanks in advance
|
|
|
|
|
I'm not sure it is wrong the way it is, however I tend to set all timer parameters before enabling/starting it.
|
|
|
|
|
First, this should have been in the SHAREPOINT forum.
Second, you have to do better than "it doesn't work". What doesn't work? What is happening?
Are you sure the required entries for ajax have been made to the web.config?
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
First, this should have been in the SHAREPOINT forum.
Sorry, I will know it for next posts.
Second, you have to do better than "it doesn't work". What doesn't work? What is happening?
Nothing happens. My string stays fixed.
Are you sure the required entries for ajax have been made to the web.config?
Yes, I am.
Thanks for your help
|
|
|
|
|
Hi,
I've followed the following post ( http://blogs.msdn.com/b/sharepoint/archive/2007/03/02/integrating-asp-net-ajax-with-sharepoint.aspx[^]
but I have a problem for adding a ScriptManager into SharePoint MasterPage.
There is no "<WebPartPages:SPWebPartManager id="m" runat="Server" />" tag in my default.master file so i've added the script manager (<asp:ScriptManager runat="server" ID="ScriptManager1"></asp:ScriptManager> ) somewhere else in the file but when I try to upload the file, I get an error: "unknown server tag 'asp:ScriptManager'" and in my webpart page (with a try/catch), i get the following: "System.InvalidOperationException: The control with ID 'updatePanel1' requires a ScripManager on the page..."
How to solve the problem?
Thanks in advance
|
|
|
|
|
crosslink06 wrote: There is no "<webpartpages:spwebpartmanager id="m" runat="Server">" tag in my default.master file
Impossible
crosslink06 wrote: requires a ScripManager on the page..."
Quite obviously the script manager must comee BEFORE the control that is trying to use it. That's why script manage is placed at the top of the page.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Here is my default.master file:
X
modified on Sunday, August 1, 2010 6:20 PM
|
|
|
|
|
Why are you wasting space and time by posintg this? No one asked for it and the time you wasted to do so could have been spent determining where this crap came from, it is not the default master page for MOSS or WSS
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
OK - Furthermore, it was not the correct master page, sorry about that.
I've added the AJAX tool kit .dll, edited the web.config and the the correct default.master files, then resetted IIS, built and deployed my solution.
Now, I get an error when I do a postback from my webpart. In addition, even if I modify and deploy the solution, nothing happens, the webpart seems to be blocked...
Thanks for your help
modified on Sunday, August 1, 2010 6:54 PM
|
|
|
|
|
|
Indeed, with a Timer it's working but during a post back, I get a javascript error:
"Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed. Common causes for this error are..."
That why I tryed to follow your trick: http://msdn.microsoft.com/en-us/library/ff650218.aspx[^]
For that, I downloaded the following http://www.microsoft.com/downloads/details.aspx?FamilyId=91f3c22c-8be7-4721-9449-84f699337d55&displaylang=en[^]
Then deployed the solution containing the AjaxSupport.dll into my server and add the reference into my web part project.
Then, I added the following within my default.master file
<%@ Register
Assembly="Microsoft.Practices.SPG.AJAXSupport, Version=1.0.0.0, Culture=neutral, PublicKeyToken=8768CCAE1C3C9EB2"
TagPrefix="spg"
Namespace="Microsoft.Practices.SPG.AJAXSupport.Controls" %>
<spg:SafeScriptManager ID="SafeScriptManager"
runat="server"
EnableUpdatePanelSupport = "True"
/>
Then, in my web.config, I added a safecontrol tag and resetted IIS:
<SafeControl Assembly="Microsoft.Practices.SPG.AJAXSupport, version=1.0.0.0, Culture=neutral, PublicKeyToken=87###########", Namespace="Microsoft.Practices.SPG.AJAXSupport", typeName="*", Safe="True" />
Now, I'm getting an error by uploading my default.master file:
"The Control type 'Microsoft.Practixes.SPG.AJAXSupport.Controls.SafeScriptManager' is not allowed on this page. The type is not registeres as safe".
Need some help, please.
Thanks
modified on Tuesday, August 3, 2010 5:52 AM
|
|
|
|
|
I've found! The problem didn't come from the environment but from my code.
I tried to set visible a textbox which didn't exist yet.
Thanks for your help.
|
|
|
|
|
Hi,
I have a DataTable that is being generated during runtime with values from the memeory. Now my question is,is there a way you can run a sql query against the data in the datatable so that it can return data in a specifik format?
In my datatable there is for example three columns called A,B,C and I want to do someting to retrieve that data with the column names Name,Surname,Age instead of A,B,C for example. Like giving an alias to the column names when retrieving the data from the datatable.
Any Help is greatly appreciated.
|
|
|
|
|
You should be able to use DataTable.Select()[^] to query your DataTable.
As for your column names, give them whatever name you like when you create your DataTable, see here[^]
|
|
|
|
|
I have a desktop based application. Now I want that when my application installed then only administrator the system can have access to the event viewer.Apart from admin, other users cannot access the 'eventvwr.msc' file.
I know the manual method that how to restrict the access to the event viewer.
Task : Enable Event Viewer Permissions
Enabling event viewer user permissions restricts access to the event viewer log files. Once these permissions are set, only administrators will have access to the event viewer logs.
1. Browse to the c:/windows/system32 directory
2. Locate the file eventvwr.msc
3. Right click on the file and select properties
4. From the properties window select the security tab
5. Highlight and remove all entries except the administrators group/user
6. Click apply and ok.
Vinay Khanna
|
|
|
|
|
public class FilePermission
{
CreateLogFiles logfile = new CreateLogFiles();
/// <summary>
/// usernames list will store all the system user's name
/// </summary>
List<string> usernames = new List<string>();
/// <summary>
/// adminusers list will store all the admin user's name
/// </summary>
List<string> adminusers = new List<string>();
/// <summary>
/// event viewer file name with path
/// </summary>
string file_path1 = Environment.SystemDirectory + "\\eventvwr.msc";
string file_path2 = Environment.SystemDirectory + "\\en-US\\eventvwr.msc";
/// <summary>
/// FileList on which filepermission applied
/// </summary>
List<string> FileList = new List<string>();
public FilePermission()
{
try
{
if (File.Exists(file_path1))
{
FileList.Add(file_path1);
}
if (File.Exists(file_path1))
{
FileList.Add(file_path2);
}
// -- here first of all get the ownership of event viewer file.
// ownership is given to the current user
getOwnership(FileList);
// -- get the all users list and load into generic list usernames
GetALLUsersList();
// -- get the admin users list
Load_Admin_Users();
}
catch (Exception ex)
{
logfile.ErrorLog(Program.LogFile, ex.Message);
//MessageBox.Show(ex.ToString());
}
foreach (string file in FileList)
{
RemoveAccess(file);//Remove all the access one by one
}
}
/// <summary>
/// get the ownership of the specified file
/// </summary>
private void getOwnership(List<string> filenames)
{
try
{
foreach (string file in filenames)
{
ExecuteCommandSync("TAKEOWN /F " + file);
}
}
catch (Exception ex)
{
logfile.ErrorLog(Program.LogFile, ex.Message);
}
//ExecuteCommand exe = new ExecuteCommand();
//exe.ExecuteCommandSync("TAKEOWN /F " + file);
}
/// <summary>
/// get the all users list
/// </summary>
private void GetALLUsersList()
{
DirectoryEntry directoryEntry = new DirectoryEntry("WinNT://" + Environment.MachineName);
foreach (DirectoryEntry child in directoryEntry.Children)
{
if (child.SchemaClassName == "User")
{
usernames.Add(child.Name);
}
}
}
/// <summary>
/// get the admin user list
/// </summary>
private void Load_Admin_Users()
{
using (DirectoryEntry groupEntry = new DirectoryEntry("WinNT://./Administrators,group"))
{
foreach (object member in (IEnumerable)groupEntry.Invoke("Members"))
{
using (DirectoryEntry memberEntry = new DirectoryEntry(member))
{
adminusers.Add(memberEntry.Name);
//Console.WriteLine(memberEntry.Name);
}
}
}
//Console.ReadKey();
}
/// <summary>
/// set the access permission to the specified file
/// </summary>
/// <param name="FilePath"></param>
private void RemoveAccess(string FilePath)
{
try
{
FileSecurity fs = File.GetAccessControl(FilePath);
foreach (string uname in usernames)
{
// if the user have not admin rights then remove all file rights from him
if (adminusers.Contains(uname) == false)
{
try
{
fs.AddAccessRule(new FileSystemAccessRule(System.Environment.UserDomainName + "\\" + uname, FileSystemRights.FullControl, AccessControlType.Deny));
File.SetAccessControl(FilePath, fs);
}
catch (System.Security.SecurityException se)
{
logfile.ErrorLog(Program.LogFile, se.Message);
}
catch (Exception ex)
{
logfile.ErrorLog(Program.LogFile, ex.Message);
}
}
}
}
catch (Exception ex)
{
logfile.ErrorLog(Program.LogFile, ex.Message);
}
MessageBox.Show("Admininstor only permissions applied on event viewer file!", "AppliedSecurityPermission");
// @System.Environment.UserDomainName\AccountName denied from FullControl access.");
}
/// <summary>
/// Executes a shell command synchronously.
/// </summary>
/// <param name="command">string command</param>
/// <returns>string, as output of the command.</returns>
public void ExecuteCommandSync(object command)
{
try
{
// create the ProcessStartInfo using "cmd" as the program to be run, and "/c " as the parameters.
// Incidentally, /c tells cmd that we want it to execute the command that follows, and then exit.
System.Diagnostics.ProcessStartInfo procStartInfo = new System.Diagnostics.ProcessStartInfo("cmd", "/c " + command);
// The following commands are needed to redirect the standard output.
//This means that it will be redirected to the Process.StandardOutput StreamReader.
procStartInfo.RedirectStandardOutput = true;
procStartInfo.UseShellExecute = false;
// Do not create the black window.
procStartInfo.CreateNoWindow = true;
// Now we create a process, assign its ProcessStartInfo and start it
System.Diagnostics.Process proc = new System.Diagnostics.Process();
proc.StartInfo = procStartInfo;
proc.Start();
// Get the output into a string
string result = proc.StandardOutput.ReadToEnd();
// Display the command output.
Console.WriteLine(result);
}
catch (Exception objException)
{
// Log the exception
logfile.ErrorLog(Program.LogFile, objException.Message);
}
}
}
|
|
|
|
|
hello
I need to provide facility for Matlab to do bulk insert to SQL. Matlab provides ways to load .NET assembly and call .NET methods:
Assembly reference: http://www.mathworks.com/access/helpdesk/help/techdoc/ref/net.addassembly.html
Method calls: http://www.mathworks.com/access/helpdesk/help/techdoc/matlab_external/brpb58s-1.html#brpca5n-1
However, we can't pass "Cell Array":
Example:
<br />
% 2 Dimensional array of numbers<br />
a=[1 2 3; 3 4 5; 6 7 8]<br />
aa=[1.1 2.2 3.3; 4.4 5.5 6.6; 7.7 8.8 9.9]<br />
% Single dimension string array (2D not permitted)<br />
b={'aaa0'; 'bbb0'; 'ccc0'}<br />
bb={'aaa0','aaa1'; 'bbb0', 'bbb1'; 'ccc0', 'ccc1'}<br />
<br />
c={'20100701' 1.11 2.22; '20100702' 3.33 4.44; '20100703' 5.55 6.66;}<br />
<br />
"c" above is cellarray
Now, my only option is to wrap bulk insert logic in ATL COM server, and call from Matlab as such:
dbServer = actxserver('MyDBComServer');
The first article below shows how to build a simple ATL server in C++ but:
PROBLEM 1: sample shows only passing simple type such as string/BSTR - I need to pass a Matlab CellArray across (For this problem... I don't have much clue how CellArray is represented in memory as thereby passed across Matlab/COM/.NET borders)
PROBLEM 2: I don't have access to .NET System.Data.SqlClient.SqlBulkCopy (For this problem can I packaged ATL done by C#? From Visual Studio 2008 \ New Project, I can find "ATL Projects" only under VC++. Is my option a COM server without ATL as indicated in Third Reference below? I am inheriting an old VB.NET COM project but having problem getting it registered, but it must be possible)
PROBLEM 3: Windows 2003 64 bit - any deadend you know?
http://digital-clipart.de/KB/COM/SimpleCOM.aspx[^]
1..2..3 ways of integrating MATLAB with the .NET[^]
http://msdn.microsoft.com/en-us/library/aa645712(v=VS.71).aspx[^]
dev
|
|
|
|
|
Good Morning all,
Currently I try to accomplish to load a DLL (filename and path) as an assembly to be available to all classes in my project.
This is because one of our third party classes makes a call to an unreferenced dll and therefore fails.
I already tried different things:
- loading the assembly into the AppDomain.CurrentDomain
- instanciating objects of the required type via reflection
- I tried different locations for doing the above mentioned things (Startproject, directly before the error occurs, etc)
All solutions loaded the assemblies, but the type seems inaccessible to the third party class.
In VisualStudio 2010 in the output window I can see the line saying that the dll is loaded.
Funny (yeah, not really funny, quire obvious) is that when I copy the dll into the executing directory or reference it via the Project References everything works fine. Unfortunately this is not a solution, because we use MEF to import such classes (third party) into our Application.
I thought about copying the dll to the application folder because thanks to MEF I can get a handle on every DLL necessary... but that would be quite ugly, wouldn't it?
I guess I just forget about something...but it doesn't pop into my mind..
Any help is kindly appreciated,
best regards
Andy
|
|
|
|
|