Signup/Sign In

Answers

All questions must be answered. Here are the Answers given by this user in the Forum.

I just had the same problem. Visual Studio isn't building the project that's being referenced.

Instructions:

1. Right-click on the solution and click Properties.
2. Click Configuration on the left.
3. Make sure the check box under "Build" for the project it can't find is checked. If it is already checked, uncheck, hit apply and check the boxes again.
4. (Optional) You had to do it for both Release and Debug modes on the solution properties.
3 years ago
Update for .NET Framework 4.5 and 4.6; the following will no longer work:

***string keyvalue = System.Configuration.ConfigurationManager.AppSettings["keyname"];***

Now access the Setting class via Properties:

***string keyvalue = Properties.Settings.Default.keyname;***
3 years ago
Using both and will give you a wider breadth of browser compatibility.

***

This browser does not support PDFs. Please download the PDF to view it: Download PDF.



***
3 years ago
Try this for value

***$("select#id_of_select_element option").filter(":selected").val();***

Try this one for text

***$("select#id_of_select_element option").filter(":selected").text();***
3 years ago
You can try this code. This will check the table and reset to the next ID.

***declare @max int
select @max=max([Id]) from [TestTable]
if @max IS NULL --check when max is returned as null
SET @max = 0
DBCC CHECKIDENT ('[TestTable]', RESEED, @max)***
3 years ago
You can try these queries:

***SELECT asterisk (*)
FROM Orders
LEFT JOIN OrderLines ON OrderLines.OrderID=Orders.ID
WHERE Orders.ID = 12345***
and

***SELECT asterisk (*)
FROM Orders
LEFT JOIN OrderLines ON OrderLines.OrderID=Orders.ID
AND Orders.ID = 12345***
3 years ago
Good practice is to use the following:

***import os

writepath = 'some/path/to/file.txt'

mode = 'a' if os.path.exists(writepath) else 'w'
with open(writepath, mode) as f:
f.write('Hello, world!\n')***
3 years ago
You probably have an alias somewhere, mapping **cp** to **cp -i;** because with the default settings, **cp** won't ask to overwrite. Check your **.bashrc**, your **.profile** etc.

See cp manpage: Only when -i parameter is specified will cp actually prompt before overwriting.

You can check this via the **alias** command:

***$ alias
alias cp='cp -i'
alias diff='diff -u'
....***

To undefine the alias, use:

***$ unalias cp***
3 years ago
Use the **toSql()** method on a QueryBuilder instance.

***DB::table('users')->toSql()***

would return:

***select * from `users`***

This is easier than wiring up an event listener, and also lets you check what the query will actually look like at any point while you're building it.
3 years ago
For all the databases you have on the server:

***mysql> SELECT SCHEMA_NAME 'database', default_character_set_name 'charset', DEFAULT_COLLATION_NAME 'collation' FROM information_schema.SCHEMATA;***

For a single Database:

***mysql> USE my_database;
mysql> show variables like "character_set_database";***

Getting the collation for Tables:

***mysql> USE my_database;
mysql> SHOW TABLE STATUS WHERE NAME LIKE 'my_tablename';***

OR - will output the complete SQL for create table:

***mysql> show create table my_tablename***

Getting the collation of columns:

***mysql> SHOW FULL COLUMNS FROM my_tablename;***
3 years ago
If your SQL supports CHARINDEX, it's a lot easier to use it:

***SELECT * FROM MyTable
WHERE CHARINDEX('word1', Column1) > 0
AND CHARINDEX('word2', Column1) > 0
AND CHARINDEX('word3', Column1) > 0***

Also, please keep in mind that this and the method in the accepted answer only cover substring matching rather than word matching. So, for example, the string 'word1word2word3' would still match.
3 years ago
If it is a deployment script then you can add adding some additional security to it by using this code

***IF EXISTS (
SELECT 1
FROM sys.columns
WHERE
name = 'OldColumnName' AND
object_name(object_id) = 'TableName'
) AND
NOT EXISTS (
SELECT 1
FROM sys.columns
WHERE
name = 'NewColumnName' AND
object_name(object_id) = 'TableName'
)
EXEC sp_RENAME 'SchemaName.TableName.OldColumnName', 'NewColumnName', 'COLUMN';***
3 years ago