|
Hi,
I need to get data from SQL and write it on an application using the application's web services.
I need this to be scheduled.
What's best to do?
Write a Windows Service and schedule it or write a console application and schedule it in the Task Scheduler?
Thanks in advance
|
|
|
|
|
I'd go for the console-application, read the records in a DataTable and pump them one by one to the WebService of the application that you're going to export to. That's easily scheduled through the Windows Task Scheduler, and easy to understand (therefore, easy to maintain)
You can run a console-application as a service and effectively delay this decision. There are some freeware-tools out and about that can help in this regard.
--edit--
Question was about a Windows-service, not webservice..
I are troll
modified on Wednesday, March 4, 2009 3:39 AM
|
|
|
|
|
Depending on the frequency you need to run this you would do either.
If you have to run this query many times a day, then a service might be in order. If it's just one or two times a day, then a console app launched through the Task Scheduler would be a better choice.
|
|
|
|
|
Has anyone has run into this problem and found a solution. I spent 1/2 day googling with no success.
File -> Open -> Web Site, navigate to my XSLT file, assign an XML input file, set a breakpoint at <xsl:template match="/" > (actually I set one at every line) and click XML -> Debug Xslt.
It shows the output but does not stop at any breakpoint. If I move the files to a different Web Site that uses VS2005, everything works correctly.
Any help would be appreciated.
|
|
|
|
|
How can i convert a color image into pixel matrix using c#.net
modified on Wednesday, March 4, 2009 1:44 AM
|
|
|
|
|
rohan4040 wrote: How can i convert a color image into pixel matrix
By writing code - in the language of your choice.
|
|
|
|
|
If you had magnified between the lines of his post like times 100 you would have seen:
"Send me the codes pleezzzzz, it's urgent"
|
|
|
|
|
I urgently ignored the subtext.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys
|
|
|
|
|
a slow but easy way to do this is to use the Bitmap class' GetPixel method.
I am writing this code as I go and will probably contains error:
class ByteColor
{
public byte R;
public byte G;
public byte B;
}
Bitmap myBMP=new Bitmap("myimage.jpg");
int iW=myBMP.Width;
int iH=myBMP.Height;
ByteColor[,] myPixelMatrix=new ByteColor[iW,iH];
for(int w=0; w<iw;w++)>
{
for(int h=0; h<ih;h++)>
{
Color tmpColor=myBMP.GetPixel(w,h);
byte cR=Convert.toByte(tmpColor.R);
byte cG=Convert.toByte(tmpColor.G);
byte cB=Convert.toByte(tmpColor.B);
myPixelMatrix[w,h].R=cR;
myPixelMatrix[w,h].G=cR;
myPixelMatrix[w,h].B=cR;
}
}
As I said this is a easy but slow way to do it. for some more speed you can use the LockBits and UnlockBits methodes and copy the byte array right from memory like this:
Rectangle rect = new Rectangle(0, 0, myBMP.Width, myBMP.Height);
BitmapData ImageColorData = myBMP.LockBits(rect, ImageLockMode.ReadWrite, PixelFormat.Format24bppRgb);
unsafe
{
IntPtr pointer = ImageColorData .Scan0;
int Bytesnmpr = ImageColorData .Stride * myBMP.Height;
byte[] ColorValues = new byte[Bytesnmpr];
Marshal.Copy(pointer, ColorValues , 0, Bytesnmpr);
for (int i= 0; i< ColorValues .Length; i++)
{
}
Marshal.Copy(ColorValues , 0, pointer , Bytesnmpr);
}
myBMP.UnlockBits(ImageColorData);
this one is much faster but uses unsafe code.
also remember, I worte the code on the fly, so there is most likely errors in this code
|
|
|
|
|
is this coding related to c#.net or any other form of coding?
|
|
|
|
|
How can i convert a numeric value to binary value
|
|
|
|
|
Well, you can use the Calculator that comes with Windows, or you can read up[^] here.
You can find the conversion-routines (like this[^] one) on Google
I are troll
|
|
|
|
|
Hi All,
I have a requirement, wherein there are expand and collapse gridrow (gridview asp.net 2.0).
Has anyone worked on it or provide a sample code for this asap.
For eg: I have a Author Table with Author ID and Author Name.
If I click on a expand/collapse button before Author ID, it should list out all the books written by him. Something like this?
-----------------------------
+/- Author ID | Author Name
-----------------------------
Book ID | Book Name
-----------------------------
Book 1 | Book 1 Name
Book 2 | Book 2 Name
-----------------------------
Anyhelp will be highly appreciated. I googled through lots of sites, but most of them are using third party controls, which I have a restriction to use it.
|
|
|
|
|
I think you want to investigate using the 'RowCommand' functioanlity of the GridView. For instance; I have a grid that I have placed a button in as follows;
<asp:TemplateField>
<ItemTemplate>
<asp:Button ID="btnViewApp" CommandName="ViewApplication" Text ="View" ToolTip ="View Application" runat ="server" CssClass ="Button" />
</ItemTemplate>
</asp:TemplateField>
The CommandName attribute is used in the code behind;
Protected Sub gridview_RowCommand(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewCommandEventArgs) Handles gridview.RowCommand
If e.CommandName = "ViewApplication" Then
{code to hide the row here.}
End If
End Sub
I can't find a snippet of code quickly for the actual hiding of the row. It isn't very straight forward. But perhaps this will get you close enough. I will reply again if I come across it. Code I have infront of me pulls values out of the selected row. Perhaps you can massage it a bit.
Dim btn As Control = DirectCast(e.CommandSource, Control)
Dim grw As GridViewRow = DirectCast(btn.NamingContainer, GridViewRow)
Session("celltext") = grw.Cells(0).Text
|
|
|
|
|
hi tech freaks...
i just want to make a social network using .net .
in this social network, we have friends list to be built and if i click on friends list then i should get all members in the list in columns. two people icons per column. i should also get the list of mutual friends if i click a button below each friend. if i hover mouse on the friend's icon then the icon should get lifted up and 4 or 5 sub icons should come around the icon like a spider web kind of thing . each icon should have profile picture of that person's friends. and if i bring down mouse, it should go back to normal state. i should have a link below the each icon which can give list of all friends of my friend.
please somebody help with required code
|
|
|
|
|
I don't know how to break this to you, but I don't think anyone on CodeProject will give that code to you. If you build it and get stuck with a programming problem or maybe even a design problem, then lots of people will jump at the chance to give you some help. But, no one, here, will build this for you for free.
If you want someone to build this for you, try Rent-A-Coder[^].
"we must lose precision to make significant statements about complex systems."
-deKorvin on uncertainty
|
|
|
|
|
hello ,
i developed a .NET software which i want people to download from the net.
i know that if they never used a .NET product they probably dont have the right framework installed on their PC
is there a way in ASP to know if remote computer has right framework or not ?
coz by this i will be able to send him either a small sized file or a big sized one which includes the framework installation
thanks in advance
avi
|
|
|
|
|
If they're using IE, then the USER_AGENT of the browser contains the .NET Framework version that they have installed on their system.
Sometimes Firefox/Mozilla will also have the information in its USER_AGENT.
Basically, unless you put something on their computer like an Applet or Silverlight doo-hickey, then you're just going to be shooting in the dark.
"we must lose precision to make significant statements about complex systems."
-deKorvin on uncertainty
|
|
|
|
|
tnx,
and what will happen if a prog will run without the framework installed?
will it be friendly or just crash ?
|
|
|
|
|
Crash. It may display a "Cannot find mscorlib.dll" or it may show "You need the .NET runtime." It's been a long time since I've seen a Windows computer without .NET on it.
"we must lose precision to make significant statements about complex systems."
-deKorvin on uncertainty
|
|
|
|
|
Hi Guys,
I've got a problem rounding floats, when adding a small value repeatedly to another, eventually small errors creep in.
float test = 0;
float increment = 0.2f;
for (int i = 0; i < 100; i++)
{
test += increment;
}
if (test != increment * 100)
throw new ApplicationException("Rounding Error!");
What are the available options to get around this?
regards
Tris
-------------------------------
Carrier Bags - 21st Century Tumbleweed.
|
|
|
|
|
The Ethically Correct Answer: Floating point arithmetic usually comes with errors because of the representation of the significand. A good understanding of floating-point number representations can assist you in finding a good solution for your problem. Try reading What Every Computer Scientist Should Know About Floating-Point Arithmetic[^].
The Unethical Answer: If you would rather take the myopic path and just get a solution, change your float s to decimal s.
"we must lose precision to make significant statements about complex systems."
-deKorvin on uncertainty
|
|
|
|
|
Awesome, cheers.
Have no fear, no WTF's from me, i need to understand how stuff works, so i'm going to go with option A.
Cheers for the pointer
Tris
-------------------------------
Carrier Bags - 21st Century Tumbleweed.
|
|
|
|
|
Most computer floating-point types can only precisely store integer multiples of powers of two; the size of the integer varies with the floating-point type. For example, even a single-precision float can precisely store the value 1/2, 5/16, or even 16,777,215/633,825,300,114,114,700,748,351,602,688 (that's (2^24-1)/2^99). Unfortunately, just as a decimal representation of numbers that do not factor into a power of ten will be an approximation (1/3, for example, may be written as 0.33, or 0.3333333, but neither is entirely precise) so too with binary representations of factions other than powers of two.
Depending upon what exactly you are doing with your data, it may be useful to re-scale values. For example, if everything will be a multiple of 0.01, you should scale your numbers up by a factor of 100. A single can store precisely any integer up to 2^24, and a double can store any integer up to 2^48.
|
|
|
|
|
I've just run NGen on an .exe assembly, to install, and it says all is up to date, but there is no Native Assembly folder in the GAC, nor is there any Native Assembly service. What's up?
|
|
|
|