|
Good Luck! Without the Notes API, you're pretty much screwed because you'll have to parse a LOT of information. Also hampering your efforts will be that some NSF databases can be encrypted and virtually impossible to read without the Notes API and the fact that IBM keeps changing the damn format of the database files further complicating the crap out of what you're trying to do.
About the only document I ever found on the NSF format was here[^].
|
|
|
|
|
Poor bastard - NSF will almost be a proprietary format coming from Notes, probably some flavour of xml, I would approach IBM with a f***ing big gun and see if they have the format/api available as Garth suggested.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I want to Update the particular column...but once i give update only the edited column is present in the database..others are absent..
try
{
con.Open();
String q3 = "update testreport set patientname='" + textBox2.Text + "',address='" + textBox3.Text + "',testreports='" +textBox5.Text + "',reportno='" + textBox6.Text + "',date='" + dateTimePicker1.Value.ToString("dd-MMM-yyyy") + "',takentest='" + textBox4.Text + "'where patientid='" + textBox1.Text + "' ";
cmd = new SqlCommand(q3, con);
cmd.ExecuteNonQuery();
MessageBox.Show("details updated successfully");
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString(), "details not updated");
}
con.Close();
|
|
|
|
|
Start by fixing the SQL Injection[^] vulnerability in your code.
using (var con = new SqlConnection("<YOUR CONNECTION STRING HERE>"))
using (var cmd = new SqlCommand("update testreport set patientname = @patientname, address = @address, testreports = @testreports, reportno = @reportno, date = @date, takentest = @takentest where patientid = @patientid", con))
{
cmd.Parameters.AddWithValue("@patientname", textBox2.Text);
cmd.Parameters.AddWithValue("@address", textBox3.Text);
cmd.Parameters.AddWithValue("@testreports", textBox5.Text);
cmd.Parameters.AddWithValue("@reportno", textBox6.Text);
cmd.Parameters.AddWithValue("@date", dateTimePicker1.Value);
cmd.Parameters.AddWithValue("@takentest", textBox4.Text);
cmd.Parameters.AddWithValue("@patientid", textBox1.Text);
con.Open();
cmd.ExecuteNonQuery();
}
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Handle the OnTextChanged event of your textboxes to save wath field was changed and build the update string based on this data.
|
|
|
|
|
Better yet, don't do updates; do versioning instead. Updates are code smell.
And definitely use a parameterized query as Richard demonstrates.
|
|
|
|
|
Why do you care which field was changed, presumably you populate the control with the existing data and therefore you are just writing back the same information. Save the entire record!
Implement and audit system that records the before and after of each field.
And fix the sql injection exposure highlighted by Richard!
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hello
I want to find a way to control video files in my C# application. I want to open video files of various formats and then control them in frame level, going forward\backward few frames, jumping to an specific frame and things related. Thus far I haven't been able to find anything useful. Also I don't want any additional components being shown in my application (like the Windows Media Player COM). Also video scaling is needed.
Thanks in advance
|
|
|
|
|
Look at ffmpeg[^], OpenCV[^] etc. Not sure if there is a C# port available. But it won't be hard to call these libraries from C#.
|
|
|
|
|
http://www.c-sharpcorner.com/uploadfile/mgold/playingvideo11242005002218am/playingvideo.aspx?articleid=3d1c3b81-1a12-48e7-ad5e-758f96525409
i think this one is useful for you just refer it
|
|
|
|
|
Hi Team, i have aspx page with code behind in c#,the page has checkbox list which gets pulled dynamically(not static checkbox list), now my concern is once i do the check/uncheck of checkboxes and if i left mouse button then callback is happening which is not required i have verified the code base and there is no activation of callback event from code, check box unselect/selection is fine but if you click left mouse button on any part of the aspx page callback is happening which i dont want to happen.
i do not want to raise callback event if i do mouse click on the form, i tried different options to prevent but could not succeed, can some one guide on this
Thanks
msr
|
|
|
|
|
|
are you put postback property "true" for that control? I am not getting how these been made
|
|
|
|
|
I have a C# 2010 desktop application where I have code setup to see if a user is a member of an active directory group. I am using WindowsIdentity to check the current users active directory group level. The following code is not working. Thus can you tell me how to what is wrong with the code below?
If you think the code listed below will not work, can you tell me how you would modify the code listed below?
If you do no see anything wrong, can you tell me what to suggest to the network people at my company to suggest to them what is wrong?
using ActiveDirectoryCommon;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using System.Collections.Specialized;
using System.Deployment.Application;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.Remoting;
using System.IO;
using System.Web;
using System.Configuration;
ConfigurationManager.Appsettings in the app.config file
using System.Security.Principal;
using System.Threading;
namespace File_Reject
{
static class Program
{
internal static ActiveDirectoryUser CurUser;
[STAThread]
static void Main()
{
try
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
CurUser = new ActiveDirectoryUser();
if
(!Thread.CurrentPrincipal.IsInRole(Environment.UserDomainName + "\\" + ConfigurationManager.AppSettings["role_File_Upload"]))
{
MessageBox.Show("You do not have authortity to access File Transfer. Please contact your network administrator if you have any
questions.", "File Transfer Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
Application.Run(new FileReject());
}
catch (Exception e)
{
}
}
}
}
----------
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics;
using System.Reflection;
using System.IO;
using System.Threading;
using System.Web;
using System.Windows.Forms;
using System.Security.Principal;
namespace ActiveDirectoryCommon
{
public class ActiveDirectoryUser
{
public ActiveDirectoryUser()
{
AppDomain.CurrentDomain.SetPrincipalPolicy(PrincipalPolicy.WindowsPrincipal);
Thread.CurrentPrincipal = new WindowsPrincipal(WindowsIdentity.GetCurrent());
}
}
}
-----------
<?xml version="1.0"?>
<configuration>
<appSettings>
<add key="role_File_Upload" value="File_Upload" />
</appSettings>
</configuration>
------------
|
|
|
|
|
dcof wrote: The following code is not working. You will need to provide more information than that. Try using your debugger to get some information about exactly what is happening, including any error messages.
Use the best guess
|
|
|
|
|
There is no error generated except what is in the code I listed above. When I try a differnet active directory group that I have access to, the code works. Thus do you think this is a network setup problem or my problem? How would you suggest the problem get fixed?
|
|
|
|
|
dcof wrote: How would you suggest the problem get fixed? Since the only information you have provided is that the code is not working, it's impossible to make any suggestions. The normal procedure would be to do some debugging to find out why the code is not working, and what failures are occurring.
Use the best guess
|
|
|
|
|
Check the length of your group names and such. I can't remember exactly but I encountered a limit of something like 32 characters. My code kept failing on my testing group. Finally tried another 'shorter' group and it worked.
IsInRole was the offending function for me. I never found anything online that said there was a limit.
Just a thought.
|
|
|
|
|
I pasre a Csv file,one Line is:
aaaa,,,"cc"",dd""e",,,,," ",,"nm,nnm",,," ",,,,,,," ",,,," ",,," ",,,,,"","a","bb
The Regex Pattern is:
string Pattern = "((?<=^|,)(?<field>)(?=,|$)|(?<field>[^\",\\r\\n]+)|\"(?<field>([^\"]|\"\")*)\")(,|\"(?<rowbreak>\\r\\n|\\n|$))";
But the result of last string "bb is wrong,the result is bb.How to modify it.
and Do you have any other ways to parse a csv file with RegularExpression
|
|
|
|
|
Why use a regex, when a simple string.Split() method call will do the work for you?
Use the best guess
|
|
|
|
|
Because it tends to get it wrong if the CSV data contains strings:
"hello", "hello, again", "goodbye" Is only three elements, but a Split won't spot that.
The universe is composed of electrons, neutrons, protons and......morons. (ThePhantomUpvoter)
|
|
|
|
|
Good point, but not too difficult to write a parser that can handle such situations.
Use the best guess
|
|
|
|
|
Nope, but there are quite a few already written - and I wouldn't want to do it in a regex!
The universe is composed of electrons, neutrons, protons and......morons. (ThePhantomUpvoter)
|
|
|
|
|
To be honest, I would be reluctant to use a Regex for CSV processing as it all gets a bit complex when you can have double quotes inside double quotes, and comma inside them as well.
I would use a CSV file processor myself: A Fast CSV Reader[^] is pretty good!
The universe is composed of electrons, neutrons, protons and......morons. (ThePhantomUpvoter)
|
|
|
|
|
|