|
|
I'm using the connection timeout parameter of the connection string. The problem is that its not respecting the parameter i'm passing.
Ex.: Data Source=DummyInexistantServer;Initial Catalog=Zombo; Integrated Security=SSPI;Connection Timeout=5;
Since the server doesn't exists it should return an error in 5 seconds (according to the connect timeout paramtere). The fact is... its taking about 30 seconds to throw me the error.
any ideas ?
Mauricio Ritter - Brazil
Sonorking now: 100.13560 MRitter
English is not my native language so, if you find any spelling erros in my posts, please let me know.
|
|
|
|
|
when i execute my stored procedure in asp.net...i had this server error 'Exception Details: System.FormatException: Index (zero based) must be greater than or equal to zero and less than the size of the argument list.'
wat does this error message mean and how can i retify it. for info this is my stored procedure... how can my codes be amended to solve this prob..or is it my codes in my aspx.vb tat is the cause of the prob??
CREATE proc spAddRegCust(@custName varchar(50), @custTitle varchar(5), @custGender varchar(6), @custICNo varchar(9),
@custDOB datetime, @resiAdd varchar(50), @custPhone varchar(8), @custEMail varchar(50),
@billAdd varchar(50), @deliAdd varchar(50), @custLoginID varchar(10), @custPwd varchar(10), @custConfirmPwd varchar(10),
@custJoinDate datetime)
AS
IF @custName is NULL
BEGIN
RETURN -201
END
if EXISTS (SELECT custLoginID FROM Customers Where custName=@custName)
BEGIN
RETURN -200
END
insert into Customers(custName, custTitle, custGender, custICNo,custDOB,resiAdd,custPhone,custEMail,
billAdd, deliAdd, custLoginID, custPwd, custConfirmPwd,custJoinDate)
values(@custName,@custTitle, @custGender, @custICNo, @custDOB, @resiAdd, @custPhone, @custEMail,
@billAdd, @deliAdd, @custLoginID, @custPwd, @custConfirmPwd,@custJoinDate)
return
GO
|
|
|
|
|
It's not the SQL that is causing your error. Check the String.Format that you are using, you probably don't have the numer of params correct, or are trying to access more that you have.
String.Format("{0}{1}", param1);<br />
String.Format("{2}", param1);<br />
These will cause the error.
|
|
|
|
|
Hi There,
I used odbc Driver for .Net to Read Records from .dbf Data file, everything is fine but some fields I have problem retrieving the data with simple select statment. Even SQL Server 2000 can not import those feilds. The only way for me to see the data is to use dbf viewer which can not help me with my project.
The data type is Numeric, Size:6, Dec:3 (from the dbf viewer)
and the Data has a decimal point ex. 13.060 or 4.080
any body had thes
Mabb
|
|
|
|
|
maybe read it as a text value and convert it in the app
"there is no spoon" biz stuff about me
|
|
|
|
|
Hello
i'm writing my first database app using mfc/odbc. I have created DSN with paradox tables (microsoft paradox driver). And the problem is that when i create table in win9x it won't work in winxp. In my mfc app i get an error saying that the table have not appropriate format. i have installed different versions of mdac (2.8, 2.7) on win9x/xp and it isn't working. when i create table in winxp it works fine on both systems. but usually people are moving from win9x --> xp.
Could someone tell me what i'm doing wrong?
thanks
Chris
|
|
|
|
|
Microsoft says "Starting with version 2.6, MDAC no longer contains Jet components. In other words, MDAC 2.6, 2.7, and all future MDAC releases do not contain Microsoft Jet, Microsoft Jet OLE DB Provider, or the ODBC Desktop Database Drivers. No new feature enhancements will be made to Jet."
What's happening is you're probably having Paradox ODBC driver differences between Windows 98 and XP, possibly stemming from use of Unicode, or many other factors. If it's working in the XP to 98 direction, just create your tables on XP and distribute them to the downlevel Win98 clients.
FYI. Microsoft ended OEM retail license availability of WinME on December 31, 2003; Win98 (all versions) on June 30, 2002; Win95 on December 31, 2000 and Win3.x and below (yes there was a 1.x and 2.x) on 31-Dec-2001. Win2k Pro will end OEM retail license availability on March 31, 2004. NT 4 Workstation ended June 30, 2002.
NT 4 Service pack updates: No further updates planned.
|
|
|
|
|
Hi, Folks!
In my applications I build an insert statement by concatenating several strings together, adding values by first using sprintf to get a string of the value. These values are defined in my database as floats, so all this conversation results in a loss of precision.
I believe the right way to do this is to bind my application's variables to the connection. However, the only call I've come across to do this with is SQLBindParameter. The problem I have is this: the call needs to know the parameter's ordinal position in the database schema. In my apps I don't always know this; I only know the column names.
So, it boils down to this: is there a way to get a column's parameter number from its name?
'til next we type...
HAVE FUN!! -- Jesse
|
|
|
|
|
Jesse Evans wrote:
The problem I have is this: the call needs to know the parameter's ordinal position in the database schema. In my apps I don't always know this; I only know the column names
I think you might be incorrect here. It's not the ordinal position in the database schema, but rather the ordinal position within the SQL statement you are binding to.
Chris Meech
We're more like a hobbiest in a Home Depot drooling at all the shiny power tools, rather than a craftsman that makes the chair to an exacting level of comfort by measuring the customer's butt. Marc Clifton
VB is like a toolbox, in the hands of a craftsman, you can end up with some amazing stuff, but without the skills to use it right you end up with Homer Simpson's attempt at building a barbeque or his attempt at a Spice rack. Michael P. Butler
|
|
|
|
|
Chris Meech wrote:
It's not the ordinal position in the database schema
<grok=true>
Ah, I get it now! Thanks, Chris!
'til next we type...
HAVE FUN!! -- Jesse
|
|
|
|
|
Hi,
How to find the records which contain '%' or '_' in a oracle table?
Thanks in advance.
|
|
|
|
|
You should search for Wildcard Charactersvin its help.
Mazy
"Man is different from animals in that he speculates, a high risk activity." - Edward Hoagland
|
|
|
|
|
I am trying to convert a native DB to MS SQL server. When I want to acces a specific collumn the output contains only fuzzy characters. So I tried to cast the datatype to an integer type. This does not work. The only thing I know is that the datatype of the native DB is DBTYPE_STR.
Who can help me convert this datatype to an integer value?
Robert Smit
|
|
|
|
|
i have problem during my project ........
i want to convert the procedures of pl/sql into T-sql
i am converting the procedures of oracle into sql server
using vb.net kindly someone help me out.
best of luck
|
|
|
|
|
"best of luck" is about right.
You need a good book on T-SQL and/or PL/SQL, depending on how well you know one of them to start with.
Where I work we support ORACLE 9i and SQL Server 7 (and later), so when we use stored procedures, we have to write them twice (and make sure they are compatible in terms of parameters etc).
Steve S
|
|
|
|
|
i am trying to figure out a solution for locking rows for editing via the web, the problem is i cannot figure out how to unlock the row effectively
desired behavior:
user 1 searches for and finds 3 records, clicks link to edit record 2
user 2 searches for and finds the same 3 records, goes to edit record 2, but gets "row locked" message, or likewise
user 1, finished with editing
user 2 can now edit the record
problem is i cannot figure out how to track if user 1 finishes, IE closes the browser window...
any thoughts on how i could possibly implement this?
i will be using ASP.NET and T-SQL
|
|
|
|
|
I would say...don't. Locking a row when a web user clicks to edit a record is a bad idea, for exactly the reasons you mention, you don't know if they're going to actually come back and submit any changes. If you really have to make sure that two users aren't editing the same data, use some sort of timestamp to detect whether someone else has made a change before saving the web user's changes.
Marcie
http://www.codeproject.com
|
|
|
|
|
thanks! i suppose the timestamp thing is the best approach.
i cannot have possible simultaneous edits work akwardly, i don't there to be lost data.
So i guess i will have something akin to:
On Edit screen load: Show current record contents, grab "last edited"
On save: check "last edited" and if it matches: apply update, otherwise handle the problem, (probably best would be to show both sets of data)
|
|
|
|
|
Hi everyone,
I am using ADO.NET with Access. I have a dataset filled from a data source which has one-to-one correspondance with an Access table. I would like to know what is the most efficient way to fill the Access table with this dataset. Should I iterate through the dataset and call SQL inserts?? I am hoping there is a better way.
Thank you for any help you might give me.
Sincerely,
Pankaj
Without struggle, there is no progress
|
|
|
|
|
Did you tried to use Table Direct for Fill data set
D!shan
|
|
|
|
|
Hi,
I am sorry I do not understand what you mean. Could you please elaborate on it?
My problem is that the dataset is filled from an SQL server database. Now I need to dump the contents of this dataset in an Access table. So, I would like to determine which is the most efficient way to do this. I can of course call an UPDATE statement for each row in the dataset, but I have a feeling that there might be a better way
Thanks,
Pankaj
Without struggle, there is no progress
|
|
|
|
|
Hi
You can build a multi sql statement and execute it once!. you dont need to execute singel insert / update statements many times.
Ex. sSQL = "INSERT INTO .....;INSERT INTO ...;INSERT.."
executeQuery( sSQL );
HTH.,
D!shan
|
|
|
|
|
I wish to count the number of records in my table and then display the number on the screen
So i done:
SQLQuery = "SELECT COUNT(*) FROM Log"<br />
Set RS = OBJdbConnection.Execute(SQLQuery)<br />
Response.Write(RS.RecordCount)
But i'm getting into a muddle on how to do it.
Can someone please show me the light.!!
---
Peter M
|
|
|
|
|
First of all, does the Log table have an primary key index, preferable an autoincrementing ID. It would be much faster as the log file table size increases to do a 'select count(ID) from log' than doing a count(*). Executing a count(*) may induce a table scan while count(ID) will only scan the primary key index.
2nd, you should probably execute a OBJdbConnection.ExecuteScalar rather than a execute. The executescalar is designed to return a single value which is what you are looking for.
Dim rowCount as object
SQLQuery = "SELECT COUNT(ID) FROM Log"
value = OBJdbConnection.ExecuteScalar(SQLQuery)
if not value is dbnull.value then
'Make sure you didn't receive a Null from the database.
'If not it should be an int or int32. Can't remember which one is actually returned.
Response.Write(value.tostring)
end if The above is not tested but you should get the idea.
Michael
I firmly believe that any man's finest hour, the greatest fulfillment of all that he holds dear, is that moment when he has worked his heart out in a good cause and lies exhausted on the field of battle - victorious.
Vince Lombardi (1913-1970)
|
|
|
|
|