|
If you put the path in quotes then you shouldn't have a problem.
|
|
|
|
|
as you can see in my post, the path is in quotes, it seems, according to this guy that's is a bug in sgen tool here
I tried using a batch file but i get the same result
|
|
|
|
|
i had developed a user control in c# and now want to implement a tab key functionality as in MS Word
how to replace the '\t' with correct number of spaces
e.g.
This is sample text
This is sample text a
|
|
|
|
|
I'm not sure what you are asking. It sounds like you have a user control with a TextBox or similar, and when the user is typing in text, you want to replace a TAB character with an appropriate number of spaces. Is that it or something else?
What part is giving you trouble? Detecting that the user pressed the TAB key? Calculating how many spaces to use? Other...?
BDF
A learned fool is more a fool than an ignorant fool.
-- Moliere
|
|
|
|
|
yes u got it right.
i m having trouble in calculating how many spaces to use.
|
|
|
|
|
I think I can help you with that. Here is a little bit of code that you can adapt. I haven't tried this in C# but it's based on some C code I wrote a few years ago to replace tab characters in a text file with the appropriate number of spaces.
I'm assuming that you have a function that is called when the user presses a key, and that we've detected that the newest key press was a TAB character.
const int TabSpace = 8;
int CharsToAdd = (Control.Text.Length + 1) % TabSpace;
CharsToAdd = CharsToAdd ? TabSpace + 1 - CharsToAdd : 1;
while (CharsToAdd --)
Control.Text = Control.Text + " ";
I'm also assuming that Control.Multiline == false. If it's set to true, then you'd need to find the start of the current line. That would be the first character after the "\r\n" and you'd replace Control.Text.Length by the current character position relative to the start of the line. (The first character after the "\r\n" is character zero.)
I hope this A) makes sense, B) helps.
BDF
A learned fool is more a fool than an ignorant fool.
-- Moliere
|
|
|
|
|
hi
i use this code to show all databases in my sql server in treeView :
this.treeView1.Nodes.Clear();<br />
<br />
SQLServerClass m_sqlServer = new SQLServerClass();<br />
m_sqlServer.LoginSecure = true;<br />
m_sqlServer.Connect(".", "", "");<br />
<br />
TreeNode database; <br />
TreeNode storedProcedure;<br />
TreeNode storedProcedureParameter;<br />
<br />
foreach (Database2 db in m_sqlServer.Databases)<br />
{<br />
if (!db.SystemObject)<br />
{<br />
database = new TreeNode(db.Name);<br />
foreach (StoredProcedure2 sp in db.StoredProcedures)<br />
{<br />
if (!sp.SystemObject)<br />
{<br />
storedProcedure = new TreeNode(sp.Name); <br />
database.Nodes.Add(storedProcedure);<br />
}<br />
}<br />
this.treeView1.Nodes.Add(database);<br />
}<br />
}
and now when i iterate through stored procedures, i want to get all parameters for current stored procedure via SQLDMO, but how to do ?
thanks
|
|
|
|
|
QueryResults res = sp.EnumParameters();
|
|
|
|
|
thanks Rob Graham
i know this, but how to access type,length,isOutput,... for each column in my loop?
thanks again
|
|
|
|
|
SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["ProFeeRevenueUser"].ConnectionString);
try
{
conn.Open(); // connect to the database
TreeView1.Nodes.Clear();
DataTable dt = new DataTable();
dt = conn.GetSchema("ProcedureParameters");
DataView view = dt.DefaultView;
view.Sort = "specific_name, ordinal_position";
string ProcedureName = "";
DataRowView dr;
IEnumerator ViewEnum = view.GetEnumerator();
while(ViewEnum.MoveNext())
{
dr = (DataRowView)ViewEnum.Current;
if (!dr["specific_name"].ToString().StartsWith("dt_"))
{
if (ProcedureName != dr["specific_name"].ToString())
{
TreeNode ProcedureNode = new TreeNode(dr["specific_name"].ToString());
TreeView1.Nodes.Add(ProcedureNode);
ProcedureName = dr["specific_name"].ToString();
}
StringBuilder sb = new StringBuilder(dr["parameter_name"].ToString());
sb.Append(" ");
sb.Append(dr["data_type"].ToString());
sb.Append(" ");
if (!dr.Row.IsNull("character_maximum_length"))
{
sb.Append("(");
sb.Append(dr["character_maximum_length"].ToString());
sb.Append(")");
sb.Append(" ");
}
sb.Append(dr["parameter_mode"].ToString());
TreeNode ProcedureParameterNode = new TreeNode(sb.ToString());
TreeView1.Nodes[TreeView1.Nodes.Count - 1].ChildNodes.Add(ProcedureParameterNode);
}
}
}
finally
{
if (conn.State == ConnectionState.Open)
conn.Close();
}
TreeView1.CollapseAll();
Someone's gotta be the last to know, but why is it always me?
|
|
|
|
|
Everytime I run this program i created to open, write to a word doc and print it out, I can no longer print from an excel spreadsheet unless i log off the computer and then log back on. The thing is, it only does this for excel. I can print from notepad or MS Word but i cant print anything from excel. Any ideas?
I think there is something in here thats doing it:
.....
WordApp.Visible = true;
Word.Document aDoc = WordApp.Documents.Open(ref fileName, ref missing, ref readOnly, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref isVisible, ref missing, ref missing, ref missing);
WordApp.ActivePrinter = "Phaser 5500DT PS";
aDoc.PrintOutOld(ref myTrue, ref myFalse, ref missingValue, ref missingValue, ref missingValue, ref missingValue, ref missingValue,
ref missingValue, ref missingValue, ref missingValue, ref myFalse, ref missingValue, ref missingValue, ref missingValue);
System.Threading.Thread.Sleep(3250);
WordApp.ActiveDocument.Close(ref mySave, ref missingValue, ref missingValue);
WordApp.Quit(ref mySave, ref missingValue, ref missingValue);
....
Thanks
|
|
|
|
|
Check this article:
http://www.codeproject.com/KB/dotnet/WordPrint.aspx
Regards,
Dave
Dave Traister
Software Engineer
ComponentOne LLC
www.ComponentOne.com
|
|
|
|
|
thanks for pointing me in the right direction...
It works when i use:
object wb = WordApp.WordBasic;
object[] argValues = new object[] { "Phaser 5500DT PS", 1 }; //first arg is a printer name
String[] argNames = new String[] { "Printer", "DoNotSetAsSysDefault" };
wb.GetType().InvokeMember("FilePrintSetup", System.Reflection.BindingFlags.InvokeMethod, null, wb, argValues, null, null, argNames);
to set up the printer instead of just: WordApp.ActivePrinter = "Phaser 5500DT PS"
|
|
|
|
|
Hi,
Please can someone help me. I'm using the PDFStamper to set the form fields in a pdf file. It works on my computer properly, but on the QA site it only shows the values of the form fields, the original text does not show, and it gives the message "An error exists on this page. Acrobat may not display the page correctly".
Thanks,
Uyi
|
|
|
|
|
Sounds like a tool issue. Try their forums, you'll have better luck. Otherwise, put on your debugging hat, have your QA send you their pdf and compare it with yours.
Scott P
"Run for your life from any man who tells you that money is evil. That sentence is the leper's bell of an approaching looter." --Ayn Rand
|
|
|
|
|
|
cs.it.tech,
No one will provide code for you. Google is your only option.
Regards,
Gareth.
|
|
|
|
|
I have a suggestion. Go to your CS Professor, hand him back your course workbook and tell him you're too incompetent to study that course. Next step is to get a job as a street sweeper, or other such semi-skilled profession.
|
|
|
|
|
i am begginer in programming and i get this code to understand the logic of simulation.
no problem , but when you reply you must be polite
CS
|
|
|
|
|
It's very rude to delete your original message.
|
|
|
|
|
Look at his posts and go look at the Dec 1 2007.
|
|
|
|
|
Aah. another looney. Great, always fun to laugh at.
|
|
|
|
|
Yes, I think he needs to be added to my list.
|
|
|
|
|
s/he's already on there:
cs.it.tech: delete message; do my homework!
Add "has some weird anti-israel views which he's too chicken-sh*t to not delete"
Just reading your blog (bored at work). Any piccies of your cats on there? I'm a bit cat obsessed!
|
|
|
|
|
I need to scan some. I don't have any of the newest one except one for Stuff and Cats in which I piled a bunch of laundry on her. I forgot I added this user late last night.
|
|
|
|