User Profile
Collapse
-
Oops, I had a StreamWriter/Reader open somewhere that I forgot to close. All sorted now. Thanks for your effort! -
I've done that but I still get the same error on the StreamWriter. Here's my updated code
Code:private int setRemaining(string room) { string fileName = roomDesPath + "/" + room; string[] stringArray = null; if (File.Exists(fileName)) { stringArray = File.ReadAllLines(fileName); }
Leave a comment:
-
File being used by another process - Where?
I get the error message
Code:System.IO.IOException was unhandled Message=The process cannot access the file 'C:\Users\Alex\Desktop\ExamsHelper\ExamsHelper\bin\x86\Debug\roomdesigns\5 by 8_design.eh' because it is being used by another process.
Code:for (r = 2; r <= rows+1; r++) { reader.Read();
-
Here's an example of an SQL string that i've concatenated in my program.
Code:"SELECT code, moduletitle, body, timeofday, duration, examdate FROM EXAMDAT WHERE examdate BETWEEN #01/05/2011# AND #09/04/2022# AND body='OCR';"
Code:"SELECT code, moduletitle, body, timeofday, duration, examdate FROM EXAMDAT
Leave a comment:
-
-
I have that too. I had to add it manually as a reference. Microsoft.Offic e.Core and Microsoft.Offic e.Interop.Word are what I have. It's under the COM tab of Add References. Microsoft Office 14.0 Object Library, or something like that.Leave a comment:
-
Adding text to a Shape using Microsoft.Office.Interop.Word
I am trying to add text to a shape but I can't figure out how to do it.. I am using the method
Code:public void DrawOnDoc(object oMissing, Microsoft.Office.Interop.Word._Document oDoc) { oDoc.Shapes.AddShape(1, (xPos / 2) + 100, (yPos / 2) + 100, nWidth / 2, nHeight / 2, oMissing); }
-
Why am I getting this error with my SQL command?
Code:"SELECT STUNO, FNAME, SNAME FROM STUDENT WHERE E1='4721/01 ' OR E2='4721/01 ' OR E3='4721/01 ' OR E4='4721/01 ' OR E5='4721/01 ' OR E6='4721/01 ' OR E7='4721/01 ' OR E8='4721/01 ' OR E9='4721/01 ' OR E10='4721/01 ' OR E11='4721/01 ' OR E12='4721/01 ' OR E13='4721/01 ' OR E14='4721/01 ' OR E15='4721/01 ' OR E16='4721/01 ' OR E17='4721/01 ' OR E18='4721/01 ' OR E19='4721/01 ' OR E20='4721/01 ' OR E21='4721/01 ' OR E22='4721/01
-
Alex Dransfield started a topic How do I structure my files so that I don't need to include the full file path?in C SharpHow do I structure my files so that I don't need to include the full file path?
I am running my project from a USB drive and when I mount the drive, it's not always mounted at the same location.
I get the error message that my database cannot be found when I attempt to run the program.
connection = new OleDbConnection (@"Provider=Mic rosoft.ACE.OLED B.12.0;Data Source=\ExamsHe lper\SysDB.accd b");
This is the location, but I get the error message that it cannot be found at C:\ExamsHelper\ SysDB.accdb.... -
How can I phrase this SQL command?
I am having trouble with writing this SQL command. Basically, I have 4 checkboxes on my form and I want to populate a DataGridView depending on how the checkboxes are ticked. The user can have 0, 1, 2, 3 or all 4 of the checkboxes ticked, meaning that I have 15 different commands to write (if my maths is correct).
For example...
Code:if(ocrChecked and aqaChecked) { sqlCommand = "..."; }
-
Is there anything that you don't know?
Luckily I managed to find out about this before I read your reply, but I'm now having a problem with formatting (color, border size). Could you point me in the right direction for this? My shapes have a dark blue centre with an even darker border at the moment, which seems to be my default in Word.
I'll have to credit you in my project for sure Gary :)Leave a comment:
-
Is it possible to create shapes in a Word document using C#?
I'm attempting to create shapes on a Microsoft Office Word document to model the layout of tables in a room. I've found a nice article (http://support.microsoft.com/kb/316384) that demonstrates how to create tables and text, but it doesn't mention anything about shapes. Is this possible or am I just dreaming? -
Doh, I was being an idiot and recreatingCode:RoomDesigner rd = new RoomDesigner(0, 0);
Thanks!Leave a comment:
-
Ah sorry, I changed that. I'm still getting the error though and I'm not sure why.
Here's my full method
Code:private bool checkSame(string mod, string unit) { string commandString = "SELECT moduletitle, unit FROM EXAMDAT WHERE moduletitle ='" + modules.SelectedItem.ToString() + "';"; try { OleDbCommand command = new
Leave a comment:
-
Why am I getting this error in my SQL string?
I get the error that there is "no value given for one or more required parameters" when I attempt to execute this command:
Code:string commandString = "SELECT moduletitle, unit FROM [EXAMDAT] WHERE moduletitle ='" + modules.SelectedItem.ToString() + "';";
-
Okay, no more errors but I think that things aren't working properly. When I trace through the program and hit the line
Code:rd.DeskList.Add(new Desk(Convert.ToInt32(xPos), Convert.ToInt32(yPos), Convert.ToInt32(nWidth), Convert.ToInt32(nHeight)));
Code:public List<Desk> DeskList { get { return m_deskList; }
Leave a comment:
-
Sorry about it being private, I did play around with it being public and I must have changed it before I posted it here :D
I've now got
Code:private List<Desk> m_deskList = new List<Desk>(); public List<Desk> DeskList { get { return m_deskList; } set { m_deskList = value; } }
Code:RoomDesigner rd =
Leave a comment:
-
How can I access a list that is in another .cs file?
I have a list, m_deskList, that's created on one form and I need to also use it in another. I've tried using FormName fn = new FormName(0, 0) but this doesn't work either. Is it possible to access the List (Which is declared as public on another form) from within my main form?
Code:m_deskList.Add(new Desk(Convert.ToInt32(xPos), Convert.ToInt32(yPos), Convert.ToInt32(nWidth), Convert.ToInt32(nHeight)));
-
I believe I'm almost there, just one final hurdle that I can't figure out. I've managed to make it so that the rectangles are invisible, but when I click I get the "boo" message, and if I click there again, the message doesn't appear. This means it was removed, right?
I've tried sending the panel to the back, bringing the Desks to the front, and I still can't figure out how to make these things visibile.
I've...Leave a comment:
No activity results to display
Show More
Leave a comment: