|
Will this let me pass data from frmSearch to frmEmployeeInfo?
I need to pass RecId from frmSearch to frmEmployeeInfo because I need to read a record and populate the listbox in frmEmployeeInfo.
Thanks again, you guys are a life savor.
Kyle
Kyle Maldonado
|
|
|
|
|
you should not interlink two forms to much (of course you could give the constructor of frmSearch a reference to a frmEmployeeInfo-object and use some public function of frmEmployeeInfo to do this - but I would advise against it) - better use something like:
- a event in frmSearch to post the info
- a callback-delegate that is passed to frmSearch (this is more or less the same than using an event - but the event has better VS-integration
- a public function/property on frmSearch to query the data
I would advise:
- if you call the frmSearch as an modal dialog use the public property approach
- if not use the callback-delegate approach
|
|
|
|
|
Hi i have written the code below, its job is to bring up a popup when a button is clicked, however although the popup comes up when information is entered into the popup it brings back an error saying, input string was not in correct format.
Hi that works but it doesnt take across "WorkSchedule_ID" because although the popup loads, when i enter information into it, the result is still "input string was not in a correct format". I tried this but it didnt work, the offending line is "strPrimaryKey =e.Item.DataBind("WorkSchedule_ID").ToString;". WorkSchedule_ID is coming from the database and each recored has its on unique ID, how can i pass it through to the page?
protected void btnModify_Click(Object sender, DataGridCommandEventArgs e)
{
if (e.CommandName == "Submit")
{
string strPrimaryKey = (string)e.CommandArgument;
strPrimaryKey =e.Item.DataBind("WorkSchedule_ID").ToString;
//int intPrimaryKey = Convert.ToInt32(strPrimaryKey);
strEvent = "<script language='javascript'>\r\n";
strEvent = strEvent + "popup('sow_notes.aspx?WorkSchedule_ID=" + strPrimaryKey;
strEvent = strEvent + "&survey_id=" + Request.QueryString["survey_id"].ToString();
strEvent = strEvent + "&sow_type_id=" + Request.QueryString["sow_type_id"].ToString();
strEvent = strEvent + "&surveytype_id=" + Request.QueryString["surveytype_id"].ToString();
strEvent = strEvent + "&property_id=" + Request.QueryString["property_id"].ToString() + "');\r\n";
strEvent = strEvent + "</script>";ViewState["sEvent"] = strEvent;
}
}
|
|
|
|
|
1. You should have posted this in the ASP .NET forum.
2. I don't know ASP .NET, but I think there are better ways of popping up a window.
3. Why are you initializing strPrimaryKey?
4. strPrimaryKey =e.Item.DataBind("WorkSchedule_ID").ToString; shouldn't even compile - ToString is a method, you are missing the parantheses.
5. Have you stepped through the code? What are you seeing there?
Cheers,
Vikram.
"If a trend is truly global, then that trend ought to be visible across ANY subset of that data" - fat_boy
|
|
|
|
|
Im Serializing this Object 'PersonNode'. It Serializing ok but the attribute 'name' is not coming through. Why would this be?
[Serializable]
public class PersonNode: List<child>
{
[XmlAttribute("name")]
public string name;
|
|
|
|
|
Hi All,
I have 4 project that have dependencies on each other.
I want to compile them all together - but i want to use some "make" file to do it because i need them to be compile in some const order.
I know that i can use the pre-Build option to set the compile order - but i prefer to do it by using some "make" file.
I don't know how to do it ( write the make file to this mission ).
Thanks for the help.
|
|
|
|
|
You could write the file yourself, but why since Visual Studio automatically detects project dependencies in the same solution and compiles them in the proper order.
Or, if you want to rearrange the dependencies yourself, just click the Project menu and pick "Project Dependencies" to set it up.
If you really want to write your own MSBuild files, I guess you can get an overview of it from this[^].
|
|
|
|
|
I have a problem:
if (radioButton1.Checked)
a.SubItems[1].BackColor = Color.Green;
else if (radioButton2.Checked)
a.SubItems[1].BackColor = Color.Orange;
else if (radioButton3.Checked)
a.SubItems[1].BackColor = Color.Red;
else if (radioButton4.Checked)
a.SubItems[1].BackColor = Color.White;
if i execute that code, the subitem don't change the color
how works??
|
|
|
|
|
|
I have a problem:
if (radioButton1.Checked)
a.SubItems[1].BackColor = Color.Green;
else if (radioButton2.Checked)
a.SubItems[1].BackColor = Color.Orange;
else if (radioButton3.Checked)
a.SubItems[1].BackColor = Color.Red;
else if (radioButton4.Checked)
a.SubItems[1].BackColor = Color.White;
|
|
|
|
|
Are you constipated? Are rabbits eating the cabbage in your garden? Are you on an airplane that has been hijacked? No? Then perhaps your problem is that you insufficiently described the "problematic" results you are seeing from running the above code, and will get NO help until you do. Be specific.
-Jeff
|
|
|
|
|
And the first problem I spotted was "You forgot to mention your query ".
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
I have the following FolderWatcher.cs class that monitors and deletes fies older than X number of days.
using System;<br />
using System.IO;<br />
using System.Collections;<br />
using System.Text;<br />
<br />
namespace Files_ExtLib1<br />
{<br />
public class FolderWatcher<br />
{<br />
string m_FolderPath;<br />
<br />
public FolderWatcher()<br />
{<br />
}<br />
<br />
#region Property<br />
public string FolderPath<br />
{<br />
get<br />
{<br />
return m_FolderPath;<br />
}<br />
set<br />
{<br />
m_FolderPath = value;<br />
}<br />
}<br />
#endregion<br />
<br />
public int DeleteFilesOlderThan(int Days, int Hrs, int Mins)<br />
{<br />
string[] oldFilePaths = FilesOlderThan(Days, Hrs, Mins);<br />
int count = 0;<br />
foreach (string filePath in oldFilePaths)<br />
{<br />
try<br />
{<br />
File.Delete(filePath);<br />
count++;<br />
}<br />
catch (Exception e)<br />
{<br />
Console.WriteLine("Unable to delete " + filePath);<br />
Console.WriteLine("Reason: {0}", e);<br />
}<br />
Console.WriteLine("Files successfully deleted");<br />
}<br />
return count;<br />
}<br />
<br />
<br />
public string[] FilesOlderThan(int Days, int Hrs, int Mins)<br />
{<br />
TimeSpan ts = new TimeSpan(Days, Hrs, Mins, 0);<br />
ArrayList oldFilePaths = new ArrayList();<br />
string[] filePaths = Directory.GetFiles(FolderPath);<br />
DateTime currentDate = DateTime.Now;<br />
foreach (string filePath in filePaths)<br />
{<br />
DateTime lastWriteDate = File.GetLastWriteTime(filePath);<br />
if ((currentDate - lastWriteDate) > ts)<br />
{<br />
oldFilePaths.Add(filePath);<br />
}<br />
}<br />
return (string[])oldFilePaths.ToArray(typeof(string)); <br />
}<br />
}<br />
}
I need to test this peice of code on a dummy foler. I already did it buh I want to add 2 more methods.
1) method that will create dummy test files for me with format .txt, .exe, .log
2) secondly, to test my class, i want a method that will delete specific file types. e.g delete .txt files only or .exe, or .log
Anybodyy can help me with this?
Thanks alot
|
|
|
|
|
hello, everybody
my problem is the following:
I want to make a course project that would be applied in students payroll department in my university. this department has two units. each unit must have its own interface but the database would be shared for the two interfaces. so I made new project in MVS 2005 C# with 3 forms (LogIn Form,Form1,Form2). logIn form is the start form that link to the form1 or form2 based on username and password of the two units. and I want to make something like mail between the two forms.
my database has the following tables:
1. "Unit1Mail": to stores the mails of unit1 those unit2 sent.
2. "unit2Mail": to stores the mails of unit2 those unit1 sent.
so I put timers in form1 and form2 to check if there is new message.
so checking of new message will be done by comparing the old number of rows of the "Unit1Mail" or "Unit2Mail" tables and the current number of rows.
so in form1_load handler, I put this statement to get the old number of rows and stores it in global variable "i":
this.oleDbDataAdapter1.Fill(this.dataSet11,"Unit1Mail");<br />
i = this.dataSet11.Tables["Unit1Mail"].Rows.Count;
and in timer1_teck handler, I put these statements to compare the ole and current numbers:
this.dataSet11.Clear();<br />
this.oleDbDataAdapter1.Fill(this.dataSet11, "Unit1Mail");<br />
if (this.dataSet11.Tables["Unit1Mail"].Rows.Count > i)
this.label1.Text = " You have a new message";
and also I do the same in Form2
and then, I sent a message from unit1 to unit2 . but I don't know why it didn't work correctly (the label1 didn't show the string that u have new message)
so, is there any problem with these statements????
please I need help with this situation....
|
|
|
|
|
Hello to all you pro's,
I have a small problem i don't understand.
I have a constructor, in which i initialize some of my object members,
after that I wanna call btnOK.performClick() in order to call the buttons click event handler.
this is a login screen which I want to be able to run threw batch file.
I pass to Main the user and password, but it waits for a user to click OK.
I wanted to make it full automatic so inside c'tor i wrote btnOK.performClick().
this doesn't work, this program doesn't jump to the handler. what can I do about it????
here is some relevant code, don't hesitate if any more data is required.
thank you all for your help.
in Main()
if (!EltavGateway.Properties.Settings.Default.UseDefultLogin)
{
frmLogin frmLoginUser = new frmLogin();
if (frmLoginUser.ShowDialog() != DialogResult.OK)
{
return;
}
}
else
{
frmLogin frmLoginUser = new frmLogin(args);
if (frmLoginUser.ShowDialog() != DialogResult.OK)
{
return;
}
}
in function
public frmLogin(String[] args)
{
InitializeComponent();
//if the flag for automatic login is flagged true, then check that main was
//passed arguments for login(run from batch file). if not, go to regular login.
//enter an existing user and password
if (args.Length == 2)
{
tbName.Text = args[0];
tbPassword.Text = args[1];
this.btnOK.PerformClick();
}
}
P.S
sorry for the code presentation but for some reason I can't use the labels "pre" and "code",
since it tells me I am leaving the page and loosing all data.
|
|
|
|
|
Why are you even clicking on the button?? Don't bother.
Move the code that's in the OK button's click event to it's own method, say you call it PerformLogin, then call it from where you have your current PerformClick line. Obviously, remove this line since it's useless to you.
Rewrite your OK buttons click event handler to call this same method with the appropriate parameters.
|
|
|
|
|
thanks man,
my problem appeared to be in some other place in my code,
but you really pointed me in the right direction.
thank you very much for your time and help.
really appreciate it.
have a great day.
|
|
|
|
|
Visual Studio 2005 Proffesional edition does not want to debug my .NET program because 'The Binding Handle Is Invalid'. I tried to disable Visual Studio hosting process and it worked for C# desktop app. BUT I cannot do it in ASP .NET project (there isn't such option).
After hours of Googling I found the same answer everywhere: I have to turn on 'Terminal Servises' or set it to the 'manual' mode. Unfortunately I cannot perform that -- I get a message "The service cannot be turned on because it is turned off or some of it's dependencies are turned off" (translation from Polish, don't know exact english version). And yes, RPC is enabled.
Please help. I would like to learn ASP.NET but it is difficult without debugging. Of course it is possible anyway but if I have $10.000-level MSVS I do want to use it's capabilities.
Reference:
[^1]
[^2]
Greetings - Gajatko
Portable.NET is part of DotGNU, a project to build a complete Free Software replacement for .NET - a system that truly belongs to the developers.
|
|
|
|
|
There is no App_Code folder when I try to create a new ASP.net folder for my project.
Please help me.
Thanks
|
|
|
|
|
ss.mmm wrote: There is no App_Code folder when I try to create a new ASP.net folder for my project.
Please help me.
Right-click the website item in the Solution Explorer. Go to 'Add ASP.NET folder' and select 'App_Code'.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
Hi All,
Please help me to find a way to kill a process(say cmd.exe) running on network machine.
I have admin rights on one machine and I am only able to get the process running on client machine but when i go to kill any of the process i am caught with access denied or action not allowed kind of exceptions. (I think Process class will not serve here)
Please help.
Thanks in advance
vivek
v
|
|
|
|
|
You can't. The account your code is running under must have admin rights to the target machine in order to kill the process. There is no way around this requirement.
|
|
|
|
|
yes I have the admin rights.
please guide me on this.
thanks in advance.
v
|
|
|
|
|
Hi All,
I am able to kill the process on remote machine but sometime i get RPC Server not running/available exception.
Anybody knows how to overcome this problem ?
Thanks in advance
v
|
|
|
|
|
Hey guys
I have a few cool ideas for a chord book app for musicians. The idea behind something like this is pretty basic, you are anchoring chords above text. The problem is that I come from a web background, and I have no clue where to even start with something like that.
What I would like to be able to do is drag an image from a pallet over some text. When it is over the text, I would like something like the text cursor to appear in between individual characters. Once the mouse is released, I would like to display that image anchored over that bit of text (so after dragging a chord, if the user goes to the start of the line and types more, the image will move with the text). I would also like to be able to do some typesetting for printing (to be able to put the chord names in a line above the text, but have it anchored again. simple with monospace, but I want to support not monospace fonts for printing)
I have no clue where to even start looking to make stuff like this. If anyone could point me in the right direction, it would be greatly appreciated.
|
|
|
|