|
I never knew that. I have a few places where that may be beneficial.
|
|
|
|
|
I implementd CLR stored procedure on 'Database1'. I would like to perform some UPDATE statements inside this CLR stored procedure in 'Database2'. Is is possible? If so, then how?
|
|
|
|
|
Ask this in the General Database forum.
|
|
|
|
|
How can I email a web page. My html attachments come as attachment (hope I make sense!).
In one article they use ScreenScrapeHtml but I can get it, I have imported Sytem.Net and IO as suggested but still cant get ScreenScrapeHtml.
I am using .net 2.0 vs 2005.
Thanking you in advance.
I remain joe!
"Only the best"
|
|
|
|
|
When you do a request for a web page (in your c# code), the response is a string of HTML. Simply set the email type to HTML, and use the response text as the body of the email.
.45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
Thanks, it's working.
This Tutorial[^] helps a lot.
Thanks once more for your response.
I remain joe!
"Only the best"
|
|
|
|
|
Hi
Im having trouble with a imported function called ICCompress. Im not sure if I have transled the function properly can someone help me?
Native
typedef struct tagBITMAPINFOHEADER {
DWORD biSize;
LONG biWidth;
LONG biHeight;
WORD biPlanes;
WORD biBitCount
DWORD biCompression;
DWORD biSizeImage;
LONG biXPelsPerMeter;
LONG biYPelsPerMeter;
DWORD biClrUsed;
DWORD biClrImportant;
} BITMAPINFOHEADER;
DWORD ICCompress(
HIC hic,
DWORD dwFlags,
LPBITMAPINFOHEADER lpbiOutput,
LPVOID lpData,
LPBITMAPINFOHEADER lpbiInput,
LPVOID lpBits,
LPDWORD lpckid,
LPDWORD lpdwFlags,
LONG lFrameNum,
DWORD dwFrameSize,
DWORD dwQuality,
LPBITMAPINFOHEADER lpbiPrev,
LPVOID lpPrev
);
C# code
[StructLayoutAttribute(LayoutKind.Sequential)]
public struct BITMAPINFOHEADER
{
public uint biSize;
public int biWidth;
public int biHeight;
public ushort biPlanes;
public ushort biBitCount;
public uint biCompression;
public uint biSizeImage;
public int biXPelsPerMeter;
public int biYPelsPerMeter;
public uint biClrUsed;
public uint biClrImportant;
}
[DllImport("MSVFW32.dll")]
public static extern int ICCompress(
IntPtr hic,
UInt32 dwFlags,
ref BITMAPINFOHEADER lpbiOutput,
IntPtr lpData,
ref BITMAPINFOHEADER lpbiInput,
IntPtr lpBits,
out UInt32 lpckid,
out UInt32 lpdwFlags,
int lFrameNum,
UInt32 dwFrameSize,
UInt32 dwQuality,
IntPtr lpbiPrev,
IntPtr lpPrev
);
The code that calls ICCompress is
compressorHnd = Avi.ICOpen(Avi.FOURCC.ICTYPE_VIDEO, Avi.FOURCC.mmioFOURCC('L','E','A','D'), Avi.ICMODE.ICMODE_COMPRESS);
outbi = new Avi.BITMAPINFOHEADER();
inbi = new Avi.BITMAPINFOHEADER();
outbi.biSize = Convert.ToUInt32(Marshal.SizeOf(outbi));
outbi.biBitCount = 24;
outbi.biWidth = 640;
outbi.biHeight = 480;
outbi.biPlanes = 1;
outbi.biBitCount = 24;
outbi.biCompression = 0;
inbi.biSize = Convert.ToUInt32(Marshal.SizeOf(inbi));
inbi.biWidth = width;
inbi.biHeight = height;
inbi.biPlanes = 1;
inbi.biBitCount = Convert.ToUInt16(countBitsPerPixel);
byte[] outImgData = new byte[(outbi.biHeight * outbi.biWidth * (outbi.biBitCount / 8))];
GCHandle outImgHnd = GCHandle.Alloc(outImgData, GCHandleType.Pinned);
UInt32 lpckid = new Int32();
UInt32 lpdwflags = new Int32();
int i = Avi.ICCompress(compressorHnd,
0,
ref outbi,
outImgHnd.AddrOfPinnedObject(),
ref inbi,
inBmpDat.Scan0,
out lpckid,
out lpdwflags,
frameNum,
0,
5000,
IntPtr.Zero,
IntPtr.Zero);
So the ICCompress call returns -2 and there is no data in outImgData. Does anyone know where I have gone wrong?
|
|
|
|
|
Ok i think that the problem is that I havnt specified the correct format in lpbiOutput. So I need to get the correct output format. I found a function called ICCompressGetFormat but I dont know how to use it. Can I import this function?
|
|
|
|
|
When you want to provide more info, and if you're not responding to a reply, edit the original message.
.45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
Hello everyone...
I'm presently creating an application using a customized DLL from our original system. the said DLL uses UDL directly from "C:\" root directory to connect to MSSQL server... The new application will process the data through the said DLL and will connect to different MSSQL servers but will only use 1 UDL. My 1st attempt was to create a UDL directly using "StreamWriter" so that the new application can dynamicaly change the server name but it did not work... I compared the UDL created from a streamwriter against the one created in notepad but i found no diferences between the two.....
How can i make a dynamic UDL file that can be used by the said DLL?
thank you in advance ang more power...
xxx
|
|
|
|
|
Isn't it possible that the .DLL loads the UDL once and won't reload it on every access to the database? If that's the case, you've got a big problem. The .DLL won't unload until the app closes and relaunches.
|
|
|
|
|
I load and unload the DLL everytime i change the server. the steps are:
1. Load DLL calling the UDL.
2. Process and store the data locally using XML format.
3. Unload DLL.
4. Change UDL server.
5. Load again the DLL...go step 2....
xxx
|
|
|
|
|
Hey,
I'm writing a small application for currency convert, i'm using some webservice i found.
I want to use a progressbar while i'm waiting for webserver response.
how can it be done ? (i mean, how exactly i know how much data i already got, or it's more like how long take the connection time until i get a response from the web server)
thanks
|
|
|
|
|
Hi,
if you use HttpWebRequest and HttpWebResponse classes, you get a response stream, of which you can get total length (not always available!) and then get the data line by line in a loop; doing so you could show progress.
My CP Vanity[^] article contains a downloadPage() method that uses said classes (however it does not show progress within a page).
|
|
|
|
|
In the event that you don't know how much data you have, a "marquee" progress bar is what you need. Google is your friend.
.45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
simple and elegant...
thanks
|
|
|
|
|
i've some problem using it...
everything is works great till the "last line"
but when i'm trying to stop the Marquee Animation by setting MarqueeAnimationSpeed to 0 and also i put a '0' into progressBar.value nothing happens...
the progress bar just freezes
here how it's looks like :
private void backgroundWorker1_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
{
ArgumentsResult ar = (ArgumentsResult)e.Result;
label_currentTime.Text = DateTime.Now.ToString();
label_Amount.Text = ar.Amount + " " + ar.CurrnecyFrom + " = " + ar.Conversion + " " + ar.CurrnecyTo;
progressBar1.Value = 0;
progressBar1.MarqueeAnimationSpeed = 0;
groupBox_result.Visible = true;
}
any idea how to solve it ?
tanks
|
|
|
|
|
hi,
i have to load resources from dll based on os language.How can i reference dll?
|
|
|
|
|
try this ... [DllImport("DLL_NAME.dll")]
|
|
|
|
|
If you're looking to localize your application, .NET supports doing this automatically if you've supplied the data in resources and written your code correctly. Start reading here[^].
|
|
|
|
|
hi guys
i want to get first and last date of week given by a week number and year
is there any way ?
regards.
Tauseef A Khan
MCP Dotnet framework 2.0.
|
|
|
|
|
|
Following is the code for retrieving first and last day of the given date.
You need to give date instead of just year and week no.
In following code I have also counted sunday as one of the week day.
You can omit sunday in switch case.
DateTime dt;
dt = DateTime.Today;
DateTime date = DateTime.Now;
System.Globalization.CultureInfo cult_info = System.Globalization.CultureInfo.CreateSpecificCulture("no");
System.Globalization.Calendar cal = cult_info.Calendar;
int weekNo = cal.GetWeekOfYear(dt, cult_info.DateTimeFormat.CalendarWeekRule, cult_info.DateTimeFormat.FirstDayOfWeek);
MessageBox.Show(weekNo.ToString());
int plus1 = 0;
int minus1 = 0;
switch (date.DayOfWeek)
{
case DayOfWeek.Monday:
plus1 = 6;
minus1 = 0;
break;
case DayOfWeek.Tuesday:
plus1 = 5;
minus1 = 1;
break;
case DayOfWeek.Wednesday:
plus1 = 4;
minus1 = 2;
break;
case DayOfWeek.Thursday:
plus1 = 3;
minus1 = 3;
break;
case DayOfWeek.Friday:
plus1 = 2;
minus1 = 4;
break;
case DayOfWeek.Saturday:
plus1 = 1;
minus1 = 5;
break;
case DayOfWeek.Sunday:
plus1 = 0;
minus1 = 6;
break;
}
MessageBox.Show(date.AddDays(-minus1).ToShortDateString());
MessageBox.Show(date.AddDays(plus1).ToShortDateString());
Jinal Desai
|
|
|
|
|
Why not just use the numeric values of the days? See here[^] for some hints about using these values.
It's time for a new signature.
|
|
|
|
|
ya we can do in that way also.
I am just interested in solution. (However it is not optimized solution)
Jinal Desai
|
|
|
|