|
Thanx alot ...... i wanna send u thankks card...
it really helpdd me
Again Thanx.. can i hav ur email Address
asd
|
|
|
|
|
Hi,
How can I retrieve the table name from a dataset after filling it..
DataSet1.Tables[0].TableName will always return "Table"
I have a feeling that this's only retrieving the table names set from the code using the same bloody property not the original names in the database
All generalizations are wrong, including this one!
(\ /)
(O.o)
(><)
|
|
|
|
|
Muammar© wrote: I have a feeling that this's only retrieving the table names set from the code using the same bloody property not the original names in the database
You are correct, Sir! If you don't set this variable it will always return its default value. I suggest setting it in your data adapter when you initiate the table.
|
|
|
|
|
Im currently developing a webbrowser and need to know if anyone knows a way to detect all the RSS feeds a site has to offer without having to navigate to a specific XML page.
|
|
|
|
|
Check in the header of the page for any links to a file whose type="application/rss+xml". Check the header of this page for example and you'll see
|
|
|
|
|
Ok thanks. You can check the header in the webrowser control right?
|
|
|
|
|
Just found out that that black screen mode is actually a security mode to prevent other programs from hooking into uac when you enter passwords or something...
anyway to invoke this for other programs?
|
|
|
|
|
I have a dataGridView and as I am processing its rows - with a foreach (dataGridViewRow row in this.dg) I may be setting the visible property to false (based on some processing logic). It works for all rows execept the first row. All appropriate rows disappear from my grid except the first row. I first thought it had something to do with it being the current row, but I physically navigated off the first row and then pressed my process button and the first row still was displayed.
Here is the code that I am using to hide/display the row:
private void HideShowRow(DataGridViewRow row, bool visible)
{
CurrencyManager cm = (CurrencyManager)BindingContext[dgSTSimport.DataSource];
cm.SuspendBinding();
row.Visible = visible;
cm.ResumeBinding();
}
I stepped through my code and at the end of the loop, the visible property for the first row was false. As I was processing the second row and setting values for some of its cells, for some reason the visible property of the first row got set back to true (I kept the first row in my watch window). The only code that sets the visible property is the method above, and the debugger never stepped into that code while I was processing the second row, so I am at a loss as to why this is happening.
I put an intermediary fix in place to loop through all the rows in the datagrid a second time and reset the visible property based on the status of the row. That worked fine, but I do not want to have to loop through all the rows a second time if I do not have to.
Any ideas as to what I am missing?
|
|
|
|
|
Can anyone tell me how I can return an array of bitmaps?
I have declared Bitmap[] test = new Bitmap[30]
and tryed to fill it with test[length++]=b (length being initialized to 0, and b being the bitmap)
but the "test" array does not seem to hold the bitmaps, except the last one.
Can anyone point me if not, as to what I have to read to learn how. :S
|
|
|
|
|
AKXman wrote: have declared Bitmap[] test = new Bitmap[30]
and tryed to fill it with test[length++]=b
So, all your array elements ended up holding hte same bitmap ? This is not a value type, it's a class. Unless b is redefined every time, you will find they all point to the one bitmap, change one and you change them all, because there is only one, just 30 references to it
The Clone method of hte Bitmap class will work just fine for this, but you need to cast the result.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Thank You.
I tried bunch of things to keep the bitmaps, and I just happened to stumble upon the .Clone() option.
I don't understand why that works, but I will keep searching for an answer, some tutorial or a book ...
Thank You again.
|
|
|
|
|
It works for the reason I stated. Without it, all your array elements are references to the same bitmap, only one exists in memory, and so when it changes, all the elements change.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi,
there are only a few ways to create an object, the most obvious is using the "new" keyword;
others are calling a method that says Create() or Clone(). Everything else does not create
new objects, at best it duplicates a reference to a pre-existing object.
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|
|
Thank You both for Your answers.
I have managed to solve my problem inspite of all the unknowns I have encountered.
Mucho thanx to CodeProject and MSDN.
|
|
|
|
|
you're welcome.
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|
|
Hi
Can any one provide me with help on how to serialize this collection of objects? I was trying to put some tags, but I am not really getting anywhere.
<br />
[XmlRoot ()]<br />
public class TableList<br />
{<br />
private ArrayList tableList;<br />
<br />
public TableList()<br />
{<br />
tableList = new ArrayList();<br />
}<br />
<br />
[XmlArray("tables")]<br />
public MyTableItem[] Tables<br />
{<br />
get<br />
{<br />
MyTableItem[] tables = new MyTableItem [tableList.Count];<br />
tableList.CopyTo(tables);<br />
return tables;<br />
} <br />
}<br />
<br />
public int AddTable(MyTableItem table)<br />
{<br />
return tableList.Add(table);<br />
}<br />
<br />
<br />
public class MyTableItem<br />
{<br />
TableInfo TableInfo = new TableInfo();<br />
<br />
[XmlElement("name")]<br />
public string TableName = string.Empty;<br />
[XmlElement("id")]<br />
public string OasisID = string.Empty;<br />
[XmlElement("Info")]<br />
public Object TableInformation = new Object();<br />
<br />
public MyTableItem ()<br />
{<br />
<br />
}<br />
<br />
public MyTableItem (string Name, string OasisID)<br />
{<br />
this.TableName = Name;<br />
this.OasisID = OasisID;<br />
TableInformation = TableInfo.GetTableInformation(Name);<br />
}<br />
}<br />
<br />
public class TableInfo<br />
{<br />
public TableInfo ()<br />
{<br />
<br />
}<br />
<br />
public Object GetTableInformation (string tableName)<br />
{<br />
if (tableName == "Table1")<br />
{<br />
Table1 tb1 = new Table1();<br />
return tb1;<br />
}<br />
<br />
if (tableName == "Table2")<br />
{<br />
Table2 tb2 = new Table2();<br />
return tb2;<br />
}<br />
return null; <br />
}<br />
}<br />
<br />
public class Table1<br />
{<br />
[XmlAttribute()]<br />
public string Prop = "Hello";<br />
<br />
public Table1()<br />
{<br />
<br />
}<br />
}<br />
<br />
public class Table2<br />
{<br />
[XmlAttribute()]<br />
public string WhatIsThis = "Test string";<br />
<br />
public Table2()<br />
{<br />
<br />
}<br />
}<br />
Thank you very much!
|
|
|
|
|
A couple of posts down you were saying that you serialized an object. Did you read my response or you are just asking around without a clue?
A couple of links for you: clickety[^]
|
|
|
|
|
Does anyone know how can I position the new form so that it shows the new record from the database, and not the first one?
I tried it like this, but it didn't work:
<br />
CurrencyManager cm = (CurrencyManager)this.BindingContext[myDataSet, "Author"];<br />
int numberOfRows = cm.Count;<br />
cm.Position = numberOfRows + 1;<br />
|
|
|
|
|
If you have a column that contains an Auto-Generated Index then you can sort by that and then pick either the first or last row based on how you sort. Otherwise, you would have to monitor each insert and handle it that way.
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo
|
|
|
|
|
Anyone know a good method for implementing a findnext-ish function on a BindingSource ?
bindingSourceObject.Find works great for finding single rows but won't find the next value.
I'm thinking maybe declaring a DataRow array and assigning its value with dataTableObject.Select . Once I do that I use bindingSourceObject.IndexOf(dataRowArray[nextindex]) to get the desired position of the next row.
Does anyone have any better, more efficient ideas? If so, I'd like to hear them.
|
|
|
|
|
I guess I was on the right track. Here's the code that makes it work.
BindingSource _mainBS;<br />
string _fieldname;<br />
TARData.TARDataSet.DataRow[] _mRA;<br />
string _searchstring;<br />
int _currentPosition;
_mainBS is assigned by a constructor, likewise _fieldname .
public void FindNext() {<br />
if (_searchstring != textBox1.Text)<br />
{<br />
_searchstring = textBox1.Text;<br />
_currentPosition = 0;<br />
string searchCrit = getColumnSearchString(((DataRowView)_mainBS.Current).DataView.Table.Columns[_fieldname].DataType);<br />
_mRA = (TARData.TARDataSet.Carter_TAR_MainRow[])((DataRowView)_mainBS.Current).DataView.Table.Select(<br />
searchCrit + " LIKE '%" + _searchstring + "%'");<br />
}<br />
<br />
if (_mRA.Length > 0) {<br />
this._mainBS.Position = this._mainBS.Find("Main_ID", _mRA[_currentPosition]["Main_ID"]); ;<br />
}<br />
_currentPosition = (_currentPosition + 1) % _mRA.Length;<br />
}
Just in case _fieldname is an int type, I throw in this little tidbit to perform a convert.
private string getColumnSearchString(Type type)<br />
{<br />
if (type == typeof(int))<br />
return "Convert(" + _fieldname + ",System.String)";<br />
else return _fieldname;<br />
}
Not too efficient, but I still like admiring it. Not a bad way to spend an hour of my day.
|
|
|
|
|
Is there anyway to unbox an object without knowing its exact type? I have a situation where I have an object that is guaranteed to be castable to a double. I want to compare it to another value that I have stored as a double. Just casting the object to a double results in an invalid cast exception if the object is not of type double.
The only other way I can see to do this is to hard code cases for every value type that the object could possibly be, but this is obviously a pretty undesirable solution.
|
|
|
|
|
You could always try
try{
Convert.ToDouble(...)
}
catch (...)
{
} If you're using .NET1.1. If you're using .NET2 then take a look at
bool isDouble = double.TryParse(value.ToString(), out doubleVal);
|
|
|
|
|
Thanks for the advice. Parsing it as a string works perfectly.
|
|
|
|
|
How can this
jka347 wrote: Just casting the object to a double results in an invalid cast exception if the object is not of type double
be a problem if this
<blockquote class="FQ"><div class="FQA">jka347 wrote:</div>an object that is guaranteed to be castable to a double</blockquote>
is true?
You could also try object.Equals ( val1 , val2 )
|
|
|
|