|
aboudk wrote: about type checking and type compatibilty in C#
There is something called http://msdn.microsoft.com/[^]. Did you even bother to visit it and do a simple search of your queries there?
aboudk wrote: my email: aboud_cs_1986@hotmail.com
Disclosing email addresses in public message boards is a sure-stop way to invite more spam.
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
Hi!
I am a bit lost. I want to upload a files and key-value pairs via
HTTP post.
A single file and a single collection of key-value pairs is easy. You just
have to use the System.Net.WebClient class and its UploadFile, UploadValues
method.
Can anyone explain to me how to post both files and values with one request?
I would very much appreciate any hint!
with Regards
Amjath
|
|
|
|
|
Well, I guess it depends on what the server is expecting. Is it expecting files and name value pairs in a single request?
Another way of posting data to the web is to use the HttpWebRequest Class. This has a property which I think is called 'verb' which you want to set to POST. You can then send as much data as you like using this. It's stream based. Is that the sort of thing you're after?
Regards,
Rob Philpott.
|
|
|
|
|
Hi
i am creating dataTable at runtime and binding rows at runtime . how to insert the all the rows in dataTable to database
|
|
|
|
|
i think u should use the bulk copy
If you have an apple & I have an apple and we exchange our apples, then each of us will still have only one apple but if you have an idea & I have an idea and we exchange our ideas, then each of us will have two ideas!
|
|
|
|
|
<asp:gridview id="GridView1" runat="server" autogeneratecolumns="false" onrowcommand="GridView1_RowCommand" datakeynames="categoryname">
<columns>
<asp:buttonfield commandname="Discount" datatextfield="categoryname" headertext="Discount" text="Category Name">
modified on Monday, March 17, 2008 6:40 AM
|
|
|
|
|
Normally, I'd tell someone who posted something like this to read here[^], but in your case, I'm not sure it will help. I can't even work out what it is that you're asking, or why you felt that posting a half ASP.NET tag would constitute a question. All I know for sure is that you're in the wrong forum, but if you decide to take this to the ASP.NET forum, please be sure to ask an actual question there. And, at that point, odds are good you'd do well to check out my link first.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hello..
In VS2003, if I set the version to 1.0.* then the revision and build version will be automatically generated. But not in VS2005. Must I set something to use this function ?
Thanks...
|
|
|
|
|
I need to do four numbers, but it works in 2005 for me. 1.0.0.*
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.ArgumentException: Parameter is not valid.
at System.Drawing.FontFamily.GetName(Int32 language)
at System.Drawing.FontFamily.get_Name()
at System.Windows.Forms.Internal.WindowsFont.FromFont(Font font, WindowsFontQuality fontQuality)
at System.Windows.Forms.Internal.WindowsGraphicsCacheManager.GetWindowsFont(Font font, WindowsFontQuality fontQuality)
at System.Windows.Forms.TextRenderer.DrawText(IDeviceContext dc, String text, Font font, Rectangle bounds, Color foreColor, TextFormatFlags flags)
at System.Windows.Forms.Label.OnPaint(PaintEventArgs e)
at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer, Boolean disposeEventArgs)
at System.Windows.Forms.Control.WmPaint(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.Label.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
************** Loaded Assemblies **************
mscorlib
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
BarcodeLabelGenerator
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///C:/Pro%20Data%20Doctor%20Barcode/Barcode%20Label%20Generator%20Software%20Demo/BarcodeLabelGenerator.exe
----------------------------------------
System.Windows.Forms
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System.Configuration
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Xml
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.
For example:
<configuration>
<system.windows.forms jitdebugging="true">
When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.
|
|
|
|
|
Wow, a lot of info we didn't need, and no code.
Looks to me like you tried to load a font by name, and the name was invalid.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hello Sir,
I tried to load the font and font name is correct..
its running good but some time it give this error.....
|
|
|
|
|
Well, so long as you want to keep the code a secret, I can't hope to help you. Perhaps if you also told us how often it works, under what circumstances it fails, all the pertinent info you didn't put in your original post.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hello Sir,
All this thing happen when i use some other options of my application like changing color opening help file...
This is the font used to add fonts to my application
class PrivateFonts<br />
{<br />
[DllImport("Gdi32.dll", CharSet = CharSet.Auto, SetLastError = true, ExactSpelling = true)]<br />
private static extern IntPtr AddFontMemResourceEx(IntPtr pbFont, int cbFont, int pdv, ref int pcFonts);<br />
public System.Drawing.Text.PrivateFontCollection GetFont(string[] FontResource)<br />
{<br />
string NameSpc = System.Reflection.Assembly.GetExecutingAssembly().GetName().Name.ToString();<br />
System.IO.Stream FntStrm;<br />
System.Drawing.Text.PrivateFontCollection FntNc = new System.Drawing.Text.PrivateFontCollection();<br />
int i;<br />
for (i = 0; i <= FontResource.GetUpperBound(0); i++)<br />
{<br />
FntStrm = System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream(NameSpc + "." + FontResource[i]);<br />
byte[] ByteStrm = new byte[(int)FntStrm.Length];<br />
FntStrm.Read(ByteStrm, 0, Convert.ToInt32((int)FntStrm.Length));<br />
IntPtr FntPtr = System.Runtime.InteropServices.Marshal.AllocHGlobal(System.Runtime.InteropServices.Marshal.SizeOf(typeof(byte)) * ByteStrm.Length);<br />
System.Runtime.InteropServices.Marshal.Copy(ByteStrm, 0, FntPtr, ByteStrm.Length);<br />
FntNc.AddMemoryFont(FntPtr, ByteStrm.Length);<br />
Int32 pcFonts;<br />
pcFonts = 1;<br />
AddFontMemResourceEx(FntPtr, ByteStrm.Length, 0, ref pcFonts);<br />
System.Runtime.InteropServices.Marshal.FreeHGlobal(FntPtr);<br />
}<br />
return FntNc;<br />
}<br />
}
|
|
|
|
|
Which line blows up ? This looks super nasty, why do you need to do all this ? Are you loading fonts from your resources ?
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Yes i am loading fonts from resources
|
|
|
|
|
My other questions were 'why do you need to do that' and 'which line blows up'. How often does it blow up ? Can you reproduce it, and know it will blow up ( i.e. does it blow up every third time or something ) ? If you read your error message, it's telling you you have a name wrong. Have you tried making it so it doesn't require the exact name ?
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Sir it does not show any line of error it simply give a message that Parameter is not valid. and application closes.
but when i used to make a setup then and install it on the target machine then it give such a error that i have posted in starting about JIT..
|
|
|
|
|
Sir i fount the error in Program.cs in this line
Application.Run(new Form1());
Description:
{"Parameter is not valid."} {"Parameter is not valid."}
Source="System.Drawing"
Stack Trace
" at System.Drawing.FontFamily.GetName(Int32 language)\r\n at System.Drawing.FontFamily.get_Name()\r\n at System.Windows.Forms.Internal.WindowsFont.FromFont(Font font, WindowsFontQuality fontQuality)\r\n at System.Windows.Forms.Internal.WindowsGraphicsCacheManager.GetWindowsFont(Font font, WindowsFontQuality fontQuality)\r\n at System.Windows.Forms.TextRenderer.DrawText(IDeviceContext dc, String text, Font font, Rectangle bounds, Color foreColor, TextFormatFlags flags)\r\n at System.Windows.Forms.Label.OnPaint(PaintEventArgs e)\r\n at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer, Boolean disposeEventArgs)\r\n at System.Windows.Forms.Control.WmPaint(Message& m)\r\n at System.Windows.Forms.Control.WndProc(Message& m)\r\n at System.Windows.Forms.Label.WndProc(Message& m)\r\n at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)\r\n at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)\r\n at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)\r\n at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)\r\n at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)\r\n at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)\r\n at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)\r\n at System.Windows.Forms.Application.Run(Form mainForm)\r\n at BarcodeLabelGenerator.Program.Main() in E:\\DEMO VERSION\\BarcodeLabelGenerator\\BarcodeLabelGenerator\\Program.cs:line 18\r\n at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)\r\n at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)\r\n at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()\r\n at System.Threading.ThreadHelper.ThreadStart_Context(Object state)\r\n at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)\r\n at System.Threading.ThreadHelper.ThreadStart()"
|
|
|
|
|
Dixy wrote: Parameter is not valid
Dixy wrote: System.Drawing.FontFamily.GetName
This is where we started. Your font name is wrong.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Sir,
So how can i overcome from this problem.
as i have tried so many thing to solve this problem but its still there is no solution..
And i am using thia font
string[] fontNames = { "IDAutomationXC39M.ttf" };
|
|
|
|
|
Sir I am sending the code that i used and the error that comes
I am using this code to embded font:
class PrivateFonts<br />
{<br />
[DllImport("Gdi32.dll", CharSet = CharSet.Auto, SetLastError = true, ExactSpelling = true)]<br />
private static extern IntPtr AddFontMemResourceEx(IntPtr pbFont, int cbFont, int pdv, ref int pcFonts);<br />
public System.Drawing.Text.PrivateFontCollection GetFont(string[] FontResource)<br />
{<br />
string NameSpc = System.Reflection.Assembly.GetExecutingAssembly().GetName().Name.ToString();<br />
System.IO.Stream FntStrm;<br />
System.Drawing.Text.PrivateFontCollection FntNc = new System.Drawing.Text.PrivateFontCollection();<br />
int i;<br />
for (i = 0; i <= FontResource.GetUpperBound(0); i++)<br />
{<br />
FntStrm = System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream(NameSpc + "." + FontResource[i]);<br />
byte[] ByteStrm = new byte[(int)FntStrm.Length];<br />
FntStrm.Read(ByteStrm, 0, Convert.ToInt32((int)FntStrm.Length));<br />
IntPtr FntPtr = System.Runtime.InteropServices.Marshal.AllocHGlobal(System.Runtime.InteropServices.Marshal.SizeOf(typeof(byte)) * ByteStrm.Length);<br />
System.Runtime.InteropServices.Marshal.Copy(ByteStrm, 0, FntPtr, ByteStrm.Length);<br />
FntNc.AddMemoryFont(FntPtr, ByteStrm.Length);<br />
Int32 pcFonts;<br />
pcFonts = 1;<br />
AddFontMemResourceEx(FntPtr, ByteStrm.Length, 0, ref pcFonts);<br />
System.Runtime.InteropServices.Marshal.FreeHGlobal(FntPtr);<br />
}<br />
return FntNc;<br />
}<br />
}
and using this code on button click:
string[] fontNames = {"IDAutomationXC39M.ttf"};<br />
PrivateFonts privateFonts = new PrivateFonts();<br />
System.Drawing.Text.PrivateFontCollection FntNc = privateFonts.GetFont(fontNames);<br />
labelBarcode.Font = new Font(FntNc.Families[0], 12);
But it shows error in Program.cs the error is
System.ArgumentException was unhandled
Message="Parameter is not valid."
Source="System.Drawing"
StackTrace:
at System.Drawing.FontFamily.GetName(Int32 language)
at System.Drawing.FontFamily.get_Name()
at System.Windows.Forms.Internal.WindowsFont.FromFont(Font font, WindowsFontQuality fontQuality)
at System.Windows.Forms.Internal.WindowsGraphicsCacheManager.GetWindowsFont(Font font, WindowsFontQuality fontQuality)
at System.Windows.Forms.TextRenderer.DrawText(IDeviceContext dc, String text, Font font, Rectangle bounds, Color foreColor, TextFormatFlags flags)
at System.Windows.Forms.Label.OnPaint(PaintEventArgs e)
at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer, Boolean disposeEventArgs)
at System.Windows.Forms.Control.WmPaint(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.Label.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at BarcodeLabelGenerator.Program.Main() in E:\DEMO VERSION\BarcodeLabelGenerator\BarcodeLabelGenerator\Program.cs:line 18
at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
|
|
|
|
|
i want to show a mdi child form from another mdi child form....i wrote the code like this
private void btnEdit_Click(object sender, EventArgs e)
{
if (Mdi.adminFormIsup == true)
this.MdiParent.ActiveMdiChild.Close();
if (!Mdi.adminFormIsup)
{
MDIDiary.Update up = new Update(Uid);
up.MaximizeBox = false;
up.MinimizeBox = false;
up.ControlBox = false;
up.Size = new Size(1032, 800);
up.StartPosition = FormStartPosition.CenterParent;
up.Location = new Point(110, 110);
up.MdiParent = this.MdiParent;
up.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
up.Show();
Mdi.adminFormIsup = true;
}
}it is working but it is not showing the mdi parent FormBorder and its toolstripmenuitem...please someone help
|
|
|
|
|
Neetu Maheshwari,
Where do you create the "toolstripmenuitem" ?
Regards,
Gareth.
|
|
|
|
|
gareth111 wrote: Where do you create the "toolstripmenuitem" ?
what r u saying....i have created "toolstripmenuitem" in mdi parent form...but i want to display a mdi child form from another mdi child form.....it is working but not showing the mdi parent form border and its toolstripmenuitem...so please help
|
|
|
|
|