|
I need to store some user seetings and wonder how to do that...
Of course I was thinking to mix XML serialization with IsolatedStorage IO.
BUT
I believe it exists an API for that, I even used it (and forget about it).
However in my somewhat hazy memory it was abusively complex to use properly.
Any tips?
|
|
|
|
|
I think you are looking for Application configuration file and API that supports reading/writing to it.
What version of .NET are you using?
--------------------------------------------------------
My portfolio & development blog
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
I watched a tutorial (and even tried it!) where you could databind the position of your windows to some user settings and the windows position is automatically save and restored any time you leave & start the application!
That's the thing I'm looking for!
I have .NET 2.0.
Anyway I wrote a nice and simple ConfReaderWriter class which take care of all the IO & persistent aspect using Isolated storage and XML serialization.
But that doesn't automatically save ↦ restore my windows position but I manage to make it work
|
|
|
|
|
You reinvented the wheel by that one, becouse it is already implemented in the .NET framework (I can't remember the name right now).
As for that automatic saving I really don't know. Try google.
--------------------------------------------------------
My portfolio & development blog
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
I might have reinvented the wheel, but it was a small and well hidden wheel
But I would be happy to know about it!
|
|
|
|
|
Hi
I am using .NET component to execute a Biztalk 2004 rules policy which takes an input xml message and returns me updated xml message, as explained in Case A.
Case A:
Input xml with ID value:
<Emp>
<ID>1002</ID>
<Income/>
</Emp>
Output xml with ID and Income value:
<Emp>
<ID>1002</ID>
<Income>50000</Income>
</Emp>
Case B:
Input xml with IDs of multiple employees:
<Employees>
<Emp>
<ID>1000</ID>
<Income/>
</Emp>
<Emp>
<ID>1001</ID>
<Income/>
</Emp>
<Emp>
<ID>1002</ID>
<Income/>
</Emp>
</Employees>
Output desired:
<Employees>
<Emp>
<ID>1000</ID>
<Income>40000</Income>
</Emp>
<Emp>
<ID>1001</ID>
<Income>50000</Income>
</Emp>
<Emp>
<ID>1002</ID>
<Income>60000</Income>
</Emp>
</Employees>
My question is: How can I acheive the desired output using .NET components? I want to execute policy only through C# code and get back the result.
Please advise. Thanks in advance.
Pankaj
Follow your goals, Means will follow you ---Gandhi---
|
|
|
|
|
I have a repeater control to display thumbnail pictures. The itemtemplate is made of a web image control. When user clicks on the thumbnail picture, I want it to display a larger image in a web image control and display the image description in a label control( the image description is saved in database).
My current code is :
I have a getPhoto function which will get the thumbnail pictures through IhttpHandler and bound to the repeater control.
Then I have a repPhotoG_ItemDataBound function, here I add the javascript to the image html control and call a javascript to pass the thumbnail imagename as parameter and show the large image.
Now, I can get the thubnail picture and display the large images, but I just don’t know how to get and display the image description. Please help!!
private void repPhotoG_ItemDataBound(object sender, System.Web.UI.WebControls.RepeaterItemEventArgs e)
{
//finding repeater item Image
System.Web.UI.HtmlControls.HtmlImage img=(System.Web.UI.HtmlControls.HtmlImage)e.Item.FindControl("iPhoto");
//create a relative path for image and add onclick function
img.Src=img.Src.Replace('\\', '/');
string Description="";
string Image;
Image=IMGpath(img.Src);
img.Attributes["onclick"]="showImg('"+Image+"')";
}
function showImg(imgName)
{
imgOn = ("" + imgName);
document.imgLarge.filters[0].Apply();
document.imgLarge.src = imgOn;
hdr.innerHTML=imgName;
document.imgLarge.filters[0].Play();
-- modified at 17:29 Monday 5th June, 2006
|
|
|
|
|
I have written a program that runs fine when launched from a PC with
VS2005 installed, but crashes when launched on a PC with just the
redistributable installed.
The message is the standard dialog box '..has encountered a problem and
needs to close'. Please tell microsoft about this problem.
There is no exception shown.
I can't install the compiler to track it down cause then the problem
will go away.
It's not a security setting because the tester fixed the problem by installed VS2005 without changing any settings.
Any ideas?
|
|
|
|
|
Neil_Scales wrote: standard dialog box '..has encountered a problem and
needs to close'. Please tell microsoft about this problem.
You should be able to click on Show Error Data or a button that's labelled something like that, if I remember correctly you click several links through different dialog boxes and you will receive a text box which has the exception details in it, in the middle of details of all the loaded dlls and version information.
Neil_Scales wrote: It's not a security setting because the tester fixed the problem by installed VS2005 without changing any settings.
Are you referencing a DLL that might only be used in VS.NET (the only example I can think of at the moment is envdte.dll which is the interface libarary for writing VS.NET add-ins (you probably won't be using that but it was the only example I could think of).
Best bet is to wrap your Main routine inside a try...catch block and dump any error message out to the screen or a file. E.g.
static void Main(string[] args)
{
try
{
}
catch (Exception exception)
{
Console.WriteLine(exception.ToString());
MessageBox.Show(exception.ToString());
System.IO.File.WriteAllText(@"errorlog.txt", exception.ToString());
}
}
You know you're a Land Rover owner when the best route from point A to point B is through the mud.
Ed
|
|
|
|
|
How will u load dynamic assembly? How will create assemblies at run time?
|
|
|
|
|
|
You can use reflection to load the assembly dynamically.
Kanumilli
|
|
|
|
|
I downloaded the gdWrapper, and wrote some code to draw a part on the fly. I want to save the png file as a file, and I want to stuff the PngStream into a SQL Server Image Table Column.
The instructions for the gdwrapper are kind of vague, can't figure out what the call is for writing the file to the disk drive.
Here is what I have so far , This is my first time using JScript
I call the file 'RenderPart.asp'
<%@language=jscript%>
<%
//Gather all the data needed to make the drawing
//var TX = Request.QueryString("TX") * 3
//var TY = Request.QueryString("TY") * 3
//var AX = Request.QueryString("AX") * 3
//var AY = Request.QueryString("AY") * 3
//var BX = Request.QueryString("BX") * 3
//var BY = Request.QueryString("BY") * 3
//var BV = Request.QueryString("BV") * 3
//var CX = Request.QueryString("CX") * 3
//var CY = Request.QueryString("CY") * 3
//var JobNumber = Request.QueryString("JN")
var TX = 120
var TY = 90
var AX = 18
var AY = 44.7868
var BX = 39.2132
var BY = 45.2132
var BV = 30
var CX = 80.7868
var CY = 24
var JobNumber = "CF1"
// Write image/png header
Response.ContentType = "image/png";
// Set 'dynamic' content to expire immediately (depends on situation)
Response.Expires = -1000;
// Create variables
var gdImage = Server.CreateObject("GDLibrary.gdImage");
// Create a new paleted image in memory ... or ...
//gdImage.Create(250, 200);
//Calculate the image size if it gets real big
var CTX;
var CTY;
if(TX > 480) {
CTX = TX + 50;
} else {
CTX = 480;
}
if(TY > 320 ) {
CTY = TY + 40;
} else {
CTY = 320;
}
gdImage.Create(CTX, CTY);
// Add/Return RGB True Color values
var White = gdImage.ColorAllocate(255, 255, 255);
var Black = gdImage.ColorAllocate(0, 0, 0);
var Red = gdImage.ColorAllocate(255, 0, 0);
var Blue = gdImage.ColorAllocate(0, 0, 255);
var Green = gdImage.ColorAllocate(0, 255, 0);
//Calculate TotalBox First, Then Draw it
//gdImage.Rectangle(0, 0, TX, TY, Black);
//Caluclate PartB, then Draw it
//(sX, sY, fX, fY, color)
gdImage.Line(0, 0, 0, BY, Red); //Verrical
gdImage.Line(0, 0, BX, 0, Red); //Horzontal
gdImage.Line(0, BY, AX, BY, Red);
gdImage.Line(BX, 0, BX, CY, Red);
gdImage.Line(AX, BY, BX, CY, Red); //Vortex
//Calculate PartA Next, then draw it
//(sX, sY, fX, fY, color)
gdImage.Rectangle(0, BY, AX, AY+BY, Red);
//Calculate PartC, then Draw it
//(sX, sY, fX, fY, color)
gdImage.Rectangle(BX, 0, CX+BX, CY, Red);
// Label the Drawing now
//gdImage.Chars(gdImage.FontGetMediumBold(), 75, 10, "Horizontal Y-Axis", Black);
//gdImage.CharsUp(gdImage.FontGetMediumBold(), 460, 225, "Vertical X-Axis", Black);
//gdImage.Chars(gdImage.FontGetTiny(), AX / 4, (BY / 4), "Part B", Black);
//gdImage.Chars(gdImage.FontGetTiny(), AX / 4, AY, "Part A", Black);
//gdImage.Chars(gdImage.FontGetTiny(), (CX / 3) + BX, (BY / 4), "Part C", Black);
gdImage.Chars(gdImage.FontGetMediumBold(), 10, TY + 20, "Scale: 3 Pixels Per Inch", Black);
gdImage.Chars(gdImage.FontGetSmall(), 10, TY + 35, "Job Number: " + JobNumber, Black);
// Before output, if we want a Palleted Png (256 color), run the next command!
gdImage.TrueColorToPalette(false, 256);
// For Gradients, Dithering will help but increase the file size!
// Return a Png data stream
Response.BinaryWrite(gdImage.ToPngStream().Read);
gdImage = null;
%>
|
|
|
|
|
Hi,
anyone pls help me regarding this.i have one checkbox column in my datagrid by selecting that check box i need to get that entire row in the next page of that application.multiple selection is true.
pls its urgent for me.
Regards,
sivamyneni
sivamyneni
|
|
|
|
|
I was wondering if there is a way to merge tables together in a dataset.
I can pull a "Select * FROM Table A" and fill the DataSet then do it for Table B as well in no time flat. But I don't know how to merge them into one table
But if I do a "Select a.Name, a.ID, b.ID, b.Number FROM a.Table AND b.Table B WHERE a.ID=b.ID" and fill a single table in my dataSet, but it takes so much longer because I am doing this over a connection.
Or am I missing the boat and something other than a DataSet is the way to go?
Thanks!
RABB17
|
|
|
|
|
You can do selects and joins on DataSets, but it's more complicated and annoying than doing it on the database.
I don't understand why a simple inner join takes noticably longer than a flat query. It certainly has nothing to do with your connection to the database. More likely, you've got a poorly-optimized database. Your previous question was about MySQL, so I'll assume that's what you're using. MySQL should be able to do a 1-column inner join on a million rows with a proper index in less time than a table scan (which is what you'd get if you did select name, id) from each table. I don't respect MySQL very much, but it's a hell of a lot more competent than to whimper on a 1-column inner join.
What's your DB look like?
|
|
|
|
|
The dataset is capable of joining tables, but the database is generally better at it.
If you join the tables in the query it should take about the same time to fetch as fetching the tables separately, unless one of the tables are much larger than the other so that joining the tables creates a result with mostly duplicates from the smaller table.
---
b { font-weight: normal; }
|
|
|
|
|
I have multiple tables that I'm pullng into a DataSet.
My first method was to run a query and merge the data I need into one table using the MySQL command.
But here's my problem. I have a shared field x_ID where in one Table A it is null and in Table B it is the primary.
For example:
I have
Table A
Customer_Purchase $5, $4, $3
Customer_ID 1, 2, null
Table B
Customer_ID 1, 2, 3, etc
Customer_Name ...
My return for Who purchased what would only have 2 rows and I'd rather have all three, even though one would have no name in it.
Thanks!
RABB17
|
|
|
|
|
1. You're posting on the wrong board. This is a SQL question.
2. What's your SQL query?
3. Tell us a little more about your table structure.
Otherwise:
If Customer_ID in Table A is a foreign key, you shouldn't allow nulls. If you have to, and you want three rows back, do an outer join. You still won't get a Customer_Name for the null/$3 record because there's no null key in Table B, which was probably enforced because Customer_ID is probably a primary key.
If you post your SQL query, I can probably help you more specifically.
|
|
|
|
|
Dear gurus,
my app has a rich user-interface which I have to test extensively by mouse-clicking on all the menus, buttons,.....
My idea now is to create a small tool which sends all this clicks,... automatically to my application for testing the user-interface.
Does anyone have an idea how this can be accomplished?
Or are there any other ideas.
Kind regards
|
|
|
|
|
Use the System.Windows.Forms.Cursor class, this has a property Position, you can use this to move the cursor.
Regarding actually pushing the mouse button I'm not sure if you can do this without having to resort to calling the Windows API, from what I remember the mouse events are quite easy to send using the appropriate API.
This[^] article may be useful to you.
You know you're a Land Rover owner when the best route from point A to point B is through the mud.
Ed
|
|
|
|
|
This doesn't seem like the best way to accomplish this task. There are many, many applications out there that can be used to script mouse moves and clicks. You'll save yourself a lot of time and trouble if you use one of those.
|
|
|
|
|
While implementing an automated GUI test tool may be an interesting and fun challenge, you may be better off purchasing au automated test tool. There are quite a few on the market, and you should be able to get one for as little as $500. In the long run, it would be cheaper to purchase the tool than to invest your time into developing your own. Just my two cents...
Jim Conigliaro
jconigliaro@ieee.org
|
|
|
|
|
You can get one for significantly less than $500: free. There are shareware and freeware click generators out there that work much better than anything anyone on this board can write in a couple day's time (no offense to anyone intended).
|
|
|
|
|
Hallo !
Thanks for your answer.
Can you give me any hint which tools are free-/shareware?
With kind regard
|
|
|
|
|