|
The permissions referred to are Code Access Security permissions. If you created your assembly with the default settings in Visual Studio then the assembly is set to SAFE. In order to access external resources you need to increase the assembly to EXTERNAL_ACCESS. If you are using Visual Studio this is done using the project properties. Otherwise, if you are scripting the creation of your assembly use WITH EXTERNAL_ACCESS instead of WITH SAFE (or nothing - default)
|
|
|
|
|
I´m using standard .Net assembly... the Exception occures when the trigger tries to execute the line
TcpClient client = new TcpClient("127.0.0.1",13000);
The TcpClient is Part of the System.dll assembly, and this assembly should be usaly registered correctly?
|
|
|
|
|
The system.dll assembly isn't "registered" with Sql Server, it's part of the hosted CLR. Certain classes w/in the CLR have attributes called Host Protection attributes which indicate the type of functionality the class and it's methods expose. SQL Server restricts access to some these classes based upon how your assembly is created. In order for your assembly to access (it will compile fine, but it won't run) these classes you must create (register) your assembly using WITH EXTERNAL_ACCESS instead of WITH SAFE.
|
|
|
|
|
Hi all.
1.pls help,I want to display a blank column on the grid when my field is null in the DB instead of NULL,and when theres a value the grid should display that value.
2.I have a button on my interface and I need it to dissappear after 20sec,how can I do that,I tried to use a timer but it doesn't dissappear,
pls help with a code.
Thanks.
|
|
|
|
|
1. In your query you need to do something like isnull(fieldname,'') as fieldname
So if you query currently is:
select fieldname from table
It should be:
select isnull(fieldname,'') as fieldname from table
2. I am not sure why you would want a button to dissappear after 20 secs. That sounds a little weird. Anyway, it would depend of if this is a windows app or a web app. If it is a windows app, after you set the button to false in the timer you also probably need to call Application.DoEvents(). If you are in a we app it is a lot more difficult. I have some ideas, but I will assume for now you are talking about a windows app.
Hope that helps.
Ben
|
|
|
|
|
Thanks for your efforts,but it doesn't work the way I want it,maybe is because my question wasn't clear enough,
ok my data in the Db is like this:
Name TimeIN TimeOUT
me 08:15 Null
so I want it to be like this on a grid:
Name Time TimeOUT
Me 08:15
but when the TimeOUt field has a value in the DB it should display that field on the grid eg
Name Time TimeOUT
Me 8:15 4:30
I hope this clarify my question now.
|
|
|
|
|
Edit NullText property of your Data Grid Column give a space there.
|
|
|
|
|
I am suprised it doesn't work since I use the techique all over the place. So if your existing query is:
Select Name, TimeIN, TimeOUT from yourTable
All you should have to do is:
Select Name, TimeIN, IsNull(TimeOut,'') as 'TimeOut' from yourTable
If you are using Sql server. If you ask me it is really best to handle this sort of thing on the database side in what you are passing to .net then try to handle it in .net.
Ben
|
|
|
|
|
hi.
i am developing a web based application in Visual WeB Developer EXPRESS.
I have a Drop down list that which is databound to a particular table. Now i want that wen i select a particular field from the Drop Down List, a table of the same name shud be accessed, and a particular column be filled in the Listbox Control.
i hope i am clear..
Kunal Piyush
|
|
|
|
|
Write a Stored procedure with argumnet (dropdownlist value)
call the stored procedure by passing the value
inseide the stored procedure write a select query with condition
bind the output of stored procedure with listbox
Regards,
Sylvester G
Senior Software Engineer
Xoriant Solutions
sylvester_g_m@yahoo.com
Score it if you like my post
|
|
|
|
|
hey
never wrote a stored procedure.. all i do is simply specify the query within the code.. and get it executed..
so could you please elaborate on this.
sorryy..
Kunal Piyush
|
|
|
|
|
hi
i wrote
this piece of code... and i am getting a error stating.. "Invalid Syntax near [valuename]"
string connString = System.Web.Configuration.WebConfigurationManager.ConnectionStrings["diag"].ConnectionString;
SqlConnection conn = new SqlConnection(connString);
try
{
conn.Open();
SqlCommand cmd = new SqlCommand();
cmd.Connection = conn;
cmd.CommandText = "Select * from '" + DropDownList1.SelectedValue + "'";
SqlDataReader dread = cmd.ExecuteReader();
dread.Read();
while (dread.Read())
{
ListBox1.Items.Add(dread["TestName"].ToString());
}
conn.Close();
}
catch(Exception ex)
{
failed.Text = ex.Message;
}
Kunal Piyush
|
|
|
|
|
cmd.CommandText = "Select * from [" + DropDownList1.SelectedValue + "]";
Regards,
Sylvester G
sylvester_g_m@yahoo.com
|
|
|
|
|
sylvesterg wrote: cmd.CommandText = "Select * from [" + DropDownList1.SelectedValue + "]";
i tried it.. now the error is not coming.. but still no retrival of rows to the listbox as well..
Kunal Piyush
|
|
|
|
|
SQL Server 2000.
A table T has three columns A, B, C.
B is a char column of length 50, containing short phrases, like Thank MC22, MC22 are welcome,
A new mail for MC22 etc.
In this column, all MC22's should be substituted with the word 'you', so that phrases become
meaningful, like Thank you, You are welcome.
Note: whenever MC22 is encountered, EVEN IF IN THE MIDDLE OF A WORD, like abcmc22def,
it should be substituted to abcyoudef.
Everything is case insensitive.
Can someone please write the update statement for me?
Thanks in advance.
ASP - AJAX is SEXY. PERIOD.
|
|
|
|
|
select replace('ThankMC22','MC22','you' )
Regards,
Sylvester G
Senior Software Engineer
Xoriant Solutions
sylvester_g_m@yahoo.com
Score it if you like my post
|
|
|
|
|
Hello Sylvester
I want to know the username and password of SqlExpress.
So i continue my work Pls Help me and let me know
Its Urgent
Thanks and Regards
Aavesh
Dotnet
|
|
|
|
|
No, I don't think you got me.
I have many rows in that table. Here's the scenario: (the actual table)
<code>
Neuron A Neuron B Neuron C
-------- -------------------------------- --------
Passive Thank MC22 Learner
Active MC22 are welcome Learner
Pnode MC22 need a break Veteran
Bnode Hey MC22 Baby</code>
That's what my table is like. Now IN ALL ROWS, IN COLUMN B,
MC22 should be substituted by 'you'.
Thanks in advance.
ASP - AJAX is SEXY. PERIOD.
|
|
|
|
|
update TableName
set [Neuron B] = replace([Neuron B],'MC22', 'You')
Regards,
Sylvester G
Senior Software Engineer
Xoriant Solutions
sylvester_g_m@yahoo.com
Score it if you like my post
|
|
|
|
|
update table_name set column_name = replace(column_name, 'xxx', 'you');
sreeram
|
|
|
|
|
hello
I want to know the username and password of SQlServer 2005 in Mixed Mode Authentication.
its urgent
Pls reply.
Thanks
Aavesh
Dotnet
|
|
|
|
|
im using Username: sa and password: sasa
|
|
|
|
|
Thanks for the Reply
But its not working username sa and password sasa..
I want connect with Sql Express in Sql Server Authentication Mode.
Please tell me Its Urgent.
Thanks and Regards
Aavesh
Dotnet
|
|
|
|
|
Hi guys,
I have some place holder functionality in our Aata Access Layer that should return a properly sorted and paged subset of requested data. However, at the moment we do not have sufficient data to warrant writing the full blown stored procs to implement the most efficient sorting / paging.
However, i would still like to be able to return the correct subset of data in a data table. So how would i go about reducing the contents of the DataTable, whilst retaining the strongly typed data?
Cheers
Tris
Note: Using .NET 2.0
|
|
|
|
|
I would use a DataView and use The RowFilter property, as long as it is a small set. There is also sort functionality in the DataView as well.
Something like:
C#
DataView dv = yourDataTable.DefaultView;
dv.RowFilter = "column1 = '2'";
VB
dim dv as DataView = yourDataTable.DefaultView
dv.RowFilter = "column1 = "'2'";
Then you bind whatever control to the DataView
Hope that helps.
Ben
|
|
|
|