|
I have a dataset with two tables:
BookEntry <->> BookLines
I set "BookEntry" as Table for the dataview.
If I set the RowFilter property of the dataview, can I say:
BookEntryBookLines.Id = '0'
"Every rule in a world of bits and bytes can be bend or eventually be broken"
|
|
|
|
|
hi,
static void Main(string[] args)
{
DataSet Dset=new DataSet();
DataTable Dtbl=new DataTable("MyTable");
Dtbl.Columns.Add(new DataColumn("Qty",typeof(Int32)));
Dtbl.Columns.Add(new DataColumn("Rate",typeof(Int32)));
Dtbl.Columns.Add(new DataColumn("Total",typeof(Int32),"Qty*Rate"));
for(int i=1;i<10;i++)
{
DataRow Dtr=Dtbl.NewRow();
Dtr["Qty"]=i*2;
Dtr["Rate"]=i+2;
Dtbl.Rows.Add(Dtr);
}
foreach(DataRow Dr in Dtbl.Rows)
{
Console.WriteLine(Dr["Total"].ToString()+"\n");
}
Dset.Tables.Add(Dtbl);
DataView dv=new DataView();
dv.Table = Dset.Tables["MyTable"];
dv.AllowDelete = true;
dv.AllowEdit = true;
dv.AllowNew = true;
dv.RowFilter = "Qty = '16'";
dv.RowStateFilter = DataViewRowState.ModifiedCurrent;
}
**************************
S r e e j i t h N a i r
**************************
|
|
|
|
|
Hi All,
I have a page with its height is 4 inch.
I need to print 7 lines of text per page.
Therefore, I must ensure that I can set the heigth
of text to 0.5 inch exactly.
Pease help me.
Thank you,
|
|
|
|
|
You can use Font constructor override to specify you want inches as units.
Font font = new Font("Arial", 7.0f, GraphicsUnit.Inch)
|
|
|
|
|
You wanted .5 inches height so it should be:
Font font = new Font("Arial", 0.5f, GraphicsUnit.Inch);
|
|
|
|
|
Thanks Werdna,
Please see comment in this suorce code.
using System;
using System.ComponentModel;
using System.Drawing;
using System.Drawing.Printing;
using System.IO;
using System.Windows.Forms;
namespace TestPrint
{
public class PrintingExample
{
private Font printFont;
public PrintingExample()
{
Printing();
}
public void Printing()
{
try
{
PrintDocument pd = new PrintDocument();
printFont = new Font("Arial", 0.78f,System.Drawing.GraphicsUnit.Inch);
pd.DefaultPageSettings.PaperSize= new PaperSize("MP", 826, 468);
pd.DefaultPageSettings.Margins = new Margins (78,78,78,78);
pd.PrintPage += new PrintPageEventHandler(pd_PrintPage);
pd.Print();
}
finally
{
}
}
private void pd_PrintPage(object sender, PrintPageEventArgs ev)
{
float linesPerPage = 0;
float yPos = 0;
int count = 0;
float leftMargin = ev.MarginBounds.Left;
float topMargin = ev.MarginBounds.Top;
float fontHeight = printFont.GetHeight(ev.Graphics);
linesPerPage = ev.MarginBounds.Height / fontHeight;
System.Console.Out.Write("MarginBounds.Height: " + ev.MarginBounds.Height.ToString() + "\n");
System.Console.Out.Write("Font Height : " + fontHeight.ToString() + "\n");
System.Console.Out.Write("Line(s) per Page : " + linesPerPage.ToString() + "\n\n");
while (count < linesPerPage && count < 4)
{
string s = count.ToString() + ":" + fontHeight.ToString() + "/" + ev.MarginBounds.Height.ToString();
yPos = topMargin + (count * fontHeight);
ev.Graphics.DrawString (s, printFont, Brushes.Black, leftMargin, yPos, new StringFormat());
ev.Graphics.DrawLine(new Pen(System.Drawing.Color.Black),leftMargin,yPos,leftMargin+400,yPos);
count++;
}
yPos = topMargin + (count * printFont.GetHeight(ev.Graphics));
ev.Graphics.DrawLine(new Pen(System.Drawing.Color.Black),leftMargin,yPos,leftMargin+400,yPos);
}
public static void Main(string[] args)
{
new PrintingExample();
}
}
}
Nghĩa - I2A4U Group
|
|
|
|
|
I want to create a tabcontrol that has his rows spread over the entire width of the control. I know there is a property SizeMode - FillToRight, but that seems to work only with multilines.
CAn anyone tell me how to create this tabcontrol?
|
|
|
|
|
Total guess - but would width="100%" work?
|
|
|
|
|
|
I have had lots of trouble setting up the code on the computer I work. The project is a web service. When I load it, I share the wwwroot directory, get that sorted. When i try to open the solution, I keep getting the message, "Cannot get folder information from the server".
what does that mean?
Thanks
|
|
|
|
|
hi,
Check Whether Your Created Virtual Directory For Your Application
**************************
S r e e j i t h N a i r
**************************
|
|
|
|
|
did you have some settings for the application in iis?
|
|
|
|
|
I have had problems with the Microsoft Installer. I want the setup to run 2 msi files. I cant seem to get around doing it as I get lost. I can configure the registry, conditions and requirements and the destination folder. Added the first of the 2 msi. Now, how do I add the next one.
Please help.
|
|
|
|
|
hi,
Microsoft installer tool is not much efficient for our all requirement. Once i faced the same problem. Better you can go for third party installers. For more informations you can view the post of this below mentioned threads.
Click Me
**************************
S r e e j i t h N a i r
**************************
|
|
|
|
|
I was wondering in a RichTextBox or whatever how you would go about having a dreamweaver/Visual Studio style tabbing i.e.
namespace
{
whatever
whatever
class
{
whatever2
whatever2
}
}
So when you enter a new line it keeps the tab at the same place unless you tab back? (and the tab is at a nice spaced distance).
Anyhow if you can make any sense of that and can help I would be great full.
Thanks,
Richard
|
|
|
|
|
I posted a snippet about 3-4 months back that does just that. I couldnt figure out how to set the tab sizes in the RTB though. Its a pretty useless control for coding...
top secret xacc-ide 0.0.1
|
|
|
|
|
leppie wrote:
Its a pretty useless control for coding...
Yeah I totally agree. Your Advanced TextBox rocks for it though.
Aaron Eldreth
TheCollective4.com
My Articles
I hereby boycott this poll. Really....
- Leppie
|
|
|
|
|
Aaron Eldreth wrote:
Your Advanced TextBox rocks for it though.
Thanks, I just wish I can find time to finish it
top secret xacc-ide 0.0.1
|
|
|
|
|
I agree,
This is just what I was looking for thanks
|
|
|
|
|
he wants sourcecode of game flat eagerly.this game flat is a game kit,it contain kinds of online games
anyone could help him?
thanks very much
|
|
|
|
|
|
Did he try asking the developer of game flat? It never hurts to ask, the worse he good do is say no.;P
|
|
|
|
|
I spent days looking for it on internet,but i can't find what i want,could you give some websites of free sourececode about game flat? thanks
|
|
|
|
|
Is there a way to start an instance of Internet Explorer from a C#-form, so that IE automaticly opens the page http://www.xxxxxxxx.com?
|
|
|
|
|
This line should do the job:
Process.Start("iexplore", "http://www.xxxxxxxx.com");
www.troschuetz.de
|
|
|
|