|
yesssssss
man you are right
sorry for this silly question
Mohamed El-Wehishy
|
|
|
|
|
SqlConnection conn = new SqlConnection(@"user id=sa; Password=pass; initial catalog=databaseName; Data source=localhost");
conn.Open();
SqlCommand cmd = conn.CreateCommand();
cmd.CommandText = "SELECT * FROM Tabel WHERE tels_no = '"+textbox1.Text.Replace("'","")+"'";
SqlDataReader reader = cmd.ExecuteReader();
while(reader.Read())
{
TextBox2.Text = reader["tels_name"].ToString();
}
Use following namespaces:
using System.Data;
using System.Data.SqlClient;
|
|
|
|
|
|
This is an example code, not code that im using. instead of Preaching to me, Give this guy a solution or back off.
|
|
|
|
|
Secondly i USED REPLACE IN THE QUERY
|
|
|
|
|
1 - your code does NOT stop injection attacks
2 - if you give people here code, they are likely to use it verbatim, not ever understand it
3 - why give people examples they shouldn't use ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Please, please, purrrrleeees stop using "I need help" for every topic line. Use something like "Problem retrieving data", or similar.
Errm...., obviously not if it's a Graphics question but you know what I mean.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
I setup a wpf project in TFS and checked it in. Now, when I try to open the project I get the following error.
"The project 'projectname' is under source control. This version of Visual Studio .NET does not support source controlled projects. Any changes that you make to this project will not be propagated to source control."
Everyone else on my team can access the project without any difficulties. This tells me that there is something on my machine that it just doesn't like. However, I have no issues when I open other projects from TFS. Has anyone else had this issue? If so, how do you fix it. I have uninstalled and re-installed Team Explorer and Visual Studio but this did not correct it.
|
|
|
|
|
Have you enabled Team Foundation pluging in Visual Studio? Just installing Team Foundation Client is not enough.
Select the plugin in Visual Studio options, under Source Control: here is a screenshot.
|
|
|
|
|
It is set to TFS. All of my other projects pull back fine. However, the WPF application will throw that error. I've seen questions about this happening with web development version but I can't find anything for WPF projects. When the project does load it takes the files out of source control.
|
|
|
|
|
Dear Friends
This is a VB syntax.. I need to know the C# Syntax for the following procedure..
Private Sub text_keydown(ByVal sender As Object, ByVal e As KeyEventArgs) Handles txtRA.KeyDown, txtRB.KeyDown
' Do something
End sub
Thanks
Md. Marufuzzaman
I will not say I have failed 1000 times; I will say that I have discovered 1000 ways that can cause failure – Thomas Edison.
|
|
|
|
|
The way delegates and events work in c# is slightly different, a function header does not have the handles keyword. The function header would just be
private void MethodName(object sender, EventArgs e)
{
}
while in the designer file behind the form you would see
this.controlName.KeyDown += new System.Windows.Forms.KeyEventHandler(this.MethodName);
modified on Wednesday, October 7, 2009 10:05 AM
|
|
|
|
|
Thanks......
Thanks
Md. Marufuzzaman
Don't forget to click [Vote] / [Good Answer] on the post(s) that helped you.
I will not say I have failed 1000 times; I will say that I have discovered 1000 ways that can cause failure – Thomas Edison.
|
|
|
|
|
This is a KeyDown event handler for a control (a TextBox judging from the name) so the simplest way to discover the syntax is to put a TextBox on a form, select it and go to the Events page of the Properties Window and double-click on the appropriate event.
VS will do the work for you!
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Thanks...
Thanks
Md. Marufuzzaman
Don't forget to click [Vote] / [Good Answer] on the post(s) that helped you.
I will not say I have failed 1000 times; I will say that I have discovered 1000 ways that can cause failure – Thomas Edison.
|
|
|
|
|
|
Perhaps you would be better off in the ASP.NET forum?
|
|
|
|
|
Hi,
I have developed an application in C# .Net... My requirement is that the application should clean up all the resources that it used and exit when I click on the "Exit" option that I have provided.. But sometimes, when I try to exit the application using "Application.Exit()", the application fails to exit and continues to be listed on the Windows processes in the task manager. I would like to know if I can use Process.GetCurrentProcess().Kill() instead of Application.Exit(). If not, please suggest on what I can do to have the application exit when I want it to...
Thanks,
ramz_g
|
|
|
|
|
Think about what you've just asked. Then give the answer you think most appropriate.
Have you thought about - God forbid - finding what is still running? The technique is part of the leet skilz called 'debugging'
[added]
try
Application = null;
Panic, Chaos, Destruction.
My work here is done.
modified on Wednesday, October 7, 2009 11:11 AM
|
|
|
|
|
Nagy Vilmos wrote: Think about what you've just asked. Then give the answer you think most appropriate.
Nah. If we all replied like that, CP would go belly up.
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
Local announcement (Antwerp region): Lange Wapper? Neen!
|
|
|
|
|
Obviously it would be potentially dangerous given the function of your application. Imagine if you terminate the process unexpectedly while it is writing to a database or file? You could do damage with this method.
|
|
|
|
|
then you have either infinitive loop or another thread running.
Also when exiting Garbage Collection cleans everything.
When using Kill() is only for last resort when programs stopped responding. To prevent that happening, code it so that it will not happen. If you use all data will be lost, so don't use it. Find a bug and fix it
|
|
|
|
|
Safe? Sure, but stupid. Even Application.Exit() should be unnecessary; I've never used it and I don't see why it would ever be required.
|
|
|
|
|
Hi All,
Thanks for all your replies...
@Nagy Vilmos,
Yes Nagy, I did think about what could be running.. It is just that I was not able to find what was running.. Debugging? Of course.. Anyways, thanks for your reply...
|
|
|
|
|
How can I find which table is bound to a textBox please?
|
|
|
|