Showing posts with label click. Show all posts
Showing posts with label click. Show all posts

Thursday, March 22, 2012

( ) problem

hi all,

i have some problem in my web application, am using vb.net

i have a text box and an add button, when the user click on the add button, whatever written in the textbox stores on my sql database

the problem is whenever there is a ( ' ) character in the text, it send me error

i know why this problem occure but i dont know what is the reqired code for it

this is the code:

sql.commandtext = "INSERT INTO myDB (Ques) VALUES ('" & txtQues.text & "')

what is the solution?

The answer is very simple in C# those are literals and in ANSI SQL they are Delimited Identifiers per ANSI SQL 92 and SQL Server is compliant so try the link below on how to enable it and handle it correctly. Hope this helps.

http://msdn2.microsoft.com/en-us/library/ms176027.aspx

|||

If you think about it, you are putting together the string before it gets sent to SQL Server. So, if your value has a single quote it, your insert would look something like:

INSERT INTO myDB (Ques) VALUES ('myvalue's')

This is confusing. The string seems to end after the 'e', when you really want it to end after the 's'. As said, SQL Server is taking that literally. If you're going to build the insert statement this way (as opposed to using a stored procedure), you need to replace single quotes with two single quotes (not a double quote - literally two single quotes).

txtQues.Text.Replace("'", "''")

The string passed to the database will be:

INSERT INTO myDB (Ques) VALUES ('myvalue''s')

which the database will interpret correctly.

|||Parameterized queries.|||thanks alot... for your helpBig Smile

Sunday, March 11, 2012

"Open Table" NOT WORKING. Can someone HELP!

In my instance of "sql server 2005" I right click on a table and select "Open Table" then I get the error message "Object reference not set to..." Then has been happening since I installed I have tryed searching groups and posting to get a solution. I have load the adventure works data base and get the same error when performing "open table". Can someone from MS please respond. Also if Open Table works can you edit the data directly in the results pane?

I had very similar problem. The problem was gone after I installed SP2.|||

Have you tried to attempt from another client's machine against this server?

Also test and try using SP2 on SQL 2005, if it is not a SQL 2005 instance then make sure to have latest service pack on SQL 2000 too.

|||

I am sorry but I should have been more specific about what happened in my case. Here is the story:

The instance of SQL 2005 is on machine A and I had no problem in accessing the tables from machine A. The problem was with machine B on which I was running Management Studio to access the SQL server on machine A. I could connect, open the database, display columns of the tables, but whenever I tried to open a table to browse data or modify the table, I got the error. I installed SQL 2005 SP2 on machine B and the problem was gone. Apparently something was wrong with the instance of Management Studio on machine B. It worked fine flawlessly for a very long time. I have no clue what caused the problem for SSMS.

"Open Table" NOT WORKING. Can someone HELP!

In my instance of "sql server 2005" I right click on a table and select "Open Table" then I get the error message "Object reference not set to..." Then has been happening since I installed I have tryed searching groups and posting to get a solution. I have load the adventure works data base and get the same error when performing "open table". Can someone from MS please respond. Also if Open Table works can you edit the data directly in the results pane?

I had very similar problem. The problem was gone after I installed SP2.|||

Have you tried to attempt from another client's machine against this server?

Also test and try using SP2 on SQL 2005, if it is not a SQL 2005 instance then make sure to have latest service pack on SQL 2000 too.

|||

I am sorry but I should have been more specific about what happened in my case. Here is the story:

The instance of SQL 2005 is on machine A and I had no problem in accessing the tables from machine A. The problem was with machine B on which I was running Management Studio to access the SQL server on machine A. I could connect, open the database, display columns of the tables, but whenever I tried to open a table to browse data or modify the table, I got the error. I installed SQL 2005 SP2 on machine B and the problem was gone. Apparently something was wrong with the instance of Management Studio on machine B. It worked fine flawlessly for a very long time. I have no clue what caused the problem for SSMS.

"Open Table" NOT WORKING. Can someone HELP!

In my instance of "sql server 2005" I right click on a table and select "Open Table" then I get the error message "Object reference not set to..." Then has been happening since I installed I have tryed searching groups and posting to get a solution. I have load the adventure works data base and get the same error when performing "open table". Can someone from MS please respond. Also if Open Table works can you edit the data directly in the results pane?

I had very similar problem. The problem was gone after I installed SP2.|||

Have you tried to attempt from another client's machine against this server?

Also test and try using SP2 on SQL 2005, if it is not a SQL 2005 instance then make sure to have latest service pack on SQL 2000 too.

|||

I am sorry but I should have been more specific about what happened in my case. Here is the story:

The instance of SQL 2005 is on machine A and I had no problem in accessing the tables from machine A. The problem was with machine B on which I was running Management Studio to access the SQL server on machine A. I could connect, open the database, display columns of the tables, but whenever I tried to open a table to browse data or modify the table, I got the error. I installed SQL 2005 SP2 on machine B and the problem was gone. Apparently something was wrong with the instance of Management Studio on machine B. It worked fine flawlessly for a very long time. I have no clue what caused the problem for SSMS.

"Open Table" NOT WORKING in Management Studio

When I open a database and right click and select "Open Table" I get the error message "Object reference not set to...". What could the issue be. I have loaded the adventure works db and tried it also and still get the same error. Could someone at MS please respond to this. Also when open table works can I directly edit values in the result pane like I did in Sql Server 2000?

This forum is for Analysis Services -related questions. Try posting on "SQL Server Tools General" forum.

Edward.
--
This posting is provided "AS IS" with no warranties, and confers no rights.

"Open Table" NOT WORKING in Management Studio

When I open a database and right click and select "Open Table" I get the error message "Object reference not set to...". What could the issue be. I have loaded the adventure works db and tried it also and still get the same error. Could someone at MS please respond to this. Also when open table works can I directly edit values in the result pane like I did in Sql Server 2000?

This forum is for Analysis Services -related questions. Try posting on "SQL Server Tools General" forum.

Edward.
--
This posting is provided "AS IS" with no warranties, and confers no rights.

"Open Table" NOT WORKING in Management Studio

When I open a database and right click and select "Open Table" I get the error message "Object reference not set to...". What could the issue be. I have loaded the adventure works db and tried it also and still get the same error. Could someone at MS please respond to this. Also when open table works can I directly edit values in the result pane like I did in Sql Server 2000?

David,

I will do some research on "Object reference not set to" error. You can edit data directly from the results pane.

Thanks!

|||

David,

We need more information about this error. Are you still able to reproduce this error?

Thanks!

|||

I have never been able to explain why it happened. When I would try to do "open table" I would always get the "object ref not set" error. I did uninstall and when I re-installed the install locked up on "Setting File Security". I had seen that error before and knew to unplug the network connection. After I reinstalled the error went away.

I wanted to know if we can get behahivior similiar to 2000 where a user could enter a sql select and then edit the results in results pane. The open table helps but when you want to quickly change a value the edit of a few rows is easier than finding a row in a large result set. Also I noticed when I unistalled I had to uninstall each component separately. Can the uninstall of sql server 2005 uninstall all components.

thanks

|||

Sounds like "object ref not set" error might have been due to corrupted installation. Please let us know if you encounter that error again.

Current SQL Editor does not allow you to edit directly from the results grid as you've noticed. You can choose Open Table and bring up SQL Pane from the Query Designer by either clicking on a toolbar icon (a whitebox with SQL text in it) or hitting CTRL+3. Then edit the SQL syntax to bring up a sub-set of records for editing.

For uninstallation issue, please provide your feedback through http://lab.msdn.microsoft.com/productfeedback/Default.aspx. All feedbacks received via our Product Feedback center are reviewed by the team and we treat them seriously.

Hope this helps.

Thanks!

|||

Can you give us the logic behind why you can't edit the result set of a query?!?!

I am, frankly, astonished that this feature was removed. It is truly one of the most useful features for a quick edit of data.

On that note, the workaround is that you "open the table"? Am I missing something that doing an "open table" produces all data in the table? So, we have to burden the machine with potentially thousands upon thousands of records just to edit a single field? Crazy!

Also, using a join query after "opening" the table results in read only!

The other way around is to find the right record ID, then write an update query?

Seriously, is there any explanation because it sounds completely ludicrous to me? What was the point of this?

/sorry to seem so annoyed, but so many people rely on this feature. I know I'm not the only one.

"Open Table" NOT WORKING in Management Studio

When I open a database and right click and select "Open Table" I get the error message "Object reference not set to...". What could the issue be. I have loaded the adventure works db and tried it also and still get the same error. Could someone at MS please respond to this. Also when open table works can I directly edit values in the result pane like I did in Sql Server 2000?

David,

I will do some research on "Object reference not set to" error. You can edit data directly from the results pane.

Thanks!

|||

David,

We need more information about this error. Are you still able to reproduce this error?

Thanks!

|||

I have never been able to explain why it happened. When I would try to do "open table" I would always get the "object ref not set" error. I did uninstall and when I re-installed the install locked up on "Setting File Security". I had seen that error before and knew to unplug the network connection. After I reinstalled the error went away.

I wanted to know if we can get behahivior similiar to 2000 where a user could enter a sql select and then edit the results in results pane. The open table helps but when you want to quickly change a value the edit of a few rows is easier than finding a row in a large result set. Also I noticed when I unistalled I had to uninstall each component separately. Can the uninstall of sql server 2005 uninstall all components.

thanks

|||

Sounds like "object ref not set" error might have been due to corrupted installation. Please let us know if you encounter that error again.

Current SQL Editor does not allow you to edit directly from the results grid as you've noticed. You can choose Open Table and bring up SQL Pane from the Query Designer by either clicking on a toolbar icon (a whitebox with SQL text in it) or hitting CTRL+3. Then edit the SQL syntax to bring up a sub-set of records for editing.

For uninstallation issue, please provide your feedback through http://lab.msdn.microsoft.com/productfeedback/Default.aspx. All feedbacks received via our Product Feedback center are reviewed by the team and we treat them seriously.

Hope this helps.

Thanks!

|||

Can you give us the logic behind why you can't edit the result set of a query?!?!

I am, frankly, astonished that this feature was removed. It is truly one of the most useful features for a quick edit of data.

On that note, the workaround is that you "open the table"? Am I missing something that doing an "open table" produces all data in the table? So, we have to burden the machine with potentially thousands upon thousands of records just to edit a single field? Crazy!

Also, using a join query after "opening" the table results in read only!

The other way around is to find the right record ID, then write an update query?

Seriously, is there any explanation because it sounds completely ludicrous to me? What was the point of this?

/sorry to seem so annoyed, but so many people rely on this feature. I know I'm not the only one.

"Open Table" NOT WORKING in Management Studio

When I open a database and right click and select "Open Table" I get the error message "Object reference not set to...". What could the issue be. I have loaded the adventure works db and tried it also and still get the same error. Could someone at MS please respond to this. Also when open table works can I directly edit values in the result pane like I did in Sql Server 2000?

David,

I will do some research on "Object reference not set to" error. You can edit data directly from the results pane.

Thanks!

|||

David,

We need more information about this error. Are you still able to reproduce this error?

Thanks!

|||

I have never been able to explain why it happened. When I would try to do "open table" I would always get the "object ref not set" error. I did uninstall and when I re-installed the install locked up on "Setting File Security". I had seen that error before and knew to unplug the network connection. After I reinstalled the error went away.

I wanted to know if we can get behahivior similiar to 2000 where a user could enter a sql select and then edit the results in results pane. The open table helps but when you want to quickly change a value the edit of a few rows is easier than finding a row in a large result set. Also I noticed when I unistalled I had to uninstall each component separately. Can the uninstall of sql server 2005 uninstall all components.

thanks

|||

Sounds like "object ref not set" error might have been due to corrupted installation. Please let us know if you encounter that error again.

Current SQL Editor does not allow you to edit directly from the results grid as you've noticed. You can choose Open Table and bring up SQL Pane from the Query Designer by either clicking on a toolbar icon (a whitebox with SQL text in it) or hitting CTRL+3. Then edit the SQL syntax to bring up a sub-set of records for editing.

For uninstallation issue, please provide your feedback through http://lab.msdn.microsoft.com/productfeedback/Default.aspx. All feedbacks received via our Product Feedback center are reviewed by the team and we treat them seriously.

Hope this helps.

Thanks!

|||

Can you give us the logic behind why you can't edit the result set of a query?!?!

I am, frankly, astonished that this feature was removed. It is truly one of the most useful features for a quick edit of data.

On that note, the workaround is that you "open the table"? Am I missing something that doing an "open table" produces all data in the table? So, we have to burden the machine with potentially thousands upon thousands of records just to edit a single field? Crazy!

Also, using a join query after "opening" the table results in read only!

The other way around is to find the right record ID, then write an update query?

Seriously, is there any explanation because it sounds completely ludicrous to me? What was the point of this?

/sorry to seem so annoyed, but so many people rely on this feature. I know I'm not the only one.

Saturday, February 25, 2012

"Create a Grants Rights Script" error in rs db configaration

Hi,

While I'm trying to configure rs db configuration, I’m getting "Create a Grants Rights Script" error when I click Apply button in rs configuration UI.

For this setup; I’m using 32-bit rs on 64-bit windows 2003 server and trying to connect 64-bit sql db instance on a different 64-bit box . both boxes are in same windows domain. I could also able to create rs db from rs configuration UI successfully. I'm using sql sa credentials and installed SQL SP1 on both boxes. Pl let me know how to fix this error.

Complate error message is,

System.Runtime.InteropServices.COMException (0x800706BA): The RPC server is unavailable. (Exception from HRESULT: 0x800706BA)
at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
at System.Management.ManagementScope.InitializeGuts(Object o)
at System.Management.ManagementScope.Initialize()
at System.Management.ManagementObjectSearcher.Initialize()
at System.Management.ManagementObjectSearcher.Get()
at Microsoft.ReportingServices.Diagnostics.WebUtil.GetIPAddresses(String machine)
at ReportServicesConfigUI.Panels.DatabaseSetupPanel.IsLocalDbServer(String dbServer)
at ReportServicesConfigUI.Panels.DatabaseSetupPanel.SetDatabaseConnectionTask(String connectionString, String server, String database, ConfigurationCredentialsType credsType, String account, String password, Boolean upgrade, String dbVersion)

Thanks in advance

Ram

did you ever resolve this problem. I'm gettnig the same error.|||

Hi Greg,

I would suggest to start from here:

http://msdn2.microsoft.com/en-us/library/ms365170.aspx

http://msdn2.microsoft.com/en-us/library/ms159093.aspx

Mihaela

"Create a Grants Rights Script" error in rs db configaration

Hi,

While I'm trying to configure rs db configuration, I’m getting "Create a Grants Rights Script" error when I click Apply button in rs configuration UI.

For this setup; I’m using 32-bit rs on 64-bit windows 2003 server and trying to connect 64-bit sql db instance on a different 64-bit box . both boxes are in same windows domain. I could also able to create rs db from rs configuration UI successfully. I'm using sql sa credentials and installed SQL SP1 on both boxes. Pl let me know how to fix this error.

Complate error message is,

System.Runtime.InteropServices.COMException (0x800706BA): The RPC server is unavailable. (Exception from HRESULT: 0x800706BA)
at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
at System.Management.ManagementScope.InitializeGuts(Object o)
at System.Management.ManagementScope.Initialize()
at System.Management.ManagementObjectSearcher.Initialize()
at System.Management.ManagementObjectSearcher.Get()
at Microsoft.ReportingServices.Diagnostics.WebUtil.GetIPAddresses(String machine)
at ReportServicesConfigUI.Panels.DatabaseSetupPanel.IsLocalDbServer(String dbServer)
at ReportServicesConfigUI.Panels.DatabaseSetupPanel.SetDatabaseConnectionTask(String connectionString, String server, String database, ConfigurationCredentialsType credsType, String account, String password, Boolean upgrade, String dbVersion)

Thanks in advance

Ram

did you ever resolve this problem. I'm gettnig the same error.|||

Hi Greg,

I would suggest to start from here:

http://msdn2.microsoft.com/en-us/library/ms365170.aspx

http://msdn2.microsoft.com/en-us/library/ms159093.aspx

Mihaela