|
hi everyone!
i think the code was right but it's always reported that there is an error at:
objReader = cmd.ExecuteReader();
i have no idea why was that
|
|
|
|
|
yamacom wrote: SQLcmd = string.Format("select UserName,PassWord from tblAccount where UserName = {0} and PassWord = {1}",strUser,strPass);
You have to enclose the user name and password in quotes. Eg:
SQLcmd = string.Format("select UserName,PassWord from tblAccount where UserName = <big><big>'</big></big>{0}<big><big>'</big></big> and PassWord = <big><big>'</big></big>{1}<big><big>'</big></big>",strUser,strPass); BUT that is not a secure practice. You should use parameterized queries, and store the hash of the password instead of the actual password in your database. Read the article I linked to in my previous post. Better yet, I'll link to it again:
SQL Injection Attacks and Some Tips on How to Prevent Them[^]
[EDIT: next time, post just a little code, the problem you're having and your question, and any error message you might be getting. That will give your question more chances of being answered.]
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
The amount of sleep the average person needs is five more minutes. -- Vikram A Punathambekar, Aug. 11, 2005
-- modified at 12:29 Wednesday 22nd March, 2006
|
|
|
|
|
Hi!!
i am developing an C# Windows application!!
in that i want to programatically find out if a Particular File is Open(in use) or not!!
Is there any way ?
One Shot dont miss you chance to go!!!!
|
|
|
|
|
Try to rename the file, and if an exception is throw , means
that you cannot open it .
DevIntelligence.com - My blog for .Net Developers
|
|
|
|
|
hi!!
I have drawed a rectangle, then i want to change the angle and repaint again by mouse event.
I try to use Graphic.RotateTransform method, but the whole graphics is rotate and i cannot catch the right co-ordinate of that rectange.
How can i catch the co-cordinate after changing angle or what method can i use to make it work?
Thanks!!
|
|
|
|
|
Hi Guys,
I'm creating a descent dll to use for future programming with COM objects.
I'm having trouble with passing some parameters like the following:
<br />
unsafe public long GetDlgText(long dlgid, long fldid, long row, long col, [MarshalAs(UnmanagedType.BStr)] string text){<br />
long returnvalue = -1;<br />
try{<br />
object[] cmds = { dlgid, fldid, row, col, text };<br />
returnvalue = Convert.ToInt64(Interaction.CallByName(idisp, "GetDlgText", CallType.Method, cmds));<br />
}
catch(Exception e) {<br />
lasterrormessage = "Could not invoke GetDlgText function: " + e;<br />
}
return returnvalue;<br />
}
which I've translated from the following:
long GetDlgText(long DlgId, long FldId, long Row, long Col, BSTR* Text);
I'm calling it like this:
string test = "";<br />
idisp.GetDlgText(101, 47, 1, 0, test);<br />
I get a TYPE_DISMATCH error and I'm pretty sure it's the last parameter (all the complete non-pointer methods work)
What do I do wrong? I've searched on Marshal, passing by value and a lots of other things, but MSDN isn't kind to me .
I hope somebody can help me, tnx!
No hurries, no worries.
|
|
|
|
|
You most likely need int and not long
|
|
|
|
|
I've tried, even with short, but it doesn't work .
tnx though
No hurries, no worries.
|
|
|
|
|
|
I've tried, still the same, and with Int16 also
thanks for the effort though
No hurries, no worries.
|
|
|
|
|
Hi, I'm trying to read a .DBF (Database 4) file with ADO.NET and CodeBase for .NET. Everything works for all the fields, except the password field which is encrypted. Below you will find the code. The data is stored properly on the database, but when I read it back I'm getting different results. On the database is 0xAA091B3BFA. Reading it back in I can see the 0xAA and the 0xFA at the end have been changed to something else. Is there a way to read the data and say AS IS? Or could this be a bug with CodeBase?
strUserID = efUserID.Text;<br />
strUserID = strUserID.ToUpper( );<br />
<br />
strSelect = "Select * from USERIDS where ID = " +<br />
"'" + strUserID + "'";<br />
<br />
odbcDataAdapter = new OdbcDataAdapter(strSelect, odbcConnection);<br />
odbcCommandBuilder = new OdbcCommandBuilder(odbcDataAdapter);<br />
odbcDataAdapter.Fill(dataSet, "User");<br />
#endregion<br />
<br />
#region Populate the local variables with the table values<br />
DataTable dataTable = dataSet.Tables[0];<br />
<br />
foreach (DataRow dataRow in dataTable.Rows)<br />
{<br />
strUserID1 = (string) dataRow["ID"];<br />
strName = (string) dataRow["NAME"];<br />
strPassword = (string) dataRow["PASSWORD"];<br />
strExtension = (string) dataRow["EXTENSION"];<br />
} <br />
Thank you,
Glenn
|
|
|
|
|
Hi,
I'm realtively new to regex expressions and I'm trying to make the best out of documentation, however I don't know how to go on about this one.
I want to match crc checksum enclosed in square brackets. The best I can come up with based on documentation and expresso examples is this:
(?<=(?:\[))[a-fA-F0-9]{8}(?=(?:\]))(?x)
The problem is that I want to make it a little more foolproof. Is it possible to check if the expression inside the square brackets has at least two numbers AND at least two characters AND has a total length of 8? Is it possible at all?
PS a little side question, not related to the main one. MSDN says that [0-9]^4 will match any 4 digit sequences, however when I try it out in expresso it doesn't work... In fact it doesn't appear to work at all (except as a part of negation in a set).
PPS actually I have another side question. I also match quoted expressions. Documentation says :q should match it, which is equivalent to (("[^"]*")|('[^']*')). However neither :q nor \q work for me, however if I put it in explicit form (("[^"]*")|('[^']*')) it does. What am I doing wrong?
Thanks, JJR
-- modified at 9:29 Tuesday 21st March, 2006
|
|
|
|
|
Hello,
I have a dataset, that has only one table. I load the dataset using SQLDataAdapter. I add a single row to the table. Here is a dilema:
How do I push the changes to the server, and then reload the datatable with the updated source. The thing is, I use
this.adapter.Update(dataTable);
now, I want to reload only the new row that I have added and not the whole table. So is there a way of getting back only the new row from a server, and not clear the whole table and then Fill the table again using the adapter. Any ideas?
Thank you.
|
|
|
|
|
Hi friends,
Am on the deveelopment of a private chat web-application module. I need to know the intiative i have taken will head to the right point. i have started doing it with Socket Programming and TCP. Is this the right way to do or is there a better method.
Requirement goes like this.
A link will be displayed on the user profile page that "I am online". On click of this a window should pop in both the user's computers and they should be able to do a private chat.
Am at a stage where I can connect two Systems on LAN and exchange messages through socket programming via Console application. Also please let me know how to open a new widow on a different computer and display the sent messages in it. Do i need to use Remoting concept to do this.
Please advice.. Any sugestion or advice would be appreciated..
Thanks in Advance,
shabeer
|
|
|
|
|
hi shabeer,
If your application is only for LAN then TCP sockets is somethig that is genrally used. If you need your application to be used from Internet then this TCP socket will not work if you computer is behind a proxy. So It all depends what is the scope of your project.
Also its better if you use synchronous communication for sosckets as you handle of all threads and can manage threading rather that using system threads when by using asynhronous communication.
In short- TCP sockets will not work behind proxy.
you need to have all you system with external IP if using tcp sockets.
Regards,
Anil
|
|
|
|
|
hi anil,
Thanx a lot for your kind valuable information. I infer what u have said.. This is an internet application (an australian datting web-site).
But could you tell me a method for making this possible. Am ready to work any hard and am in very much need to get this done..
1. how do i communicate two different computers on internet (if required communication can be routed through a server in between)..
2. how do i open a new window on a remote computer to display the message.
i just need a start.. once i get to know which concept would help me, i believe i can go ahead..
-shabeer
|
|
|
|
|
Check these links hope this helps
http://msdn.microsoft.com/msdnmag/issues/01/02/netpeers/
http://groups.google.com/group/microsoft.public.dotnet.languages.vb/browse_thread/thread/d1e56ec3348d2c28/c28944653750b9ea?lnk=st&q=c%23+chat+behind+proxy&rnum=1&hl=en#c28944653750b9ea
Plese let me know if it helps.
If possible I will make a sample and send you this weekend.
|
|
|
|
|
i am new to tapi, i've try to use the sample to an outgoing call. when
the phone rang. the connection state show me that CS_CONNECT. but
actually, i still not took up the hand set to receive the call. how can
i check the status of the connection state whether the remote end has
received the call or not? once the receiver took up the phone i want to
play an audio . Thanks so much.
|
|
|
|
|
A lot depends on the hardware being used. Most voice modems use the connection state once they've "connected" without the phone actually being picked up.
Proper telephone PABX's use other states before sending the "connected" message.
I suggest you use TapiBrowser to monitor the events being fired and see if your hardware is firing any other event.
Michael
CP Blog [^] Development Blog [^]
|
|
|
|
|
I have 2 form in my application 'Form1' & 'Form2'
'Form1' is main form how i can show 'Form2' from 'Form1'?
with this code i cant do this job.
Form2.ActiveForm.Show();
|
|
|
|
|
Hi
Create an instance of Form2:
Form2 form2 = new Form2(); Then, use either:
form2.Show(); or
form2.ShowDialog();
----------------------------
Be excellent to each other
EasiReports[^] My free reporting component for WinForms.
|
|
|
|
|
Using some event to call it up (command button, etc.) or just opening in your constructor of form one:
System.Windows.Forms.Form form2 = New myNamspace.Form2;
Form2.show();
Brettski
|
|
|
|
|
Seeing as this is a C# forum, that code wont compile like it will in VB.NET
I am guilty of the other way round, I always manage to post C# in the VB forum - and it always gets pointed out to me.
|
|
|
|
|
It wont? Please explain? It's what I use and I don't use vb.net.
Thank you,
Brett
|
|
|
|
|
Form2 frm = new Form2();
frm.Parent = this;
frm.show()
Divyang Mithaiwala
System Engineer & Software Developer
|
|
|
|