|
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
|
|
|
|
|
Hi,
You would actually run your "query" on the DataSet. By that I mean you can filter and sort it.
Here is an example:
http://samples.gotdotnet.com/quickstart/howto/doc/adoplus/FilterData.aspx
Reply back if you have more questions!
Justin
|
|
|
|
|
My understanding say that you can't query dataset, but what best you can do is to filter the dataset - datatable to fect the required information and bind it again.
|
|
|
|
|
Try DataTable.Select(string filterExpression9 of the underlying datasource ( in your case: SelectedTable ) and hide the rows in your datagridview which are not in the result set returned by this method. What I would do is, not to modify original datasource which is "SelectedTableName", but execute SelectedTable.Select(....) and store the result in thze Tag value of the DataGrid which is a object value. Then set the datasource to this result set. Afterwards, if you want to see the original(non-filtered) rows, you won't need to retrieve them from the data store again. Hope this helps.
|
|
|
|
|
hi i would like to know if there is a function that can be writen that will execute after the content of the instance is changed in window applciation in c#.net
|
|
|
|
|