|
reality_strikes wrote: crystalReportViewer1.ReportSource = ReportDoc;
Shouldn't this line be outside your loop? At the moment, it's being called in every iteration.
|
|
|
|
|
pete, thanks for the reply..........i tried even tht b4..........whn i place that line outside the loop, it displays the first record for some milliseconds and the crystal report screen blinks and then it loads the second record and it goes on till the last record and then finally the last record is displayed on the crystal report screen........still need help.............
|
|
|
|
|
I'm trying to access image resources in my application, but I can't the resources from the application, I just end up with null. I've added the resources in the properties section in visual studio 2008, and the code I'm using is
private ResourceManager res = new ResourceManager("MyNameSpace.Properties.Resources", System.Reflection.Assembly.GetExecutingAssembly());
Image myImage = (Image)res.GetObject("myImage.png");
But myImage is always null. I know I could use MyNameSpace.Properties.Resources.myImage.png, but I need to get the resource from a string.
|
|
|
|
|
My guess is you have it set as an embedded resource. In that case, you need to use the manifeststream of the assembly.
|
|
|
|
|
hi,
i have a custom installer class for a setup of my project.
The library has been added with custom actions and is doing his work. so far so good.
But my library (using hasp_net_windows.dll) needs second library (msvcr71.dll not a dotnet lib) (Hasp key)
and my setup doesn't find the msvcr71.dll library (also not marked as a dependency).
So during setup the code of the second library is not executed, because he did not found the file.
Does anyone has an idea in which path or dir it searches for the msvcr71.dll ?
it surely is not the dir where the setup is and also not the installation path (c:\program files)
thx
Kurt
|
|
|
|
|
I am using adobe flash cs3 and c# in my windows application.
I am sending value from c# to cs3 application. I am able to send value to flash
application. I am using flash shockwave object .
AxShockwaveFlash asFlash = new AxShockwaveFlash();
// loading multiple swf file in Layers
asFlash.LoadMovie(0,"1.swf");
asFlash.LoadMovie(1,"1.swf");
swf in Layer0 loads dynamically taking value from xml.
now I want to Load a swf in Layer0 after periodic time. and want to keep layer0
swf as it is. but when I try to load swf in Layer0 , it dosen't load it Properly.
Is there any api to unload movie .
Is there any way to solve the problem.
|
|
|
|
|
Inspired by HA and generally always wanting to do this, I've been working on a c# roguelike in my free time. I'm kind of at an impasse with my Map structure. The way I have it organized is I have two objects:
1. A MapCell, this contains the current Cell's character as well as Color, and an enum specifying whether it's Solid, Open, Water, etc. You get the picture.
2. A Map which right now is nothing but a 2D Array of MapCells.
Works good, but I need someway of implementing a map history. That is say in item drops on a cell the normal open floor character '.' gets replaced by an item character '/'. When the item gets picked up I want it to revert back to the floor character.
It's a bit more complicated then that though. So now say the player walks over the item, now the cell has a '@' character in it. If the player leaves the Item can leaves the Cell then the item still needs to persist and if the character takes the item then the floor character needs to show.
I've currently implemented the above behavior with a stack inside of the Cell object, my concern is performance on a 512,512 map. Does anyone have any better suggestions on how to tackle this? ANy help is greatly appreciated.
|
|
|
|
|
Disconnect the map abstraction from your specific implementation of the characters being drawn.
Have a map cell class that holds an enum for the floor type. Have an item class that stores the items location (or hold it in an item property on the mapcell class). and a player class that stores the players location.
When you draw the map, decide on the character to draw at the last moment. Iterate through the grid, check if the player is on the cell, (if so draw the player), then check if there is an item there (if so, draw the item), then if neither of the first checks resulted in anything being drawn, check the cell type and draw the cell. Don't ever then rely on looking at what's been drawn to decide on the current state. Use the state of the objects to decide what to do. When something changes, change the objects and call a method to simply redraw the affected cells, this will then be easy to redraw as you just look at your object state again for each cell being drawn.
(Finally, don't worry about performance until it starts to cause problems. You're writing a ascii drawn game, you really aren't going to hit any performance problems drawing a 500x500 grid of ascii characaters on any semi modern PC.)
Simon
|
|
|
|
|
Thanks allot. I suppose I just couldn't make that last leap in the logic of it. I was already having everything keep track of it's own location as well as it's own character.
|
|
|
|
|
There are 2 list box and a horizontal Splitter. When I resize the window, both the listbox does not resize proportionally. The top listbox remains in same height, the bottom listbox gets resized.
The properties for splitter is
cursor - HSplit
Dock - Top
The properties for listbox1 is
Dock - Top
Anchor - Top,Left
The properties for listbox2 is
Dock - Fill
Anchor - Top,Left
Changing the dock or Anchor do not work out..
|
|
|
|
|
Hi,
In order to get the desired resolution try setting the Dock property of first ListBox to Fill. This will ensure that the ListBox resizes proportionally to the window. Since the Dock property is set to Top, the width will resize in proportion to the window size.
Hope this helps.
Vinay
ComponentOne LLC.
www.componentone.com
|
|
|
|
|
HI,
I tried that option too.
If both the dock properties of the listbox is set to fill,
only one listbox is visible.
|
|
|
|
|
|
chenli0513 wrote: i want get the regular of the website
then i can download it by the regular!
thanks you help!
chenli0513@yahoo.com.cn lee!
Sorry, your question doesn't make any sense.
What do you mean by "the regular" of the website?
Try carefully rewriting your question so we can understand you.
Simon
|
|
|
|
|
Change the subject line, I might add
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
http://www.albahari.com/nutshell/predicatebuilder.html[^]
I found a link about expressions. Can someone explain that how can I use? Is it helpfully?
or are there any idea for my problem with LINQ and expressions? (please don't say REGEX)
I have a class like this:
public class SearchWord
{
...
public string Search_key { get; set; }
public string And_key { get; set; }
public string Not_key { get; set; }
...
...
}
SearchWord sw1 = {Search_key = "test", And_key = "", Not_key = ""};
SearchWord sw2 = {Search_key = "test", And_key = "email", Not_key = ""};
SearchWord sw3 = {Search_key = "test", And_key = "email", Not_key = "engin"};
I have a big text:
string forSearch = "test hkkdkh yrfjkdh ggshdj bla bla bla email bla bla sdkj engin";
there are 4 case for my situation:
test = returns bool
test and email = returns bool
test and engin = returns bool
test and email and engin = returns bool
Now, I want to compare this 4 result and return SearchWord(if result = true)
Please help me...
|
|
|
|
|
enginço wrote: please don't say REGEX
Uhmmmmmmm...Regex ?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Yeahhh, finally I solved my problem with expressions and linq.
There is no REGEX
thanx o'relly books
|
|
|
|
|
How can i get the button click event of a button placed within a datagridview
|
|
|
|
|
|
Hi All,
I want to get the record count for a SQL Query other than count(*), because dont want to manipulate the query. I want to get the record count for any given query. Is there any method available in .net?
Or is there any method available in SQLBulkCopy Class as I'm using it?
For example given query is "Select x,y from z where x=l", I need to get the record count for that.
Any ideas?
Thanks in Advance
Shah_tech
|
|
|
|
|
execute the query and look at how many rows are returned?
|
|
|
|
|
Try this:
Select count(*) from z where x=l;
Would return the number of rows which meets the where clause.
|
|
|
|
|
But, I dont want to even modify the given query. And I dont want to execute the query and get the count using loops because my query will return arount 1crore records. I just want to get the record count directly without modifying the existing query.
any more ideas?
Thanks in advance
Shah_tech
|
|
|
|
|
Hi,
Without any more info about the problem (what database, connection type etc.), it's hard to give any exact answer, but some ideas might be useful:
1. If you execute a select statement using SQLCommand (or corresponding class) and then get the row count from returned SQLDataReader class using property ReccordsAffected. You get the actual count of returned rows without any loop.
2. If you don't want to manipulate the original query, you can still construct a nested query. For example:
string originalQuery = "SELECT x,y FROM z WHERE x=l";
string countQuery = "SELECT COUNT(*) FROM (" + originalQuery ")";
SQLCommand countCommand = new SQLCommand;
countCommand.CommandText = countQuery;
...
This would result in a query which executes the original query, creates a result set which is then counted. So this means it returns only one row and one column, the record count.
This solution varies between different databases, because all databases cannot handle nested result sets.
3. Create a stored procedure into the database which actually executes the statement and returns the row count. Something like this semi-code
PROCEDURE RowCount(IN statement, OUT rows)
BEGIN
EXECUTE statement;
rows = SQL%ROWCOUNT;
END;
4. If possible, ask the datatabase optimizer how many rows it thinks may be returned (using procedure). This implementation is fully database-dependent.
Hope this helps,
Mika
|
|
|
|