|
hi all,
how can i use datagridview footer ?
any document or simple explanation please ?
(or) one more question: i have a dataset in my datagridview. there is a field in access which was formatted as Number. (this access table is the datasource of datagridview)
am i able to add a new row and write a 'string' (lets say TOTAL) in that Number field ?
thanks in advance,
bye.
|
|
|
|
|
|
hi all,
i have two tables (table1 and table2). table1 contains table2's fields and a few extra fields.
example:
table1(x,y,z,t) in this table: x & y are text fields.
table2(x,y) > in this table: x & y are date/time fields.
my question is: i want to search for some data in database according to the field types in table2 but i want to get values from table1.
to make it crystal clear: lets say x is startdate and y is enddate. i can compare date values in table2. but in table1 x & y values are just text fields.
lets consider one example: 6/6/2006 6/16/2006. if you compare these two values as date: second one is bigger. (returns 1) but if you compare these two values as text. first one is bigger!
so my problem is: i want to compare date values and get z,t from table1 according to search comparision results.
finally set the result to a dataset ?
thanks in advance,
bye.
-- modified at 6:52 Thursday 8th June, 2006
|
|
|
|
|
Just use cast(x as datetime) or the convert function with similar syntax and it'll magically convert to a datetime value. That is, if it's properly formatted, although you seem to believe that it is.
|
|
|
|
|
I admire ur effort in tryin to make ppl understand ur problem. However, it is a bit confusing to understand still. In relational databases and even in the one u mentioned either table1 or table2 has x and y as foreign keys. Wht I dont understand is r u having trouble with comparing or retrieving.
To compare dates you can use DateTime.Compare
and to retrieve values u need command and data reader.
for instance, u write
cmd = new OleDbcommand("Select z,t from Table1 where result ='"+ variable_with_compare_result+"'"",Conn);
result can be a variable at runtime or another column in the database that stores the comparision result.
I could help but i dont understand the prob
If only they could see what I see in my mind
|
|
|
|
|
hi all.
how to compare file signature with spyware signature
muhammad mahmood ilyas
|
|
|
|
|
Looks like you and Gulfaraz are working on the same homework problem.
How was your spyware signature generated? All you have to do is run the same routine on your file. I'd imagine it's just a byte-by-byte comparison.
|
|
|
|
|
have you any idea about generation of a signature. i am working on it from last many days, but i am unalbe to solve my problem, i read topics about it, every one says signature has this quality, it is secure etc, but no one says do it in this way. so i wrote this query, may some one reply me which can be useful. may any one tell me the algorithm or something useful.
muhammad mahmood ilyas
|
|
|
|
|
Hi to all,My query is
what is the file signature and how can be access in c#
-- modified at 6:47 Thursday 8th June, 2006
|
|
|
|
|
Is this what you're talking about?
FileHash hash = new FileHash() ;
string hashCode = hash.GetHashCode(new FileInfo(@"c:\tempfile.txt")) ;
//now, you can compare the hashCode to a prior hashCode. If it doesn't match, the file has been modified in some way.
|
|
|
|
|
Hello Everybody,
In my application connection string is below and the database working on another computer.
Unfortunately I couldn't connect it. What could be the problem? (I checked the IP number and it is correct. Also I could connect local database). I tried some other connection strings but none of them could connect.
Thanks a lot.
SqlConnection conn = new SqlConnection(("Data Source=10.11.11.126;Initial Catalog=northwind;Integrated Security=SSPI"));
|
|
|
|
|
What's the error you got? Is this ASP.NET code, or in some WinForm app?
You're probably dealing with an authentication error: the user that the code is running as doesn't have login rights to the server.
|
|
|
|
|
try adding userid and password , if that dont work also try name="That comp name"
If only they could see what I see in my mind
|
|
|
|
|
try adding userid and password of the comp u r trying to connect to, if that dont work also try name="That comp name".
If only they could see what I see in my mind
|
|
|
|
|
I solved it. I used a winform. After I added my user name (Windows authentication) I could connect. However if I use the same connection string which is below I couldn't connect in Asp application. Is there any idea?
Thanks.
SqlConnection conn = new SqlConnection(("Data Source=10.11.11.133;Initial Catalog=northwind;Integrated Security=SSPI"));
|
|
|
|
|
Read XML as Dataset and Populate it into treeview.
|
|
|
|
|
All your posts over the last week have either been "Urgent" or "Very Urgent". Operating in this sort of crisis mode all the time is not good for your health.
"On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question."
--Charles Babbage (1791-1871)
My: Website | Blog
|
|
|
|
|
Like this?
DataSet DS = new DataSet();
// to read
DS.ReadXml(@"Path"); // reads the XML to the dataset
// to write
DS.WriteXml(@"Path"); // Saves the dataset to XML
|
|
|
|
|
|
What's with all the 5 word questions? If you can't invest the time to explain your delima, why should anybody take the time to respond?
Visit BoneSoft.com
|
|
|
|
|
Wooooow boy. Don't you sound like M? (The lady who orders James bond around?).
Like when M calls James on a private line and just got time to deliver a 1 line message: "Urgent, Flying eagles are gettinng closer to Jumping Frogs"
Listen buddy: If you don't try out some stuff on your own, you cannot survive eating on posts and forums. You seem to be exactly that kind of parasite who sucks but never gives. Next time try such a catchy title, and see how the community of back-savers gets back at you.
Koushik Biswas
|
|
|
|
|
Hi freinds,
How to set default document in IIS 6.0 from commandline.
It can be set from IIS manager but I need to run it with cscript.exe.
Is there any way to do this with IISVdir.vbs or IISWeb.vbs or any other way
Regards
Bhaskar
-- modified at 5:34 Thursday 8th June, 2006
|
|
|
|
|
please post me , how i could change font size or style or ... of a specified item from listbox in win app VS2003 ?!
Thanks
Salmani
-- modified at 5:05 Thursday 8th June, 2006
|
|
|
|
|
You can set the color of individual items in a ListBox using C# in your .NET WinForm by writing your own handler for the listbox's DrawItem event.
Set the ListBox's DrawMode property:
Add a standard ListBox to your .NET WinForm then set it's DrawMode property to OwnerDrawFixed which forces the ListBox's DrawItem event to be fired.
Write the handler for the DrawItem event:
private void lstBox_DrawItem(object sender, System.Windows.Forms.DrawItemEventArgs e)
{
//
// Draw the background of the ListBox control for each item.
// Create a new Brush and initialize to a Black colored brush by default.
//
e.DrawBackground();
Brush myBrush = Brushes.Black;
//
// Determine the color of the brush to draw each item based on
// the index of the item to draw.
//
switch (e.Index)
{
case 0:
myBrush = Brushes.Red;
break;
case 1:
myBrush = Brushes.Orange;
break;
case 2:
myBrush = Brushes.Purple;
break;
}
//
// Draw the current item text based on the current Font and the custom brush settings.
//
e.Graphics.DrawString(((ListBox)sender).Items[e.Index].ToString(),
e.Font, myBrush,e.Bounds,StringFormat.GenericDefault);
//
// If the ListBox has focus, draw a focus rectangle around the selected item.
//
e.DrawFocusRectangle();
}
In the InitializeComponent section associate your handler to the DrawItem event:
this.lstBox.DrawItem += new System.Windows.Forms.DrawItemEventHandler(this.lstBox_DrawItem);
|
|
|
|
|
Hi,
Need Help Please!
Appearing Error Message: "Object reference not set to an instance of an object", while pointing to dgvInventoryItems.
Problem 1)
Despite of Checks, this message come when i click on the empty (last) row of the DataGridView which is binded with the DataTable.
if (this.dgvInventoryItems.CurrentRow != null )<br />
{<br />
this.tbItemNrEdit.Text = this.dgvInventoryItems.Rows[index].Cells["ItemNr"].Value.ToString();<br />
....... }
Problem 2)
The same message again appear when trying to get value from the cell of a non-binded DataGridView. This time it has a string value, but again its generating the above mentioned error message.
Trying to get value from the cell in CellLeave event of the grid.
here is the code.
private void dgvNewInventory_CellLeave(object sender, DataGridViewCellEventArgs e)<br />
{<br />
long id=333; string strval;<br />
strval = this.dgvNewInventory.Rows[e.RowIndex].Cells[0].Value.ToString();
dgvNewInventory.Rows[e.RowIndex].Cells[1].Value = id;
}
Where i'm making mistak.
Thanks.
_____________________________
Success is not something to wait for, its something to work for.
|
|
|
|