|
thank you
i can restore my .mdf file in server explorer and browse it. and dont have any problem in connecting to sql server but when execute my app. it gives me an exception that the user cant login into this database and with changing user accounts in computer management and adding access rights , the problem still exist.
|
|
|
|
|
It may be that your login is orphaned? you may need to run
sp_change_users_login 'Auto_Fix', 'susan'
|
|
|
|
|
thank you
but i dont understand where i must do it and how ?
sorry im a beginer
|
|
|
|
|
good evening
i have made a online reservation airline tickets website ,my question is if many users reserves online at the same how can the database will respond to those users ,i knew that there is (isolation level )enum that solves this problem but i don't know how to use it in the code
thanks in advance
|
|
|
|
|
Sounds like you need to use a transaction
BEGIN TRANSACTION
UPDATE tblOpenSeats (mark the seat as reserved)
INSERT INTO reservations...
COMMIT
|
|
|
|
|
I am a newbie to working with SQL. I am attempting to Insert a record from one table to another table in the same database and add an additional field to the record. The tables are identical with the following exceptions: t2 has a datedeleted(for when it is added to t2 table) and deletedID columns(identity field incrementing by 1).
I am writing the code in an ASP page and cannot seem to get anything to work or find the appropriate answer on the web. Here is what I have so far:
' Insert record into Deleted table
SQL = "INSERT INTO t2 Select * " & ", DateDeleted "
SQL = SQL & "FROM t1 "
SQLWHERE = "WHERE PotentialID = " & Session("PotentialID")
SQL = SQL & SQLWHERE
MyConn.Execute(SQL)
I get an error indicating that DateDeleted is an invalid column name. Any help is greatly appreciated.
Jeff Hundt
|
|
|
|
|
Is 'DateDeleted' actually a field in table t1?
Paul
|
|
|
|
|
No it is not. But I was just talking with one of my colleagues and I think that is the simplest choice. Add that field to t1 and then insert into t2.
Jeff Hundt
|
|
|
|
|
Obviously, any field names you include in a query have to be present in one of the tables referenced in your query, otherwise you will get this error.
Paul
|
|
|
|
|
Has anyone else noticed that if you update through a data adapter and the row it is updating hasn't changed, that the data adapter will not update the database, but will report that it DID update the database?
I have a program where we tried to change the value of a column from 1.0 to 1. The row says it was modified, the data adapter says it updated the row, but the update trigger on the table was never fired. And in fact the table says it was never changed. (And by the way there are no bugs if I change the value from 1.0 to 2.)
If I run the same update command in generic SQL on the database, it does update the table and the trigger is fired. If I just use a regular ODBCCommand object to run the SQL command everything works just fine.
But apparently the dataadapter wants to scrutinize the data and say "no you didn't really change anything so I'm not going to run the command, BUT I'll tell you that I updated the database, just so you won't worry."
Is there a way to force the data adapter to run the command anyway? Or conversely to have it report that it didn't do anything?
Thanks
Brent
-- modified at 9:45 Wednesday 19th September, 2007
Brent
|
|
|
|
|
I believe each row looks at the status of each column. The column most likely compares the current and original values to see if it needs to be modified. Since you really didn't change anything, these values remain equivalent.
Take a look at DataRow.SetModified() , it may be able to force an update to fire your triggers. See DataRow[DataColumn, DataRowVersion] to visually check the status of each column in a row.
|
|
|
|
|
With DataRow.SetModified the row is already marked as modified. DataAdapter ignores it anyway. DataAdapter also changes all rows to Unchanged after an update, understandable I suppose.
What I did find out is that the RowUpdated event is never called on the rows that are ignored. This is helpful as I can fill a class-level variable with the rows that do get run through this event. And then I have to go back through and figure out which rows are missing if the start and results are different sizes.
Anyway it's a big pain.
Thanks
Brent
|
|
|
|
|
Hi all,
Which is more faster or accurate to use a view then use a select * from that view or directly using a stored procedure and writting inner join and selct statments
regards
|
|
|
|
|
Rather than post a question, why not try it out for yourself? It's a very good way to learn.
But - as a hint, think about the layers of abstraction between a direct join and a view.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
plz
I am trying to fetch 1,50,000 records from
the DataTable and dataTable.Rows.Count returns
an integer so it gets index out of bound.
tell me the way to find the no records
in the DataTable which can return a long
value.
Piyus Gupta
|
|
|
|
|
Why do you need to fetch so much records at once? DataTable.Rows.Count returns integer and its maximum value is 2,147,483,647 so it should be enough for your case
|
|
|
|
|
Consider using a DataReader instead.
|
|
|
|
|
hi all
i need to find members whose age is greater 75 yrs.how to calculate age from the give DOB.
I used the following code.
DOB <= Dateadd(yy,-75,getdate())
Plz help me to find out the correct way
thanks in advance
cheers
sangeet
|
|
|
|
|
select * FROM
WHERE datediff(year,convert(datetime,DATEOFBIRTH),getdate())>75
-- modified at 8:17 Wednesday 19th September, 2007
|
|
|
|
|
Hi,
Can any1 pls tell me if it is possible to place a textbox on the body of a report so that it appears on evry page of the report when a page break occurs, i am not supposed to use the page footer part to accomplish this & also there are no groups. i require the textbox to be in the body section itself. Please also let me know how to detect when a pg. break is going to occur in the rdl file(if it is possible)
Thanks
|
|
|
|
|
You can just place your textbox at the top of the body section of your report. When the report renders, the textbox will be displayed at the top of each page.
Why do you need to know when a page break occurs? If you need to explicitly force a page break somewhere in the report, you can do this. Otherwise, page break positions are going to be dependent on local user settings and you won't have any control over where they occur.
Regards
Paul
|
|
|
|
|
Hi,
actually the requirement is that i am required to display the page total for every page without using the header or the footer section. Placing a textbox at the top of the body of the report doesnt display it on all the pages, futhermore the repeat item with dataregion on each page option doesnt work. i have read that this problem goes away when we publish the reports onto a report server. but we are not going to publish them onto a server they are going to be local reports.
i wanted to know how the page break occurs to figure out if there is a way to insert the required value before it happens
Thanks.
|
|
|
|
|
What does your report do? Does it contain a table object that displays a set of tabular data? In that case, add a footer section to your table object, put your textbox in the table footer and set the footer to repeat on every page via the table properties.
Paul
|
|
|
|
|
i am looking for a general solution, the report may contain a table object or a list to display the data thats not a prob. Adding textbox on the footer to display the sum and making it repeat on every page will not solve the problem, bcos the final total will be displayed on each page and not the individual page total. i'm not really sure if its possible to achieve this without using the page footer....i hope there is a change in the requirement
|
|
|
|
|
i am developing an application in ASP.net,i am using the following sql query, but in SQL Server "criminal" table i want the same record to be inserted, so can anyone tell me how to merge the two queries in one query so that only one row is inserted
strQuery = "INSERT INTO criminal(cr_name,no_times,cr_desc,cr_pic,fing_print)VALUES('" + textBox1.Text + "','" + textBox5.Text + "','" + textBox4.Text + "','" + textBox6.Text + "','" + textBox7.Text + "')";
strQuery = "INSERT INTO criminal(pic_name) SELECT substring(cr_pic,11,30) FROM criminal";
|
|
|
|