|
i thought that he has written some javascript validation in some event
i never made CausesValidation to true that might be reason
Any way Thanks for showing right path
Thanks and Regards
Sandeep
If you want something you never had,
do something you have never done!
|
|
|
|
|
You set the causevalidation property of the close button to false and it will work for you.
|
|
|
|
|
I think you are checking a null or empty value in your validation event. You should skip validation if the text is empty. Or you can add a bool _isClosing = false variable to your class and set it to true on Form.Vlosing event, then skip validation in your textboxes' validation event if _isClosing is true. Hope this helps.
|
|
|
|
|
Send the piece of code.
As i guess, your textboxes are empty when the use clicks close(X sign on to Form Titlebar) validation fails because you validate if the text entered in the textbox is empty or not, if empty fail the validation which vauses form to give focus to this textbox back instead of closing.
|
|
|
|
|
hi i am using remoting on c#.net window application trying to pass 1 int value to the server thru the network.
i have decided to use remoting but i feel that there is some limitation to it that dont fit what i need please advice me pls.
(i will post my test program below)
firstly i realise that when the client connect to the server the client just create an instance with the server's class and not actually passing any value over to the server...
secondly i cant find a way for the server to react when the client pass some values to it.
the class object:
<br />
namespace ClassLibrary1<br />
{<br />
public class Class1 : MarshalByRefObject<br />
{<br />
string aa;<br />
public Class1()<br />
{<br />
aa = "55"; <br />
}<br />
public string abc(string ab)<br />
{<br />
<br />
return (ab + aa);<br />
}<br />
}<br />
}
server:
private void Form1_Load(object sender, EventArgs e)<br />
{<br />
TcpChannel channel = new TcpChannel(8080);<br />
ChannelServices.RegisterChannel(channel);<br />
<br />
RemotingConfiguration.RegisterWellKnownServiceType(<br />
typeof(ClassLibrary1.Class1),<br />
"HelloWorld",<br />
WellKnownObjectMode.SingleCall);<br />
}
client:
private void Form1_Load(object sender, EventArgs e)<br />
{<br />
<br />
TcpChannel chan = new TcpChannel();<br />
ChannelServices.RegisterChannel(chan);<br />
<br />
ClassLibrary1.Class1 obj = (ClassLibrary1.Class1)Activator.GetObject(<br />
typeof(ClassLibrary1.Class1),<br />
"tcp://localhost:8080/HelloWorld");<br />
<br />
string lala = obj.abc("kings");<br />
label1.Text = lala;<br />
<br />
}
|
|
|
|
|
What is the issue you are facing?
Mubashir
Software Architect
Storan Technologies Inc, USA
Every job is a self portrait of the person who did it.
|
|
|
|
|
i found that i made a mistake while understanding the theory of remoting
|
|
|
|
|
i am using foreach statement to read all the strings in a string array but while reading all the time it is showing System.Data.DataRow in the string identifier
here is code which is giving the above specified problem:
string[] fileidentifiers = ReturnFileIdentifiers();
foreach (string identifier in fileidentifiers)
if (identifier == fileidentifier)
|
|
|
|
|
Does ReturnFileIdentifiers() do what it's supposed to do?
/ravi
|
|
|
|
|
Yes it is returning all the strings properly.
|
|
|
|
|
i tried with your code but its working.
i am pasting the code here please update
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace testApp
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private string[] ReturnFileIdentifiers()
{
string[] sample = { "sujith", "syam", "tharun" };
return sample;
}
private void button1_Click(object sender, EventArgs e)
{
string fileidentifier = "sujith";
string[] fileidentifiers = ReturnFileIdentifiers();
foreach (string identifier in fileidentifiers)
if (identifier == fileidentifier)
{
MessageBox.Show("hi" + fileidentifier);
}
}
}
}
My small attempt...
|
|
|
|
|
Then you're returning a collection of DataRows and you need to pull out the values that you need.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
|
You have a collection of data rows. Do a foreach that recognises this fact. You can get items out of a data row by index or by name, using array notation.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hello,
Try to use a for loop, with an indexer!
for(int x=0;x < fileidentifiers.Length; x++)
{
string actIdentifier = fileidentifiers[x] as string;
if(actIdentifier.Equals(fileidentifier)
{
}
}
Hope it helps!
All the best,
Martin
|
|
|
|
|
Even this is not working by the way my ReturnFileIdentifiers code would be below
string[] ReturnFileIdentifiers()
{
using (OleDbConnection connection = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=E:\\Warehouses_older\\Sample1_cat61.mdb"))
{
OleDbDataAdapter adapter = new OleDbDataAdapter("SELECT MD_Metadata.FileIdentifier FROM MD_Metadata", connection);
DataTable FileIDs = new DataTable();
adapter.Fill(FileIDs);
string[] fileids = new string[FileIDs.Rows.Count];
for (int i = 0; i < FileIDs.Rows.Count; i++)
fileids[i] = FileIDs.Rows[0].ToString();
return fileids;
}
}
|
|
|
|
|
kalaveer wrote: fileids[i] = FileIDs.Rows[0].ToString();
The ToString method of DataRow is inherited from the Object class, and returns the name of the data type.
What is is that you are trying to read from the data table?
---
single minded; short sighted; long gone;
|
|
|
|
|
But while debugging fileids contents are the string values of that perticual field contents which i queried using oledb command.
|
|
|
|
|
The debugger is showing you the contents of the rows.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I think you whant to return the Item (FileIDs.Rows[0].Item) from the DataRow class.
Don't you?
|
|
|
|
|
kalaveer wrote: System.Data.DataRow in the string identifier
what is your return statement in the ReturnFileIdentifiers(); function
or while addding to the array of string you are not properly adding them in ReturnFileIdentifiers(); function
Thanks and Regards
Sandeep
If you want something you never had,
do something you have never done!
|
|
|
|
|
Hey everybody!
I created a crawler using a WebBrowser object. it works really great but a few not-so-small problems.
I'm crawling using Document_complete event to get the body of the page, and I'm extracting the links using Document.Links property.
The problem is that When sometimes the crawler crawls to files (mp3, pdf etc.) and it executes them (which, of course, is NOT what I want). besides that it prompts (like in IE) when it navigates into password-needed sites and secured (encrypted) pages.
I've tried to remove these pop-ups and files execution, but I without any success. I just can't find a way to disable these "features" of the WebBrowser (so it won't act as IE, but simply making requests and extracting links without using regular expressions).
Help anyone?!
People, your my only hope!
Thanks A LOT in advance!
|
|
|
|
|
You may want to consider using this[^] instead of a WebBrowser control to crawl and extract info from HTML pages. And if you want an MFC version, see this[^] article.
/ravi
|
|
|
|
|
Hello everyone,
I have a DataGrid which is populated by data from the Database server. The following codes shows this.
<br />
OdbcAd = new System.Data.Odbc.OdbcDataAdapter("SELECT * FROM " + SelectedTableName + ";", OdbcCon);<br />
<br />
DataSet myds = new DataSet();<br />
<br />
OdbcAd.Fill(myds, SelectedTableName);<br />
<br />
dataGridView1.DataSource = myds.Tables[SelectedTableName];
I was wondering if it is possible to run queries on the DataGrid's data similar to the one that can be run on the data stored in database server?
Thank you very much and have a great day.
Khoramdin
|
|
|
|
|
In my aspect,
data grid is only for displaying data as in tabular format, not to query information
evil
|
|
|
|