i am trying to do
public string str = txtText.Text;
but it wont let me use txtText.txt so how would I declare that so it can be used everywhere?
I can't use it in the button1_click event because if I do it messes it up because I am having a string retrieve from the textbox and set to the textbox so it doesn't work right so I have to have it retrieve the textbox's text somewhere else then set to it.
In the C++ Standard Library, std::string has a public member function capacity() which returns the size of the internal allocated storage, a value greater than or equal to the number of characters in the string (according to here). What can this value be used for? Does it have something to do with custom allocators?
I have next block in the end of each my stored procedure for SQL Server 2008
BEGIN TRY
BEGIN TRAN
-- my code
COMMIT
END TRY
BEGIN CATCH
IF (@@trancount > 0)
BEGIN
ROLLBACK
DECLARE @message NVARCHAR(MAX)
DECLARE @state INT
SELECT @message = ERROR_MESSAGE(), @state = ERROR_STATE()
RAISERROR (@message, 11, @state)
END
END CATCH
Is it possible to switch CATCH-block to
BEGIN CATCH
ROLLBACK
DECLARE @message NVARCHAR(MAX)
DECLARE @state INT
SELECT @message = ERROR_MESSAGE(), @state = ERROR_STATE()
RAISERROR (@message, 11, @state)
END CATCH
or just
BEGIN CATCH
ROLLBACK
END CATCH
?
Question: I can get the SQL Server database language by querying:
SELECT @@language
And I can get further info via
EXEC sp_helplanguage
How can I query for a column of sp_helplanguage where name= @@language
I do SELECT * FROM sp_helplanguage WHERE name='DEUTSCH'
but that obviously doesn't work.
What's the correct way to query it ?
I am trying to write a batch file that will examine a given directory, read each file for a given string "Example" and then delete any files that contain the string. The files are also System Files so I don't know what the exact extension is or if that matters (maybe you can just omit a file type filter and have it read all files?). Some of the files will be locked from reading as well so it needs to handle access denial errors if that occurs, not sure how batch files handle that.
my string style like this:
expression1/field1+expression2*expression3+expression4/field2*expression5*expression6/field3
a real style mybe like this:
computer/(100)+web*mail+explorer/(200)*bbs*solution/(300)
"+" and "*" represent operator
"computer","web"...represent expression
(100),(200) represent field num . field num may not exist.
I want process the string to this:
/(100)+web*+explorer/(200)bbs/(300)
rules like this:
if expression length is more than 3 and its field is not (200), then add brackets to it.
I am using sqlcmd in a T-SQl script to write a text file to a network location. However SQLCMD is failing to write to that location due to access permission to the network folder. SP is being run under my user account which has access to the network folder.
Could you please help me under which account sqlcmd will run if I do not specify -U and -P option in TSQL Script?
I'm quite a beginner in C# , empty string to double conversion can be carried out under the button1_click event ..but doing it under Public Form1() it gives me this error
Input string was not in a correct
format.
how to solve this please ?
thanks in advance .
I would like to ask if there is a way to include the total number of rows, as an additional column, in the returned result sets from a TSQL query using also the Row_Number (SQL 2005) command.
For example, getting the results set from a query against Book table in a form similar to this:
RowNum BookId BookTitle TotalRows
--------------------------------------------
1 1056 Title1 5
2 1467 Title2 5
3 121 Title3 5
4 1789 Title4 5
5 789 Title5 5
is there some way to tell sql server to use the (nolock) hint or every select in a stored procedure?
is pretty tiresome to add it to each an every select....
In python I can construct a HTML string without worrying about escaping special characters like < or " by simply enclosing the string in triple quotes like:
html_string = """
<html>
<body>
<p>My text with "quotes" and whatnot!<p>
</body>
</html>
"""
Is there a similar way to do this in Java?
Consider the following Transact sql.
DECLARE @table TABLE(val VARCHAR(255) NULL)
INSERT INTO @table (val) VALUES('a')
INSERT INTO @table (val) VALUES('b')
INSERT INTO @table (val) VALUES('c')
INSERT INTO @table (val) VALUES('d')
INSERT INTO @table (val) VALUES(NULL)
select val
from @table
where val not in ('a')
I would expect this to return
b, c, d, NULL
but instead it returns
b, c, d
Why is this the case? Is NULL not evaluated? Is NULL somehow in the set 'a'?
I'm working on 2 cases:
assume I have those var:
a = "hello"
b = "hello-SP"
b = "not_hello"
1 - Any partial matches
I want to accept any string that has the var a inside, so b and c would match.
2 - Patterned match
I want to match a string that has a inside, followed by '-', so b would match, c does not.
I am having problem, because I always used the syntax /expression/ to define Regexp, so how dinamicaly define an RegExp on Ruby??
Ok I have a string...
$a_string = "Product";
and I want to use this string in a call to a object like this:
$this->$a_string->some_function();
How the dickens do I dynamically call that object?
(don't think Im on php 5 mind)
I have to create a C# application which displays unicode data in a textbox.
But the SQL server column storage has varchar data which contains unicode data. But since varchar is non-unicode based it displays character strings like "????????".
Well the problem i am facing is i cant change the column type as there are other dependent application running on it.
to create new a new databse file start sql server management studio express on db server and create it!
i would like to create a database using c# in my web application visual studio 08
is it possible?
as connection string has to have a name of database to connect, but i want to create one.
Hi ,
I need to add default value column in SqlServer Compact....i am new to this SQL server compact so Plz anyone tell me the Solution of this....
Thanks In Advance
How do I build a connection string which includes a passsword having a "=" in it? (I'm connecting to MySql 5.1)
For example, let's say the password is "Ge5f8z=6", what would the connection string look like?
I tried:
Server=DBSERV;Database=mydb;UID=myuser;PWD="Ge5f8z=6";
and
Server=DBSERV;Database=mydb;UID=myuser;PWD=Ge5f8z=6;"
Both don't work.
I have a following string that I would like to parse into either a List or a String[].
(Test)(Testing (Value))
End result should be Test and Testing (Value)
Hello,
Is there a way to declare a string variable in python such that everything inside of it is automatically escaped, or has its literal character value? I'm NOT asking how to escape the quotes with slashes, that's obvious. What I'm asking for is a general purpose way for making EVERYTHING in a string literal so that I don't have to manually go through and escape everything for very large strings. Anyone know of a solution? Thanks!
i asked a question regarding how to display aspx and cs code on page,
one answer was convert to string and display in textbox
i would like to know if there is a function in c# asp.net which allows to convert file contents directly to string?