|
Hi
I am using a custom Validator for a text box and I want to fire that validation when value given in the text box fetches any any value from the database.
I am doing select operation with value given in the text box.If it return any records then the validation should fire.
I'm using C#
Thank U
Chandu
|
|
|
|
|
On the databinding for the textbox, create Format and Parse event handlers.
Syntactically, this may be off a bit, but it is something like this:
textBox1.DataBindings[0].Format += ....
textBox1.DataBindings[0].Parse += ....
if you look these up in help, you'll get some good examples.
|
|
|
|
|
I'd a problem
i 've a Composite PK table in dataset
i can't catch the row i want by this method
Dataset.table.rows.find(PK);
does any boduy know why?
|
|
|
|
|
We have two databases built out on a database engine server. Sql Server 2005.
We have our client communicating to the database via a WCF service.
The service has a Windows Security ID that it logs in with for startup.
The service's ID is created in the Data Engine / Security Settings / Users.
The user is created and the two databases are checked.
When I look under the databases, the user shows in both databases.
The problem:
when I connect to my first database ( Guide ) I connect without a problem.
when I connect to my second database ( Talker ) I get a signin failure.
The log states that it is Error: 18456, Severity: 14, State: 16
This state event says that I did not grant login access for that user to the Talker database. However it is checked and the user exists in both the Guide database and the Talker database.
I am at a loss. Please help!
Thanks,
Michael
|
|
|
|
|
Create Procedure SearchGEOCode (@Num_key varchar(10),@Extension int,@GeoCode varchar(15) Output)
with Recompile
as
@GeoCode=select * from Property
where Num_key = @num_key and Extension = @Extension
Error:
Server: Msg 170, Level 15, State 1, Procedure SearchGEOCode, Line 4
Line 4: Incorrect syntax near '@GeoCode'.
Vuyiswa
|
|
|
|
|
You are attempting to assign a result set to a VARCHAR(15). Also, the syntax for the assignment is incorrect.
SELECT @GeoCode = <ColumnNameHere> FROM Property<br />
WHERE Num_key = @num_key AND Extension = @Extension
You'll have to fill in <ColumnNameHere> becuase you've not supplied enough information.
|
|
|
|
|
Thank you Man, you are a Star its working
Create Procedure SearchGEOCode (@Num_key varchar(10),@Extension int,@GeoCode varchar(15) Output)
with Recompile
as
select @GeoCode= Geocode from Property
where Num_key = @num_key and Extension = @Extension
Results:The command(s) completed successfully.
Vuyiswa
|
|
|
|
|
In SQL 2005, is there any way to do a column level encryption (eg. CustomerName) while capable of doing a wild card search on that column?
Thanks
|
|
|
|
|
The only time I've ever encrypted a column is a password field. No, you can't search on it when the data is encrypted. Well, not without bring the SQL Server to it's knees as it has to decrypt every row you're searching to do the evaluation.
|
|
|
|
|
You could apply table-level permissions to stop normal users from viewing a column - then use a stored-procedure to do the wide-card search on the column (because stored procedures are executed with the permissions of the person who wrote the procedure).
|
|
|
|
|
What if the whole database file is compromised (let's say make a copy by internal employee)?
thanks!
|
|
|
|
|
|
hello all
i am using MySql in my web site, but the problem is that most of the data will be in Arabic language but i cannot insert it because error appears
(#HY000Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation '=' ) that is the error
and even if i tried to retrieve old data that is stored before it comes bad also if it is Arabic
thank you all
abdelhameed81
|
|
|
|
|
Hello
A table with 50columns and 100 rows or A table with 10cols and more than 100 rows will consume more space ? I mean is it a good practice to have more number of columns ?
|
|
|
|
|
That is an implementation detail that would change from database to database.
For example in SQL Server all data is held in pages. Each page is 8060 bytes + some overhead for SQL Server's own use (total 8Kb). 8 pages make an extent. SQL Server reads the data off the disk in 64Kb blocks (one extent).
If you have a row that takes up 100 bytes, you can get 80 of them in a page, with 60 bytes left over. If a row takes any more that 4030 bytes you can only ever get one per page.
Also, how big is a column? An int is 4 bytes. A char(10) is ten bytes, a varchar(10) is upto ten bytes, and so on. If you have lots of varchars then the size of a row becomes flexible.
Navaneeth.I mean is it a good practice to have more number of columns ?
Ask yourself this. If you are in charge of a database that holds the details of every tax payer in your country. How many rows would there be? How many columns would you need? (Hint: There would be millions of rows)
|
|
|
|
|
Wonderful. I voted 5. Thanks for reply.
|
|
|
|
|
I have db filled with xml data, looks something like this:
Table Cars
{
Car, XML.
}
<car desc=”blue car with two doors”>
<owner>Sebastian Bach</owner>
</car>
I have made an full-text index of the xml-column and can now use the CONTAINS-keyword to search the xml-data.
Select car
FROM Cars
WHERE
CONTAINS(car, ‘Bach’);
But the problem is that if I search on a attribute value instead of a element value I get nothing.
Select car
FROM Cars
WHERE
CONTAINS(car, ‘blue’);
Can I solve this in some way?
|
|
|
|
|
I have Created a Procedure , i need to intergrate it with vb6, i know that one. i want to insert these fields into Property table and some of them i want to set them here in the Procedure, help to do that and assigning the value of textbox's in vb6 to the variable in a this Procedure. e.g num_key= txtnumkey. Here is my procedure but i did not finish it because of that part.
Create Procedure prcinserting @Num_key varchar(10),@Extension int,@Cell_ID int,
@Actual_Extent float,@Lis_key varchar(50), @Func_key varchar(8)
,@Active bit,@Add_date datetime,@Add_User_ID int,@Spatial_ADD_Date datetime
,@Rateable bit,Non_Discreet_Valid bit
with recompile
insert into Propery(Num_key,Extension,Cell_ID,Actual_Extent,Lis_key,Func_key,Active,Add_date,Add_User_ID,Spatial_ADD_Date,Rateable,Non_Discreet_Valid,)
values ()
-- modified at 8:54 Wednesday 16th May, 2007
-- modified at 8:55 Wednesday 16th May, 2007
Vuyiswa
|
|
|
|
|
I'll say it again, do NOT cross post in multiple forums.
|
|
|
|
|
Am Sorry itwont Happen again, i will stick to the VB forum for this Post
Vuyiswa
|
|
|
|
|
Hi everyone
Hope someone can help me cos I am becoming more and more stumped. Its a bit involved so please bear with me.
I have a datetime column in a table. This is set via a stored proc in vb.net to be of a type Data.SqlDbType.DateTime. Now this stores the Date passed in as mm-dd-yyyy. When I read it back vb.net does a grand job of turning it into the localised(UK) format, which is dd-mm-yyy for me with no extra processing on my behalf.
Problem comes in a view that I am using. This has two additional columns made up from this date using the commands.
, CAST(CONVERT(CHAR(10), dt_requested,103) as datetime) 'dt_requested_date'<br />
, CAST(CONVERT(CHAR(8), dt_requested,8) as datetime)-2 'dt_requested_time'
This is mostly so that I can perform so time analysis on the fields. However this does not work as I get a convert error with the casting of the datatype because even tho vb.net is expecting to read it in as mm-dd-yyyy and not in the way it is stored as dd-mm-yyyy. The other chaps that I work with say that in vb6 they used the TimeStamp sql Data type to store it as a binary but I am unable to get that to work with vb.net as it says it needs to be converted from a byte() which as the date is being read in as a string won't work...or I can't get it to work...one of the two.
Can anyone help me out? its driven me mad all morning! If you need any further info let me know. realise I prob haven't explained it too well lol
Thanks
Ian
|
|
|
|
|
Is the error at the code level or at database level?
Gautham
|
|
|
|
|
The error could be at both, sorry that doesn't help does it.
If i do the (CONVERT(CHAR(10), dt_requested,103) as datetime) using the value 103 as the type which is the british datetime(what I want)then I get a convert error at the database level of
The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value.
when running my select on the view. If i do it using the american standard which is 101...i think... then I get the error at the app level because my app is using expecting dates to be in the british format. That make sense? The problem comes with the way the DateTime is initially automatically stored in the database as this is stored in the british format as per my localisation settings.
I don't want to have to string format my dates whenever i use them so any help would be appreciated.
Cheers
Ian
|
|
|
|
|
Can anyone Please tell me what is the command to drop a particular column from a table OR alter a table.
Does it require that the table has no data while dropping a column ?
|
|
|
|
|
Try this:
ArchaBhandare wrote: Can anyone Please tell me what is the command to drop a particular column from a table.
ALTER TABLE tableName DROP COLUMN columnName.
ArchaBhandare wrote: Does it require that the table has no data while dropping a column ?
No, it can have data...
Regards,
Arun Kumar.A
|
|
|
|