|
pgiambat wrote: 1 - DataBase connection string.
using System.Data.SqlClient;
...
SqlConnection oSQLConn = new SqlConnection();
oSQLConn.ConnectionString = "Data Source=(local);" +
"Initial Catalog=mySQLServerDBName;" +
"Integrated Security=SSPI";
oSQLConn.Open();
pgiambat wrote: 2 - Syntax to send the SQL ("SELECT * FROM CUSTOMER").
Yes that is correct.
pgiambat wrote: 3 - Databinding the DB return to a windows control (ListBox, DropDown, TextBox) in a Windows Form.
Get it[^]
Regards,
Satips.
|
|
|
|
|
Satips wrote: ...oSQLConn.ConnectionString = "Data Source=(local);..." +
This won't work.
You missed the part about SQL Server Compact Edition.
only two letters away from being an asset
|
|
|
|
|
Howdy fellow geeks,
This is just a sort of general C# question that doesn't really require a solution as there's many ways to work around, I'm just wondering.
Is it possible in C# (.NET 2.0) to define a get/set for a property with different access modifier for the get and the set.
That is, something like that:
private string _Prop;
public string Prop
{
get
{
return _Prop;
}
}
protected string Prop
{
set
{
_Prop=value;
}
}
Obviously that doesn't work or I wouldn't ask the question but maybe there's a different syntax to do so.. is there?
(while retaining the neatness of get/sets)
Cheers
Ben
|
|
|
|
|
Hope Salil Pitkar here[^] gives a nice explanation for your Question.
Regards,
Satips.
|
|
|
|
|
Well, actually, yes it did, thanks!
The solution is in the comments at the end. Though I think the syntax extension suggested in the article itself is still interesting.
Cheers
Ben
|
|
|
|
|
Glad to help always.
Regards,
Satips.
|
|
|
|
|
I am lokking for an article about micro contoroler?
Please give me some article about it.
thanks
|
|
|
|
|
Hope this[^] may Help you.
Regards,
Satips.
|
|
|
|
|
Does anyone know where I could find some good documentation on the WAV file format? A lot of what I've found is sort of hard to understand.
P.S. Sorry if this isn't the right board to post this question; I couldn't find a specific board related to file formats, audio, etc, and I usually ask questions here, so...
-----
Note: *** Never give me an answer have anything to do with Visual Studio. I don't have this program, and it'll be that way for a long, long time. ***
|
|
|
|
|
|
I have a main window application, mainForm.
At some point, I create an auxhiliary window, auxWin.
For auxWin, rather than disposing the object when user closes the window (clicks the x in top right), I want to hide the object instead (and simply show it when the user opens it again).
I kind of got close by intercepting the FormClosing event with the following:
<br />
<br />
private void CatchFormClose(object sender, FormClosingEventArgs e)<br />
{<br />
this.Hide();<br />
e.Cancel = true;<br />
<br />
}<br />
<br />
where e.Cancel stops the system from disposing the window.
This works fine, but the problem comes in when I try to close the main application, mainForm - it now 'hides' it too! (in effect nothing happens, which is bad since I want it to close!). I put a breakpoint at this.Hide() and it gets called which is surprising (even though this event-handling method is in auxForm ??). I have tried doing a check with:
<br />
if(sender.GetType() == typeof(auxForm))<br />
but this doesn't work - it ALWAYS thinks its the auxForm that raised the event.
Am I going about this the right way? If someone could point me in the direction of how windows forms (and their opening and closing, without disposing objects - which I understand is bad for memory usage too) are managed I'd greatly appreciate it!
Many thanks,
Gerry
Forms newbie
|
|
|
|
|
Hello,
Sounds strange to me!
I think you have to show some more code.
All the best,
Martin
|
|
|
|
|
Thanks for your response Martin...
Which part of the code don't you understand?
It basically comes down to how does one hide a form (ie. override the Close() / Dispose() method) yet keep the main form reactive to closeForm events ??
Regards,
Gerry
|
|
|
|
|
Hello,
I did understand what you meant!
As I said "It sounds strange to me", I meant the behaviour you discriped.
So I'm thinking there must be something else wrong.
Maybe seeing the code helps us, to help you better.
All the best,
Martin
|
|
|
|
|
I've created an application for logging various events in an RTF textbox with lots of formatted text and graphics etc.
Now I'd like to be able to print the contents.
But! I can't find any simple way to do this...
One solution I've found saves the contents to disk as a .rtf document and then gets wordpad to print it. This works and produces very nice output - however wordpad doesn't support headers and footers and I really need to add date and timestamps plus page numbers to the bottom of each page.
Does anyone know of a simple way, or a good resource which describes how to print the contents of an RTF textbox?
Many thanks for your kind help.
John.
|
|
|
|
|
Take a look here[^] for a start.
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
Mav,
Very cool article - just what I need methinks.
I'm going to have to read it a couple of times to make sure I understand it though!
Many thanks.
John.
|
|
|
|
|
hi
i need a DataGridView with footer, but i don't found on the net, can any one help me ?
thanks
|
|
|
|
|
Hi,
If you Want To Add Footer in DataGridView, For that one method may be
loop through the available rows and add the values and displaye them like
double amount=0;
int i=0;
for(i=0; i< dgv.rows.count-1;i++)
{
amount+=Convert.ToDouble(dgv.rows[i].cells[0].ToString());
}
dgv.Rows.Add();
dgv.Rows[i+1].Cells[0].Value=amount.ToString();
Hope This Hepls
Regards
Pankaj Joshi
|
|
|
|
|
Hello,
I am using this library in one of my project : http://www.codeproject.com/cs/miscctrl/SyntaxHighlighting.asp[^]
This is how i used it in my editor i've been working on:
<br />
shtb = new SyntaxHighlightingTextBox();<br />
shtb.Name = "shtb";<br />
shtb.Location = new Point(0, 0);<br />
shtb.Dock = DockStyle.Fill;<br />
shtb.WordWrap = false;<br />
shtb.ScrollBars = RichTextBoxScrollBars.Both;<br />
shtb.FilterAutoComplete = false;<br />
shtb.AcceptsTab = true;<br />
shtb.DetectUrls = false;<br />
shtb.Font = new System.Drawing.Font("Verdana", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));<br />
<br />
<br />
shtb.Seperators.Add(' ');<br />
shtb.Seperators.Add('\r');<br />
shtb.Seperators.Add('\n');<br />
shtb.Seperators.Add('\t');<br />
shtb.Seperators.Add(',');<br />
shtb.Seperators.Add('.');<br />
shtb.Seperators.Add('-');<br />
shtb.Seperators.Add('+');<br />
<br />
<br />
shtb.ContextMenuStrip = EditorContextMenu;<br />
Controls.Add(shtb);<br />
this.Controls.Add(this.MainMenu);<br />
<br />
<br />
try<br />
{<br />
TextReader syntax_blue = new StreamReader("synHighLib_DB/blue.txt");<br />
string line = syntax_blue.ReadLine();<br />
while (line != null)<br />
{<br />
shtb.HighlightDescriptors.Add(new HighlightDescriptor(line, Color.Blue, null, DescriptorType.Word, DescriptorRecognition.WholeWord, true));<br />
line = syntax_blue.ReadLine();<br />
}<br />
syntax_blue.Close();<br />
}<br />
catch (Exception e)<br />
{<br />
MessageBox.Show("Exception Error : " + e.Message, "eAthena Script Editor");<br />
}
This is the contents of my blue.txt db file
0<br />
1<br />
2<br />
3<br />
4<br />
5<br />
6<br />
7<br />
8<br />
9
As you can see, i want to turn all interger that the user types in the editor into blue color. When i tried this in the compiled app, this is how it looks like:
http://img254.imageshack.us/img254/9892/untitledog4.png[^]
How do you set it up so that as you type all the defined syntax in the blue.txt db file turns blue? e.g. 123456 (as i type, it shud be blue)
|
|
|
|
|
Same with having everything inside " and " brown, i did this:
shtb.HighlightDescriptors.Add(new HighlightDescriptor("\"", "\"", Color.Brown, null, DescriptorType.ToCloseToken, DescriptorRecognition.StartsWith, false));
I compiled the app and tried to type like this "hello" and only once the first double quote became brown and then as soon as i typed the h, it stopped being brown.
Where im i going wrong? how can i get this right?
Thanks in advance for any help you can offer
|
|
|
|
|
|
Some of you may remember this post[^] from 2 months ago where I tried to figure out why after such great interviews I was passed over for the position. You were all very supportive and enouraging. Your suggestions were very helpful.
Well, today I'd like to follow up on that story. Some of you suggested that I should ask the interviewer for feedback about the code sample I had submitted. Well I did, and we emailed back and forth a couple times until I got the feedback I was after.
The feedback was that the program was written as a structured program and lacking extensive error handling. He had expected the program to be written in OOP, with more comprehensive error handling, logging capability and that I should have used the project as an opportunity to "show off".
I gladly followed his suggestions, rewrote the project and resubmitted it to him. After reviewing version 2, he suggested that minus the unit testing (which we had agreed would be omitted) it was a "technical tour de force".
Soon after I was contacted by 2 project teams from the same company (one was led by my interviewer) and asked if I was still available and interested in a position with the company. I had only just accepted a position with another company as a software consultant and so I declined the offers with the agreement to keep in touch and revisit the possibility in the near future.
I've taken home a couple lessons from this I'd like to share:
- Always put your best foot forward. Do your best work, submit your best answers and don't be afraid to take your time doing it.
- Read between the lines. I was asked several OOP questions by each interviewer (I had 3 separate interviews with this company).
- Don't give up, and don't take no for an answer!! If you want the job and you know you're qualified, you can demonstrate some great qualities as long as you're not a pest about it.
- Even if you don't get the job you can come away with something. Ask your interviewer for feedback. If you ask right, they'll be happy to tell you where you fell short and how you could improve for the next interview (wither it's with them or someone else).
Add your own comments and tell me what you think. I hope to write an article about this whole experience and would be interested to hear your feedback on my whole experience.
For those who are interested here are the two versions of the project I submitted:
Version 1.0
Version 2.0
|
|
|
|
|
|
I would like to intercept outgoing port 80 connections, redirect the http request, and inject the response back into the stream as if it had never been redirected.
Each time a user desires a web page, he transmits a request to a web server, and the web server transmits a response back to the user. Let us assume that user A is only able to access the IP address of user B, but user B is able to access the IP addresses of everybody. If user A desires a web page from someone other than user B, he will be unable to. The solution is as follows.
When user A requests a web page, instead of sending the request directly to the web server, the request is sent to user B. User B then requests the same request from the web server, and receives the corresponding response. That response is then sent back to user A.
To user A, it appears as if the request and response were completed with out having to send packets to user B. This is because all of the tunneling work goes on in the background. User A does not need to configure his web browser to connect to a certain proxy. Instead, when user A requests a certain page from a web server, a program running on user A's computer intercepts that request, does the necessary tunneling to user B, and finally injects the response back into user A's tcp stack, as if user A had himself contacted the web server.
I do not want to use a normal proxy. This all needs to occur in the background. The problem is implementing the previous paragraph. How do I tap into the windows tcp stack like that? I know that Google Desktop does it to modify search results, so it is definitely possible.
How do I do this? Sample code anyone? Sample projects? Any articles that have been written on this? Any help is welcomed.
Jason Donenfeld
ZX2C4 Software
|
|
|
|
|