|
|
Problem were not solved.
In place of giving like
string body = ";
body += "";
body += "this is some HTML text";
body += " ";
i want to give a file name containing all these.. So pls help...
|
|
|
|
|
I don't think specifying just file name will result in the same behavior you need. But If you know name of the file, yo can read its content using StreamReader class and use it according to you needs.
|
|
|
|
|
Could u pls help me for that... Send me the code..
Thanks
|
|
|
|
|
Read the documentation for StreamReader class and it should be obvious to you how to do it.
KP_Prajilal wrote: Send me the code..
Oh yes, I will.
|
|
|
|
|
Hallo Everyone
1st i would like to start off by saying how amazing the people on this site are. I am registered at many places and not event one comes close to this site. The replies are quick and even if someone can’t help you they do leave their comments.
Thanks a lot to all who contribute. It really helps a lot for our newbie’s!!!!!
Now for my next Q?
I am new to .NET. The company I am working for now has a DAL framework that they use.
It has Datasets and upon saving we call a method to determine if the row’s is deleted, detached, added or modified and it calls a stored proc to do the desired action. Now this works very well and easy for single tables.
But I am having problems when I need to display 2+ tables
Example (I know this is silly but it replicates the scenario the best)
Table 1(stored ingredients for a recipe)
Identifier
Name of Ingredient
Table 2 (Stores what ingredients are added to make a ...)
Identity
Name of recipe
Ingredient user
Now I need to display a list of ingredients to the user and they need to choose what to use.
As in....
Please select the ingredients needed for a pie
(Ingredients listed from table 1)
Water
Flour
...
I need to list the ingredients of table 1 and upon saving save it to table 2. Which I can do by adding them to the table 2 upon saving and then let the normal DAL framework write the info to the database as Added rows.
But the problem comes in when I need to amend the current recipe. How do I handle the data to display and the saving of the data?
If anybody can give me some background info on how to use this or point me in a direction it will be gr8 thanks.
Thanks,
Christiaan
|
|
|
|
|
You should really be asking this of the people who designed your DAL, they have done the design and should have allowed for this scenario as it's pretty common. What you are looking for is the facility to use transactions.
Hope this helps
Bob
Ashfield Consultants Ltd
|
|
|
|
|
I have device application developed in C#. I have to integrate it with barcode scanner application. Can someone provide steps for it?
|
|
|
|
|
Please specify the problem more exactly, it is quite impossible to say what you should do without knowing the context..
Do you have to integrate a barcode scanner in an existing application?
|
|
|
|
|
i have an application which is developed in C#. I have a motorola device with a scanner. I have to integrate my application so that i can read one data at a time from scanner and displayy it on the screen. Hope i have made myself clear.
|
|
|
|
|
Well, you should first read the documentation of the scanner. Some scanner for example simulate keystrokes after scanning a barcode.
You can catch them and validate the barcode (probably EAN or UPC) via the check digit and than display it, or do whatever you have to do with it.
If your scanner is a more sophisticated one, it will probabely have some kind of interface with more advanced functionality.
Hope I could help you...
Phil
|
|
|
|
|
I need to read the document. I am using MC70 Scanner fone. How can i capture the Scan button of the device?
modified on Tuesday, September 30, 2008 6:27 AM
|
|
|
|
|
i want to crop an image... picture is in picture box,,
iam trying this...
but
public void CropImage(bool enableImg)
{
cropEnable = enableImg;
if (cropEnable)
{
Rectangle cropArea = new Rectangle(20, 20, 100, 100);
Pic = (Bitmap)CroppingImage(m, cropArea);
m = (Bitmap)Pic;
Invalidate();
}
}
public Image CroppingImage(Image img, Rectangle cropArea)
{
Bitmap bmpImage = new Bitmap(img);
Bitmap bmpCrop = bmpImage.Clone(cropArea,
bmpImage.PixelFormat);
return (Image)(bmpCrop);
}
and the 2nd one:
public Image CropImage(Image img, Rectangle rect)
{
return ((Bitmap)img).Clone(rect, img.PixelFormat);
}
private void button1_Click(object sender, EventArgs e)
{
Rectangle CropRectangle = new Rectangle(100, 100, 100, 100);
pbx.Image = CropImage(pbx.Image, CropRectangle);
}
but a same error is generated.
error is this:
Error 1 Inconsistent accessibility: parameter type 'I_M_Editor.Rectangle' is less accessible than method 'I_M_Editor.frmEditable.CropImage(System.Drawing.Image, I_M_Editor.Rectangle)' D:\dot.net.programs.using.c#\0eh066\I'M Editor\I'M Editor\frmEditable.cs 442 22 I'M Editor
--------------------------------------------------------------------------------
maifs
|
|
|
|
|
i am trying this but
private void pbx_MouseDown(object sender, MouseEventArgs e)
{
en = true;
}
public void FlagEnableForRotating(bool enable)
{
enable2 = enable;
}
public Bitmap rotateImage(Bitmap b, float angle)
{
if (enable2)
{
int maxside = (int)(Math.Sqrt(b.Width * b.Width + b.Height * b.Height));
////create a new empty bitmap to hold rotated image
Bitmap returnBitmap = new Bitmap(maxside, maxside);
////make a graphics object from the empty bitmap
Graphics g = Graphics.FromImage(returnBitmap);
//move rotation point to center of image
g.TranslateTransform((float)b.Width / 2, (float)b.Height / 2);
//rotate
g.RotateTransform(angle);
//move image back
g.TranslateTransform(-(float)b.Width / 2, -(float)b.Height / 2);
//draw passed in image onto graphics object
g.DrawImage(b, new Point(0, 0));
return returnBitmap;
}
return b;
}
private void pbx_MouseMove(object sender, MouseEventArgs e)
{
if (en && enable2)
{
pbx.Image = rotateImage(m, e.Y);
}
}
private void pbx_MouseUp(object sender, MouseEventArgs e)
{
en = false;
enable2 = false;
}
private void tsxImagesRota_Click(object sender, EventArgs e)
{
frm2.FlagEnableForRotating(true);
}
it is rotating but i want to set it on numericUPDOwn ,when user press on numericUpDown then its rotating continuously
hghghgh
|
|
|
|
|
The old DataGrid has a great feature, compared to new DatagridView, that it can display maste/detail relational data. We only have to load master table and detail table into a DataSet and set the relationship between them, then set DataGrid's DataSource property to the DataSet and DataMember property to the master table name. The DataGrid displays master table contents with a + sign and once you click the + sign, the relation name appears as a link if you click that the child content will appear. As you notice there is round trip to display the child records and master records.
I want the datagrid to display master table records along with child table records INLINE that is: parent row, then beneath that child rows, then the next parent, so on..
Can anybody help me please? I am working on Windows.Forms.DataGrid
Kutty
|
|
|
|
|
i want to create a negative filter of any image..
i am trying this...
public void Negative()
{
Bitmap copy=new Bitmap(m.Width,m.Height);
ImageAttributes ia = new ImageAttributes();
ColorMatrix cm = new ColorMatrix();
cm.Matrix00 = cm.Matrix11 = cm.Matrix22 = 0.99f;
cm.Matrix33 = cm.Matrix44 = 1;
cm.Matrix40 = cm.Matrix41 = cm.Matrix42 = .04f;
ia.SetColorMatrix(cm);
Graphics g=Graphics.FromImage(copy);
g.DrawImage(m,new Rectangle(0, 0,m.Width, m.Height), 0, 0, m.Width, m.Height, GraphicsUnit.Pixel, ia);
g.Dispose();
m.Dispose();
}
but here is some error occur in this.......
error is:
Error 2 Argument '2': cannot convert from 'I_M_Editor.Rectangle' to 'System.Drawing.Rectangle' D:\dot.net.programs.using.c#\0eh066\I'M Editor\I'M Editor\frmEditable.cs 688 15 I'M Editor
and
Error 1 The best overloaded method match for 'System.Drawing.Graphics.DrawImage(System.Drawing.Image, System.Drawing.Rectangle, float, float, float, float, System.Drawing.GraphicsUnit, System.Drawing.Imaging.ImageAttributes)' has some invalid arguments D:\dot.net.programs.using.c#\0eh066\I'M Editor\I'M Editor\frmEditable.cs 688 1 I'M Editor
}
hghghgh
|
|
|
|
|
You may have a problem with namespace and refer to wrong Rectangle. Try adding the namespace like:
maifs wrote: g.DrawImage(m,new Rectangle(0, 0,m.Width, m.Height), 0, 0, m.Width, m.Height, GraphicsUnit.Pixel, ia);
g.DrawImage(m,new System.Drawing.Rectangle(0, 0,m.Width, m.Height), 0, 0, m.Width, m.Height, GraphicsUnit.Pixel, ia);
The need to optimize rises from a bad design
|
|
|
|
|
it doesnt effect on picture dear...
i think ,it happens for reason of picturebox.
actually picture is in picturebox..
if soo then what should i do?
hghghgh
|
|
|
|
|
I really don't understand your question. You have the following line in the code:
g.DrawImage(m,new Rectangle(0, 0,m.Width, m.Height), 0, 0, m.Width, m.Height, GraphicsUnit.Pixel, ia);
and the compiler reports an error:
Error 2 Argument '2':
cannot convert from 'I_M_Editor.Rectangle' to 'System.Drawing.Rectangle'
D:\dot.net.programs.using.c#\0eh066\I'M Editor\I'M Editor\frmEditable.cs 688 15 I'M Editor
So what I believe is that you have defined a class named Rectangle in your namespace (I_M_Editor ) and the compiler tries to use it instead of the expected System.Drawing.Rectangle class. That's why I suggested adding the namespace information to the call to new Rectangle class.
The need to optimize rises from a bad design
|
|
|
|
|
I created a C# Windows Application. I used a Setup Project to Deploy the intial software to my users.
I now have patchs and minor enhancements that I want to Deploy. What is the easiest way to do this?
I have updated the Assembly info for my project and my setup project. I modified the setup project to not uninstall previous version. This appears to work just fine, but when I view my Add/Remove programs window I show multiple installs of the software.
Any help would be greatly appreciated!
Scott K
|
|
|
|
|
Go to the properties of Setup Project and the set value true of "RemovePreviousVersion". And also change the version property. After setting these properties build the project and then install on your client machine. You have only on instance in Add/Remove programs.
|
|
|
|
|
Yes, I understand that by setting this property to true it will remove the version I just installed. Here is the issue: When I set this property to true it uninstalls my DB and replaces it with an empty one. My users loose their data.
Is there a way for me to exclude this file?
|
|
|
|
|
Use the simple way but this is not technical
Remove the database from setup project.
Database place on other location.
Make new connection string for that, then bulid and deploy.
|
|
|
|
|
What is my alternative than doing that? I have a lot of installs of the software out there?
sk
|
|
|
|
|
There is no alternative - do as MSF suggested, remove the DB from your update distribution. This is a common newbie error, you need to think through your deployment method better. You should ALWAYS have at least 2 deployments, install and update.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|