Tuesday, March 27, 2012
CASE statement
I created a view in SQL Server Express 2005 that contained CASE END
statements.
I use this view in a .NET 2005 project, which works fine on my machine.
When I deploy my project to a machine that is running SQL Server 200, I get
the following error:
The Query Designer does not support the CASE SQL contruct.
Any way around this'
TIA,
Amber"amber" <amber@.discussions.microsoft.com> wrote in message
news:C5E9214E-628F-4CC3-8CC4-4DD7A5347999@.microsoft.com...
> Hello,
> I created a view in SQL Server Express 2005 that contained CASE END
> statements.
> I use this view in a .NET 2005 project, which works fine on my machine.
> When I deploy my project to a machine that is running SQL Server 200, I
> get
> the following error:
> The Query Designer does not support the CASE SQL contruct.
> Any way around this'
> TIA,
> Amber
>
If you could include the CASE statement that you used, and any other
relevant DDL we could be more helpful.
Rick Sawtell|||Which SQL 200x? :) 2000 or 2005?
The way around this: don't use the Query Designer. Script it and run the
code in Query Analyzer.
amber wrote:
> Hello,
> I created a view in SQL Server Express 2005 that contained CASE END
> statements.
> I use this view in a .NET 2005 project, which works fine on my machine.
> When I deploy my project to a machine that is running SQL Server 200, I ge
t
> the following error:
> The Query Designer does not support the CASE SQL contruct.
> Any way around this'
> TIA,
> Amber
>|||"amber" wrote:
> The Query Designer does not support the CASE SQL contruct.
> Any way around this'
> TIA,
> Amber
>
Yes. Learn to write SQL instead of using the Query Designer. The designer is
a crutch that will do you know favours in the long run. If you want to use
anything more than very basic stuff then you must avoid it.
David Portas
SQL Server MVP
--
Sunday, March 25, 2012
Case Sensitive?
I am doing Login webform (C# .NET web application) with SQL Server 2000.
The staff table is to store authenticated user info.
But when I test it, I found that the password can be case insensitive, i.e. 'A0001' should be correct password, but 'a0001' can allow login.
Could anyone tell me how to solve this problem??
Thanks you very much!!
You can alter the database to be case sensitive, and I think you can also do that on a per connection basis - but you'd have to check that. The other way could be to return the passwords that have matched and then double check them in c#. I sure someone has a better method.|||Case-sesitivity is determined when installing SQL Server,
private void btnLogin_Click(object sender, System.EventArgs e)
{
//instantiate SQL connection
SqlConnection sqlConnect = new SqlConnection(connectStg);
SqlCommand selectLogin = sqlConnect.CreateCommand();selectLogin.CommandText = "SELECT sid, type from STAFF Where sid= '" + txtId.Text + "' and pwd= '" + txtPwd.Text + "' ";
//open connectin for execution
sqlConnect.Open();//instantiate the SqlDataReader reader
SqlDataReader loginReader = selectLogin.ExecuteReader();//try and catch SqlException error
try
{
if(loginReader.Read())
{// check whether the user is the role of administrator or operator
// I use GetValue(1) i.e. type field from the above select statement // if "O' then go operator page, else go to administrator page.
if (loginReader.GetValue(1).ToString().ToUpper().Equals("O"))
{
Server.Transfer("//SMS/LoginUser/SuccessLoginOper.aspx");}
else if (loginReader.GetValue(1).ToString().ToUpper().Equals("A"))
{
Server.Transfer("//SMS/LoginUser/SuccessLoginAdmin.aspx");
}}
else
{
//clear content of textbox and display error message
txtId.Text="";
txtPwd.Text="";
lblLoginFail.Visible = true;
lblLoginFail.Text="Login Failed!<br>" + "Ensure that ID and Password are correct!";
}}
catch (SqlException se)
{
if (se.Number == 17)
{
lblLoginFail.Visible = true;
lblLoginFail.Text = "Could not connect to the database";
}else
{
lblLoginFail.Visible = true;
lblLoginFail.Text = se.Message;
}}
//close SqlDataReader and SqlConnection
loginReader.Close();
sqlConnect.Close();
try running sp_help to see the current settings.
Passwords shouldn't be stored in plaintext in the database
anyway. I suggest you have a look at the hashing functions
in .Net and use them to calculate a hash and then save that
in the database.
Then you wouldn't have to worry about case-sensitivity either.|||Thanks you for reply!!
As you said running sp_help to see the current settings, how to change the current settings of case-sensitive problems.
I recognise that the passwords should be better stored in encrypted forms. But how to encrypt it in SQL Server. I am new in web development. Could you briefly tell me how to do? Or any web reference provided?
Waiting for reply! Thanks
Roy|||::As you said running sp_help to see the current settings, how to change the current settings
::of case-sensitive problems
He DID tell you it is determined on install time. So you can not change it.
::I recognise that the passwords should be better stored in encrypted forms.
Good. You are wrong, though. Storing encrypted passwords in SQL Server is as bad as storing them plain text. Hashing is not encryption.
::But how to encrypt it in SQL Server.
Why should you?
Hash (not encrypt) the passwords on the website, then store he hashed passwords in the server.
In the SQL only ask for the user's data by user name, retrieve the password hash from the server, hash the user input and compare. Do not forget to salt your hashes, as otherwise you are totally open to a dictionary attack.
::I am new in web development.
Not to development in general? Sounds more like this. I would suggest you invest heavily into some books.|||First of all you should be aware that the case-sensitivity settings are GLOBAL to the entire SQL Server and all databases on it.
If you really want to to the change you have to rebuild the master database using
Rebuildm.exe.
Do look it up in the books online first, and don't forget to backup your database before!
For hashing password have a look at the classes:
System.Security.Cryptography.MD5
or preferrably
System.Security.Cryptography.SHA1
case sensitive SQL - pls help a noob
How can I set my SQL Server 2000 to be case sensitive as well?Case sensitivity depends on the codepage you select at install.
If you want to do it afterwards you need to rebuild the master table.
See 'Rebuilding the master database' in the SQL Server
books online.
Regards
Fredr!k
Thursday, March 22, 2012
Case Insensitivity
search this database. I need to make my data case insensitive,
espcially my last name column. How do I change this?
Thanks,
BrianI was doing some further reading and I am hearing that you set case
sensitivity when you first install SQL by choosing an ANSI set and the
only way to change this is to re-install SQL. Is this correct? There
has to be another way around this...|||See "Specifying Collations" and "Collation Precedence" in Books
Online. You can change the collation at the database or column level
(see ALTER DATABASE and ALTER TABLE), or in your queries (see COLLATE).
Personally, I would modify the queries (or perhaps create a view)
rather than have one or two columns in a database in a different
collation from the rest.
Simon|||There is another way in SQL2000. Collation is determined at column
level so you can alter the case-sensitivity and other collation
properties at any time. For example:
ALTER TABLE YourTable
ALTER COLUMN last_name VARCHAR(50)
COLLATE Latin1_General_CI_AS
Read the Collations topics in Books Online to understand the collation
syntax and how this affects comparisons between columns of different
collation.
--
David Portas
SQL Server MVP
--|||I used your syntax and everything works like a charm except for one
thing, now when I do a search, such as "W" in the lastname field, it
pulls every records that contains a "W" in the last name, rather than
names that start with "W". How do you correct this? it needs to search
from left to right.
Thanks,
Brian|||What's the SQL statement you are using to SELECT? It sounds like
you're putting a wildcard in front of and behind the character you are
searching on, e.g.:
SELECT ColName
FROM Table
WHERE ColName LIKE '%W%'
when it sounds like you want the wildcard after
SELECT ColName
FROM Table
WHERE ColName LIKE 'W%'
Your collation settings should only affect the case sensity of the
database; not how your LIKE comparisons perform. Am I
misunderstanding?
Stu
Tuesday, March 20, 2012
Case conversion with SQL or Stored Proc
Hi experts,
I m new in SQL stuff. I have to work out a fucntion with ASP.net for CSV import to the DB in MSSQL.
I would like to know for Stored Proc, is there any way that I can do the case conversion?
e.g
the Full_Name read from CSV file: Lennon, John
Then for the family name I need to convert into uppercase so the converted one: LENNON, John
Is there any way I can check those words before the comma? The CSV file is delimited with | instead of , ?
Can I use substring for that? And also do you have any online tutorial for Stored Procedure recommended? Thanks a lot!!!
Cheers,
KNVB
Hi,
Here is an example:
declare @.fullName varchar(100)
set @.fullName = 'Lennon, John'
select upper(left(@.fullName, charindex(',', @.fullName) - 1)) + right(@.fullName, len(@.fullName) - charindex(',', @.fullName) + 1)
Note: The first two lines of code are just for the sample
It might be better to implement this as a FUNCTION in case of a STORED PROCEDURE since functions can be used in your select statement.
References:
Creating stored procedures: http://www.sql-server-performance.com/tn_stored_procedures.asp|||
Merci beaucoup, Geert!
By the way, have you heard of a company called i4net from Namur?
|||No problem, glad to help.
I didn’t know i4net. Is this your company maybe?
Greetz,
Geert
Wednesday, March 7, 2012
Carriage Returns become Question Marks in SQL
I tried the ASP .NET forum with no luck on this one. Maybe someone
here will know the answer.
I have an old ASP .NET 1.1 application that I haven't had time to
rebuild with .NET 2.0. No changes have been made to the application
or
the SQL Server the application uses. I have a web form where users
can
type multiple lines of text, and it is entered into an SQL database
(SQL 2000 Enterprise) into a column with a datatype of "text".
Recently (it seems out of nowhere), If my users enter a carriage
return into the webform, it becomes a question mark in the sql
database. It's really a bit funny, but also annoying, lol. Does
anyone
have any idea why this might be happening?
To clarify. I'm typing text into a multiline textbox. For every place
I hit the return key, it is converted into a question mark in SQL.
I'm
using standard .net sql insert commands, and I don't parse or modify
the text string in anyway. The question marks show whether I load the
data back into my webform, or even if I do a SQL query via Query
Analyzer. I'm stumped.
Thanks so much!
Can you post an example insert string (e.g. from the debug window of your
app)? Does it still produce ?s if you paste that string into Query
Analyzer, and execute it manually? If so, take the string, and do this:
DECLARE @.str NVARCHAR(MAX);
SET @.str = 'INSERT string here...';
DECLARE @.i INT;
SET @.i = 1;
WHILE @.i <= LEN(@.str)
BEGIN
PRINT ASCII(SUBSTRING(@.str, @.i, 1));
SET @.i = @.i + 1;
END
My guess is that .NET is injecting non-printing characters and/or not
producing correct CR/LF pairs.
<mattdaddym@.gmail.com> wrote in message
news:79ba1e43-dadf-4551-b6e5-a810cfeaf231@.i3g2000hsf.googlegroups.com...
> Hi all,
> I tried the ASP .NET forum with no luck on this one. Maybe someone
> here will know the answer.
> I have an old ASP .NET 1.1 application that I haven't had time to
> rebuild with .NET 2.0. No changes have been made to the application
> or
> the SQL Server the application uses. I have a web form where users
> can
> type multiple lines of text, and it is entered into an SQL database
> (SQL 2000 Enterprise) into a column with a datatype of "text".
> Recently (it seems out of nowhere), If my users enter a carriage
> return into the webform, it becomes a question mark in the sql
> database. It's really a bit funny, but also annoying, lol. Does
> anyone
> have any idea why this might be happening?
>
> To clarify. I'm typing text into a multiline textbox. For every place
> I hit the return key, it is converted into a question mark in SQL.
> I'm
> using standard .net sql insert commands, and I don't parse or modify
> the text string in anyway. The question marks show whether I load the
> data back into my webform, or even if I do a SQL query via Query
> Analyzer. I'm stumped.
>
> Thanks so much!
Carriage Returns become Question Marks in SQL
I tried the ASP .NET forum with no luck on this one. Maybe someone
here will know the answer.
I have an old ASP .NET 1.1 application that I haven't had time to
rebuild with .NET 2.0. No changes have been made to the application
or
the SQL Server the application uses. I have a web form where users
can
type multiple lines of text, and it is entered into an SQL database
(SQL 2000 Enterprise) into a column with a datatype of "text".
Recently (it seems out of nowhere), If my users enter a carriage
return into the webform, it becomes a question mark in the sql
database. It's really a bit funny, but also annoying, lol. Does
anyone
have any idea why this might be happening?
To clarify. I'm typing text into a multiline textbox. For every place
I hit the return key, it is converted into a question mark in SQL.
I'm
using standard .net sql insert commands, and I don't parse or modify
the text string in anyway. The question marks show whether I load the
data back into my webform, or even if I do a SQL query via Query
Analyzer. I'm stumped.
Thanks so much!Can you post an example insert string (e.g. from the debug window of your
app)? Does it still produce ?s if you paste that string into Query
Analyzer, and execute it manually? If so, take the string, and do this:
DECLARE @.str NVARCHAR(MAX);
SET @.str = 'INSERT string here...';
DECLARE @.i INT;
SET @.i = 1;
WHILE @.i <= LEN(@.str)
BEGIN
PRINT ASCII(SUBSTRING(@.str, @.i, 1));
SET @.i = @.i + 1;
END
My guess is that .NET is injecting non-printing characters and/or not
producing correct CR/LF pairs.
<mattdaddym@.gmail.com> wrote in message
news:79ba1e43-dadf-4551-b6e5-a810cfeaf231@.i3g2000hsf.googlegroups.com...
> Hi all,
> I tried the ASP .NET forum with no luck on this one. Maybe someone
> here will know the answer.
> I have an old ASP .NET 1.1 application that I haven't had time to
> rebuild with .NET 2.0. No changes have been made to the application
> or
> the SQL Server the application uses. I have a web form where users
> can
> type multiple lines of text, and it is entered into an SQL database
> (SQL 2000 Enterprise) into a column with a datatype of "text".
> Recently (it seems out of nowhere), If my users enter a carriage
> return into the webform, it becomes a question mark in the sql
> database. It's really a bit funny, but also annoying, lol. Does
> anyone
> have any idea why this might be happening?
>
> To clarify. I'm typing text into a multiline textbox. For every place
> I hit the return key, it is converted into a question mark in SQL.
> I'm
> using standard .net sql insert commands, and I don't parse or modify
> the text string in anyway. The question marks show whether I load the
> data back into my webform, or even if I do a SQL query via Query
> Analyzer. I'm stumped.
>
> Thanks so much!
Saturday, February 25, 2012
capturing the output from a stored procedure into a report
in the data tab in vb.net and get my results. How do i take these
results and form a report? Is there a way to capture the fields that
are returned in order to drop them into a report?
I'm doing all this in vb.net.
Thanks.Are you using the report designer and the data tab? Does the stored
procedure execute and return data from the data tab? If so, sometimes
executing the stored procedure does not fill the field list. Try clicking on
the refresh fields button (look to the right of the ... , it looks like the
fresh button for IE. Hover over it and it will tell you what the button is
for). If this doesn't cause the field list to fill in then you can put in
the fields manually in the list. Right mouse click in the field list, add
field and give it the name of the field name.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"muris" <rmuris@.hotmail.com> wrote in message
news:1112374203.464263.41490@.z14g2000cwz.googlegroups.com...
> I have a stored procedure that takes some parameters. I can execute it
> in the data tab in vb.net and get my results. How do i take these
> results and form a report? Is there a way to capture the fields that
> are returned in order to drop them into a report?
> I'm doing all this in vb.net.
> Thanks.
>|||hitting the refresh button worked!! Thank you.
Friday, February 24, 2012
Capturing a variable in ASP.NET
I am new to .NET, after many years with classic ASP I am struggling a little with something that I am sure is really easy to do.
Basically what I want to do, is execute an SQL statement, that will return a single value. I then need to store this value as a variable, so that I can pass it into another query later.
It seems easy to output the record, but how do I store it as a variable !!
This is my code to connect and run the SQL... all I need to do as retreive the value, and put it aganist a variable...
Function higher_manager_ein() As System.Data.IDataReader
Dim connectionString As String = "server='myserver'; user id='userid'; password='pwd'; database='DB'"
Dim dbConnection As System.Data.IDbConnection = New System.Data.SqlClient.SqlConnection(connectionString)
Dim queryString As String = "SELECT distinct MEASURE FROM [CCC_MEASURE] where ein = '" & request("man_ein2") & "'"
Dim dbCommand As System.Data.IDbCommand = New System.Data.SqlClient.SqlCommand
dbCommand.CommandText = queryString
dbCommand.Connection = dbConnection
dbConnection.Open
Dim dataReader As System.Data.IDataReader = dbCommand.ExecuteReader(System.Data.CommandBehavior.CloseConnection)
Return dataReader
End FunctionSince it sounds like all you are doing is returning one value, you might want to look at the dbCommand.ExecuteScalar method instead. That is made to return one value.
Now to explain the way you are currently doing it, you can think of the DataReader as an old ADO recordset that you used in ASP. So when this function returns the datareader, you then need to get the value out of the recordset. The firsts difference is that the DataReader object doesn't not start out at the first record. It starts right before it. So you need to call the DataReader.Read() method. That will return true or false depending on if it has read the next record. To get the value, you need to invoke the appropriate method depending on what type of value it is. So DataReader.GetString will return the value as a string. You can pass either the ordinal position of the column in the datareader or the column name.
Since what you are saying above though, I would go with the ExecuteScalar method off of the datareader instead. So again, if this is returning a string value, then you would do the following in place of the Dim dataReader As System.Data.IDataReader command above:
Dim myStringValue As String = CType( dbCommand.ExecuteScalar(), String )
You need to change the type to a string since the ExecuteScalar method returns the type Object.|||and use parameterized queries.
hth
Capture System.IO rows from incoming file and insert into table
Ok, I'm not quite sure how to approach this one. This is a VB.NET console app in which I want to capture each row and throw it into a table. The reason being, they want a report on what was processed...which I'll be able to do easily in Reporting Services 2005 once this crap is in a table where it should be.
1) What should I use to do this, dataset? I want to use stored procedures also, not inline SQL
Function here takes an incoming file, and splits it up into separate files. I want to insert each row that is succesfully split
Public Sub ProcessFiles(ByVal sIncomingfile As String, ByVal sOutputDirectory As String)
If sIncomingfile <> "" And sOutputDirectory <> "" Then
Dim f As New Security.Permissions.FileIOPermission(Security.Permissions.PermissionState.None)
f.AllLocalFiles = Security.Permissions.FileIOPermissionAccess.Read
Dim file As New IO.FileInfo(sIncomingfile)
Dim filefs As IO.FileStream = Nothing
If file.Exists Then
Try
filefs = New IO.FileStream(file.FullName, IO.FileMode.Open) 'Place: 1
Catch ex As Exception
SendEmail("Incoming .mnt or .naf Filename Invalid or not found", "Place: 1")
Application.Exit()
End Try
End If
Dim reader As New IO.StreamReader(filefs)
Dim counter As Integer = 0
Dim CurrentFS As IO.FileStream
Dim CurrentWriter As IO.StreamWriter
Dim extension As String = IO.Path.GetExtension(file.FullName)
If extension = ".mnt" Then
While Not reader.Peek < 0
Dim Line As String = reader.ReadLine
If IsNumeric(Line.Substring(0, 1)) Then
Dim Parts() As String = Line.Split(" "c) ' split row into parts
If Parts(0).Length = 8 Then ' if first part is 8 then know we hit another header so cut and then write to file
counter += 1
If Not CurrentWriter Is Nothing Then CurrentWriter.Flush() : CurrentWriter.Close()
CurrentFS = New IO.FileStream(IO.Path.Combine(IO.Path.GetDirectoryName(sOutputDirectory), Line.Substring(59, 4) & "[" & counter.ToString & "]" & Now.ToString("MM-dd-yyyy") & IO.Path.GetExtension(file.FullName)), IO.FileMode.Create)
CurrentWriter = New IO.StreamWriter(CurrentFS)
End If
If Not CurrentWriter Is Nothing Then
CurrentWriter.WriteLine(Line)
End If
End If
End While
If Not CurrentWriter Is Nothing Then CurrentWriter.Flush() : CurrentWriter.Close()
MoveFilesFTP(sOutputDirectory, "mnt")
ElseIf extension = ".naf" Then
While Not reader.Peek < 0
Dim Line As String = reader.ReadLine
If Not IsNumeric(Line.Substring(0, 1)) Then ' if first part is not a number, then we know it's a header so split the file
counter += 1
If Not CurrentWriter Is Nothing Then CurrentWriter.Flush() : CurrentWriter.Close()
CurrentFS = New IO.FileStream(IO.Path.Combine(IO.Path.GetDirectoryName(sOutputDirectory), Line.Substring(6, 4) & "[" & counter.ToString & "]" & Now.ToString("MM-dd-yyyy") & IO.Path.GetExtension(file.FullName)), IO.FileMode.Create)
CurrentWriter = New IO.StreamWriter(CurrentFS)
End If
If Not CurrentWriter Is Nothing Then
CurrentWriter.WriteLine(Line)
End If
End While
If Not CurrentWriter Is Nothing Then CurrentWriter.Flush() : CurrentWriter.Close()
MoveFilesFTP(sOutputDirectory, "naf")
End If
Else
'input file not valid
SendEmail("Incoming .mnt or .naf Filename Invalid", "Place: 1")
End If
End Sub
You don't need a console application to import the data into SQL Server if you are in SQL Server 2000 you need a DTS package and in SQL Server 2005 you need an Integration services package. The only important thing to note is SQL Server being a RDBMS(relational database management systems) sees a text file as having Null values so you import your data into a Temp table then do INSERT INTO your destination table. Try the link below for sample DTS and Integration services code. Hope this helps.
http://www.sqlis.com/
|||Put this somewhere at the top:
Dim conn as new sqlconnection("Your connect string")
conn.open
Dim cmd1 as new sqlcommand("INSERT INTO ProcessedFiles(Filename) VALUES (@.Filename) SELECT SCOPE_@.IDENTITY()")
cmd1.parameters.add("@.Filename",sqldbtype.varchar)
dim cmd2 as new sqlcommand("INSERT INTO ProcessedLines(FileID,LineNum,LineData) VALUES (@.FileID,@.LineNum,@.LineData)",conn)
cmd2.parameters.add("@.FileID",sqldbtype.int32)
cmd2.parameters.add("@.LineNum",sqldbtype.int32)
cmd2.parameters.add("@.LineData",sqldbtype.varchar)
Then after you get the filename in your code:
cmd1.parameters("@.Filename").value={Your filename variable}
cmd2.parameters("@.FileID").value = cmd1.executescaler
Then after you read a line of data from the file:
cmd2.parameters.add("@.LineNum").value=counter
cmd2.parameters.add("@.LineData").value=line
cmd2.executenonquery
And at the end of your program:
conn.close
of course, this assumes you have a table named processedfiles that has a Filename column, as well as an identity field. I would put a ProcessedDate field in there too, that defaults to GetUTCDate(). And a table named ProcessedLines that has three columns (FileID,LineNum,LineData).
Is that what you were looking for?
Thursday, February 16, 2012
Capacity of SQL Server 2005 Express Edition
I am just starting to build my apps in asp.net 2.0. I have build apss in v. 1.x before using sql server 2000. However, before i make the shift, I would like to know the advantages and disadvantages of using the sql server 2005 express edition then using the sql server 2000.
for example;
+ How many data can it store?
+ How many concurrent users it supports.
+ Advantages and disadvantages of using sql server 2005 express ed.
+ Any other relevant information that developers should know / beware / watch out for when using sql server 2005 express edition.
Note: I am not asking about the actual SQL Server 2005 but the express edition!
Regards and thanks in advance
Microsoft'sSQL Server home page is a good place to start your research. TheEditions link will bring you the theSQL Server 2005 Features Comparison table which will answer most of your questions.
Sunday, February 12, 2012
Cant Update, Insert, or Delete rows
I have recently started an ASP.Net application and am having some issues updating, inserting and deleting rows. When I started working with it, I was getting errors because it could not find any update command. Eventually, I figured out how to automatically generate the commands, by configuring my SQLDataSource control and clicking the "advanced" button. Right now though, I have generated the commands, but I still can not insert, update or delete rows. When I attempt to update anything, I recieve an error that says "The data types text and nvarchar are incompatible in the equal to operator." Nowhere in my table do I have any rows that use the datatype "nvarchar", only "text" and "int". I tried switching all of my text columns to "nvarchar(500)", which did not help.
I am led to believe that the auto generated SQL procedures are trying to do something behind the scenes that is making my database act up, because even when I delete rows, I get the same exception, so the datatypes cannot be messed up there, because all that the datasource is doing is deleting rows, therefore there is no need to worry about data types.
I only get the error when I check the "Use optimistic concurrency" box. When I do not use optimistic concurrency, I can delete, insert, and update rows... but nothing happens. There are no errors, but nothing is deleted, updated or inserted either. Upon postback, nothing has changed.
I may upload a copy of the exact exception page, if someone thinks that it may help.
Here is the update command that was generated:
UPDATE [Record Information] SET [Speed] = @.Speed, [Recording Company] = @.Recording_Company, [Year] = @.Year, [Artist] = @.Artist, [Side 1 Track Title] = @.Side_1_Track_Title, [Side 1 Track Duration] = @.Side_1_Track_Duration, [Side 2 Track Title] = @.Side_2_Track_Title, [Side 2 Track Duration] = @.Side_2_Track_Duration, [Sleeve Description] = @.Sleeve_Description WHERE [Record Database ID] = @.original_Record_Database_ID
Apparently no stored procedures exist for any of these operations, and I am unsure why. The "Record Database ID" is my identity column, and is the only field that is (and is supposed to be) uneditable.
What I recommend is that you click the Learn link at the top of the page and go through some of the videos or quickstart tutorials to familiarise yourself with how the SqlDataSource works. It doesn't, for example, generate stored procedures under any circumstances - which is why you can't find any. You also need to understand what Optimistic Concurrency is, how to manage it and when to use it. Finally, you should understand what datatypes are the most appropriate for your data. Having nothing but ints and text datatypes is not very likely to be appropriate.
can't update table owned by dbo with impersonation account
executenonquery in asp.net. If the table owner is dbo I get the following
error in .net:
input string was not in a correct format.
When I step through my code it actually is saying that permission is denied
on the table. I've given the impersonation account full priveledges on this
table and it still doesn't work. However, if I change the owner of the tabl
e
to somone else it works fine. Any suggestions on how to resolve this would
be greatly appreciated.Can you show us your query?
"ASP Developer" <ASPDeveloper@.discussions.microsoft.com> wrote in message
news:E5FEB9AA-D527-4AC5-9B08-03FD45EDDFAF@.microsoft.com...
>I am using an impersonation account to execute a procedure via
> executenonquery in asp.net. If the table owner is dbo I get the following
> error in .net:
> input string was not in a correct format.
> When I step through my code it actually is saying that permission is
> denied
> on the table. I've given the impersonation account full priveledges on
> this
> table and it still doesn't work. However, if I change the owner of the
> table
> to somone else it works fine. Any suggestions on how to resolve this
> would
> be greatly appreciated.|||Here you go.
TRUNCATE TABLE dbo.MYTABLE
INSERT INTO dbo. MYTABLE(THEID,ERRORFLAG,ERRORCODE,CREATI
ONDATE)
VALUES(@.IDValue ,'Y',@.LocalError,GETDATE())
When I run my code in asp.net I get the error "input string is not in the
correct format"
If I use
sp_changeobject 'MYTABLE', 'newowner'
and run it again it works fine?
"Uri Dimant" wrote:
> Can you show us your query?
> "ASP Developer" <ASPDeveloper@.discussions.microsoft.com> wrote in message
> news:E5FEB9AA-D527-4AC5-9B08-03FD45EDDFAF@.microsoft.com...
>
>
Friday, February 10, 2012
Can't Uninstall SQL Server 2005 Beta
There resources may help:
Remove -How do I remove previous versions of SQL Server 2005 / Whidbey?
http://www.aspfaq.com/sql2005/show.asp?id=15
Remove -How to manually remove SQL Server 2000 default, named, or virtual instance
http://support.microsoft.com/?kbid=290991
Remove -How to uninstall an instance of SQL Server 2005 manually
http://support.microsoft.com/?kbid=909967
Remove -How to Uninstall SQL Server 2005 Beta
http://go.microsoft.com/?linkid=1396133
Remove -How to uninstall SQL Server Management Studio
http://support.microsoft.com/default.aspx?scid=kb;EN-US;909953
Remove -How to use the Add or Remove Programs item in Control Panel to add
or remove components for stand-alone installations and clustered
installations of SQL Server 2005 (KB: 922670)
http://support.microsoft.com/default.aspx?scid=kb;EN-US;922670
Remove -How to: Uninstall SQL Server Express
http://msdn2.microsoft.com/en-us/library/ms143505.aspx
Remove -The error is: Fatal error during installation"
http://support.microsoft.com/?kbid=919945
Remove -Uninstall Applications NOT in Install/Remove Programs List
http://blogs.msdn.com/astebner/archive/2005/10/30/487096.aspx
Remove –Windows Installer Clean-Up Tool
http://download.microsoft.com/download/E/9/D/E9D80355-7AB4-45B8-80E8-983A48D5E1BD/msicuu2.exe
Can't uninstall books Online CTP Preview
There is no Books Online dependency on ASP.NET. However, the CTP versions of SQL Server (including Books Online) do have a dependency on a specific version of .NET Framework 2.0. That is, the version of .NET Frameworks 2.0 required for the June CTP is different than the version of .NET Framework 2.0 required for the September CTP. The specific version of .NET Framework 2.0 must be installed and available when you uninstall SQL Server or Books Online. This is an unfortunate side effect of one beta application having a dependency on another beta application.
Please try these steps to get your CTP version of Books Online uninstalled.
1. Uninstall the version of .NET Frameworks you have installed now.
2 Install the .NET Frameworks 2.0 version that is appropriate for the CTP version of Books Online you have installed by using one of the following links.
For the September CTP, select the download link to the version of .NET Frameworks available from this site : http://www.microsoft.com/downloads/details.aspx?familyid=ADC75E35-7245-4038-9B8A-B8FABAEC16DA&displaylang=en
For the June CTP, select the download link to the version of .NET Frameworks available from this site: http://www.microsoft.com/downloads/details.aspx?FamilyID=f0d182c1-c3aa-4cac-b45c-bd15d9b072b7&DisplayLang=en
If you're not sure which CTP version of Books Online you have, right-click in any BOL topic and select View Source. Search for the words "Topic built:". The date after that phrase will either be a September or June date.
3. From Add/Remove Programs uninstall Books Online.
4. From Add/Remove Programs uninstall .NET Frameworks 2.0 installed in step 2.
Regards,
|||Thanks for taking the time to respond. After going to bed at 4 AM, again, and awakening from a nightmare I resolved to cut my losses, reformat the hard drive and start fresh. The first thing I installed, after Windows and all my drivers, was dot Net 2.0 and the SQL 2005 Server 180 day Evaluation program. Seems to be working fine.I would recommend this to anyone if their situation permits. Now I have a clean machine, which provides a comfortable feeling. It will take many more hours to reinstall and reconfigure all my programs, but that dwarfs [[edit - oops, is dwarfed by ]] the time already wasted. I'm not blaming Microsoft, and I understand that this was Beta software. This 919 Meg download takes an hour and a half, but it includes the 2005 version of Visual Studio, which is a beautiful program. Many thanks to Microsoft for their fine work. Looking forward to the upcoming 2005 road show in Olando.|||
Hi Steve,
I'm glad you were able to resolve the problem. I know starting from scratch can be time consuming, but as you pointed out, when going from beta software to production code, it's definitely worth starting with a clean machine (even on a test machine).
If possible, you might consider using something like Virtual PC for testing future beta applications.
Regards,
Gail
The trouble is too many variables. Incomplete instructions require guessing, blind allies, recovery, trying something else, etc. The advantage of a read me file is that it can be updated.
I spent probably 24 nonproductive hours with this and a similar Beta problem a couple weeks ago. Productive time, learning something new, is fine. Time going around in circles due to arbitrary idiosyncracies is different. For example, I don't mind the 8 hours I spent the other day debugging a javascript. Specific Beta version dependencies is arbitrary information.
Thanks again.|||I'll check into getting the readme modified.
Thanks,|||
Gaile,
I had the exact issue. Your help above sold my issue perfectly. All I did was install only the .NET Framework I needed and my BOL uninstalled just fine.
Thanks,
Scott
Cant turn off tool tips !
I am using CR10 ASP.NET with CR10 merged module & crystal report viewer, if I create a report in the crystal IDE and use file/options/review/tool-tips this turns off/on tool tips ok but when the report is viewed in the web asp.net the tool tips are always there and what's more you can't suppress individual field tool tips with CHR(9), can anyone helpI found this thread awhile ago. Not sure if it will work with your versions (I use VB6 and CR 8.5).
http://www.dev-archive.com/forum/showthread.php?s=&threadid=297373|||I agree , I have done same thing and it works. Phil let us know if this helps.
Thanks
Dilemma|||Nah this don't work, this is just suggesting using CHR(9) which as I pointed out initially dosn't work in the web browser, I know it works in CR developer
any idea's?