|
The safest way to store the password is to add some salt to it (please keep the salt somewhere safe and secure too!), encrypt the password using your favorite high-strength algorithm, then store the generated hash in the database. When you have to validate a password, put the attempted password through the same routine and compare the generated hash to what stored in the database.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I am trying to write a windows application in C#. I met a problem when I try to use the OdbcCommandBuilder to update the database. The connection works fine. The code is like following:
OdbcDataAdapter adapter = new OdbcDataAdapter("select * from machine", _connection);
OdbcCommandBuilder cb = new OdbcCommandBuilder(adapter);
DataRow arow = _ds.Table["machine"].newrow();
arow["StockNo"] = "abc01";
_ds.Table["machine"].rows.add(arow);
adapter.Update(_ds, "machine");
_ds.Table["machine"].AcceptChanges();
When I try to run this code to insert a new machine record, it gives me an error message which says
"ERROR [07006] Restricted data type a attribute violation (SQL_C_NUMERIC)"
Could somebody solve this problem for me please???
Thanks in advance
Asura
|
|
|
|
|
This may cause of missmatch in data types. Please try to check your stored prodecure or table structure for more information about data type.
Note : Especially feild have NUMERIC Data Type
Sreejith Nair
[ My Articles ]
-- modified at 6:56 Thursday 22nd September, 2005
|
|
|
|
|
Yes, you are right, in the machine table there are two field which is defined as decimal(10,2). When I delete the two fields, it works fine now. But I still need the two fields as the currency field. Do you know what can I do for the type conflict please?
Asura
|
|
|
|
|
Use a floating point type instead, like real/float/single/double (name depends on database interface).
---
b { font-weight: normal; }
|
|
|
|
|
There i issue with decimal feild untile you passes such feild through your code. I would like to point a block of code which is posted by you.
DataRow arow = _ds.Table["machine"].newrow();<br />
arow["StockNo"] = "abc01";<br />
_ds.Table["machine"].rows.add(arow);<br />
adapter.Update(_ds, "machine");<br />
_ds.Table["machine"].AcceptChanges();
As per you last comment you have two more feild with decimal value. But you are inserting only one value through your code. I nevar mean this is the reason of your entire dificulty.
DataRow arow = _ds.Table["machine"].newrow();<br />
arow["StockNo"] = "abc01";<br />
arow["Price"] = ConvertTo.Decimal(GrandTotal)<br />
arow["GrandTotal"] = ConvertTo.Decimal(GrandTotal)<br />
_ds.Table["machine"].rows.add(arow);<br />
adapter.Update(_ds, "machine");<br />
_ds.Table["machine"].AcceptChanges(); Try tis code.
Sreejith Nair
[ My Articles ]
|
|
|
|
|
Hi There,
I would like to drag some selected text in a textbox and drop in some other locaiton of the same textbox.Now my question is while dropping how to find the cursor position so that i cna append the dropped text to the previous text.
Thanks in advance,
Cheers,
Manohar.
Thanks & Regards,
Manohar
|
|
|
|
|
Hello,
Is-it possible to assign an ImageList to a TreeView but to display images not for all nodes ?
I'd like to display images for some nodes but only text for others.
Thanks.
|
|
|
|
|
They either all get images or none of them. But, there's nothing that says you have to supply a visible image. Make a blank image your default image for all of your nodes. Where you need to supply an image, no big deal, just add it to the ImageList and setup the Node to point to it.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thanks for your answer.
I've already put a "blank" image but that visually makes a "hole" that is not really "sexy". Anyway I don't want to rewrite TreeView's OnPaint method.
|
|
|
|
|
By "hole", do you mean that there is an empty space where the icon would normally go? That's what's going to happen.
At this point, you'll either need to find a 3rd party control with the exact functionality that you're looking for, or you'll have to write the drawing code yourself.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I'm using OpenRemoteSubkey method to get registry key in remote computer. I have list of computers in AD and use the list to get computer name but how can I find out if each computer is alive in the network now, cause if one computer is not turn on it will take a long time , the method throuwn exception that network path does not exists or in simple statement I wanna set timeout for this function.
Mazy
"One who dives deep gets the pearls,the burning desire for realization brings the goal nearer." - Babuji
|
|
|
|
|
Try to PING the IP address first. That'll at least tell you if the machine is up, but it won't tell you if the Remote Registry service is running.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
i need to get the variable name of a variable in C#.
e.g. string firstName = "jhon";
i need to get string "firstName" against it.
does anyone have idea.
thanx in advance.
regards
AbdulBasit Hammad.
|
|
|
|
|
Take a look at the System.Reflection namespace. Exactly how to do it depends a bit on the context (how do you know which fields you are interested in etc).
|
|
|
|
|
Hi, does anyone know how it is possible to get the vertical scrollbar to be thicker than it currently is? My reason is that the system is targeting touch screen users, and therefore the current scrollbar is too small. I would like to double the size if possible. Thanks
|
|
|
|
|
My problem: When the for loop funs it only verifies that the first file exists. The second time it runs through it auto-matically thinks the second file it is checking exits and writes the imgUrl path to the data table.
Someone please help!!!
searches run = new searches(System.Configuration.ConfigurationSettings.AppSettings.Get("ConnectionString"));
DataTable dt = new DataTable();
dt = run.searchpersonals(dtsend);
int myMatches = dt.Rows.Count;
dt.Columns.Add( new DataColumn("imgUrl"));
String[] imgUrl = new String[myMatches];
for( int i = 0; i < myMatches; i++)
{
imgUrl[i] = "usergraphics/user" + dt.Rows[i]["profile_id"] + ".jpg";
if( new FileInfo( Server.MapPath(imgUrl[i])).Exists)
{
dt.Rows[i]["imgUrl"] = imgUrl[i];
}
else
{
dt.Rows[i]["imgUrl"] = "usergraphics/default.jpg";
}
}
Repeater2.DataSource = dt;
Repeater2.DataBind();
Sully.... Thank you
|
|
|
|
|
Is it just the second, or all except the first?
Have you checked that the file actually does not exist?
What does the field profile_id contain?
---
b { font-weight: normal; }
|
|
|
|
|
Can anyone help me out with an example as to how to export a simple asp.net webpage data to an office application like word or excel.
|
|
|
|
|
Hi all,
I am to implement a windows explorer like in C# where the treeview is a list of clients, each client can have > 1 office (child node). These clients are from the database and eventualy will become folder names. My listview will contain template files for each client/office. I can drag and drop files onto my application but i can't do the other way arround.
Is there anyone has an example, please!!!
Thank you very much for any help.
Ha
|
|
|
|
|
Which class does the FindControl method belong to. I need to be able to return which controls lie on a form. E.g. if there is a textbox on the form i should be able to return a messagebox which says that the textbox(textbox_name) exists on the form. Any suggestions please
|
|
|
|
|
There is a Controls collection that you can iterate through. As it does not have a find method, I doubt there's another class offering this facility, but you can iterate through and search yourself.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
There is a FindControl method referred to by you in the System.Web.UI.Control class. However, apparently there is no such method in the System.Windows.Forms.Control class from which the Form class is derived.
But, as suggested by Christian Grauss, you can use the Controls property of the Form class alongwith the ControlCollection class member methods to iterate through the controls on a form.
Regards,
Ashok Dhamija
_____________________________
Padam Technologies
|
|
|
|
|
Hey all,
got an issues thats been stumping me for a few days now, and instead of coming to you guys first (like i knew i should have) i've wasted about 3-4 days worth of good time, beating my head against the wall on this issue.....!!!
Using postgres database, PgSqlClient ADO.Net Data Provider, and VS'03.
I'm having a problem populating a comboBox with data from Postgres...well rather i'm having problems getting the value member to co-operate...
I've got a "users" table set up with 3 columns, well 4(oid), user_id -serial-&(pk), user_fname -text-, and user_email -text-. Database is pre-existant, so we can't change anything on it. The user table is refrenced by nearly every other table in the db, and I'm trying to ref it in the "calls" table.
The comboBox comes into play when I have the operator entering the callers info into a textbox then selecting the users name (call recieved by...."user_fname") from the comboBox...
I can populate it nice and pretty, just like I want, until the operator selects a name and it(comboBox) writes the valuemember of the comboBox, not the database to the table. So comboBox1.valueMember = "user_id"; says that "user_fname"(DisplayMember) Carlton should be ref at the db to serial 19, but since it is 4th on the list(not alphabetical,rather sorted by the db as a select...from....where user_email = support@blah.com) so it writes to the db as user_id 4 which obviously translates to someone else...which is really, really screwing up my call log...!
now, i've tried just about everything i can think of to fix this...and i'm sure it something simple i've missed...i'm okay with that!
but i've tried:
dataReaders, and a while datareader(reads) { comboBox1.Items.Add(dataReader.getValue(0)) }
dataAdapters, adapter1.Fill(dSet1,"users"); comboBox1.DataSource=dSet1.Tables["users"]; comboBox1.DisplayMember="user_fname"; comboBox1.ValueMember="user_id";
i've tried an array, but forgot what i did(late, late night, too many beers)
and so far nothing has worked to give me the proper valuemember i need to the database refrence.
Please Help!!!
Oh, and please note that the code samples above were NOT the copy/paste from my real work, so don't say thats its cause i didn't capitolize or spell correctly something....lol.....
Dim Beautiful As String
Beautiful = "ignorant"
Label1.Text = "The world is full of " & Beautiful & " people."
Why is common sense such an un-common comodity?
|
|
|
|
|
Ok, so it seems that i was all the time looking in the wrong dirrection...it wasn't my comboBox population that was failing..it was the insert to the db that was causing the issue...i in my haste set a parameter up that looked to the selected ITEM, not the selected Value...
Correction made,
Have a nice night.
Dim Beautiful As String
Beautiful = "ignorant"
Label1.Text = "The world is full of " & Beautiful & " people."
Why is common sense such an un-common comodity?
|
|
|
|