|
Guffa wrote: The thread writer seems to be in the stage of getting a database connection to work at all, and at that stage it's difficult to be concerned with security issues.
I suppose you're right.
ColinMackay.net
Scottish Developers are looking for speakers for user group sessions over the next few months. Do you want to know more?
|
|
|
|
|
ytubis wrote: i gave him the login permissions, i thought that all the permissions come with that.
Login permission is just that: Permission to login. It does not grant any other rights.
You need to add the user associated with the login to the database you wish to access.
Then you need to <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_ga-gz_8odw.asp" rel="nofollow">GRANT</a>[<a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_ga-gz_8odw.asp" target="_blank" rel="nofollow" title="New Window">^</a>] the user the rights to do what is needed. Normally, I just permit access to stored procedures. That way all the application can do is what is defined in the stored procedures.
ColinMackay.net
Scottish Developers are looking for speakers for user group sessions over the next few months. Do you want to know more?
|
|
|
|
|
Hi everyone,
I am trying to migrate a source code from C++ to C#. This code deals with computer graphics and image filtering. It needs to be efficient, this explain why I use some low level programmation in C#.
I need to find a way to create a generic class that represent an array of whatever (this array will mostly be used to represent pixels). This class will then allow me to access any data in a width * height grid of data.
But it gets intricate when I try to get a pointer on my generic type. Here is a sample:
class Field<anyType>
{
private int nx, ny;
private anyType[] data;
public unsafe Field(int x, int y)
{
nx = x;
ny = y;
if (nx * ny != 0)
{
data = new anyType[nx * ny];
}
}
// return the anyType value located at (i, j)
public unsafe anyType Value(int parameter)
{
i = (i < 0) ? -i : (i >= nx) ? 2 * nx - i - 1 : i;
j = (j < 0) ? -j : (j >= ny) ? 2 * ny - j - 1 : j;
fixed(<b>anyType* v = data</b>) //this does not compile, see error below
{
return (anyType) *(v + j * nx + i);
}
}
}
But the compilator does not like it, it says:
<i>Cannot take the address of, get the size of, or declare a pointer to a managed type ('anyType')</i>
about the bolded line.
So what? is it impossible to get a pointer on a managed object. I thought it was the goal of the fixed statement to give possibility to use pointer on any object.
I know that I could also simply use data[j*nx+i] but anyhow, I will need this pointer later on for other purpose.
Every good ideas is welcome
Lawrence
|
|
|
|
|
Only works on types that has no managed references.
|
|
|
|
|
hello,
i find the visual c# has some feature that c++ does not,and i want to use the visual c# write something that can be used in my visual c++ project,does this possible?and what can i do?
maybe is the dll or com dll,but i do not know how to?
|
|
|
|
|
Hello
I was hunting for articles about Recording voice from microphone in Windows C#, I did not get a single one. I got one or two website who are selling recording components for high $$$$. Is it not really possible to record voice in C# ?
-- modified at 8:28 Sunday 26th February, 2006
|
|
|
|
|
Hi!
What's wrong with Ianier Munoz' article[^]?
Regards,
mav
--
Black holes are the places where god divided by 0...
|
|
|
|
|
I write this code , then i connect to a proxy [I can already ping on it] , and the code retieve exception [It connects to an unreachable host] How is this???
IPEndPoint ProxyEndPoint = new IPEndPoint(ProxyIP, ProxyPort);
Socket DestSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
DestSocket.Connect(ProxyEndPoint);
|
|
|
|
|
Hello,
When I run my Windows form, Some texboxes can take CTRL + C command to copy and right mouse click pops up with Edit menu (copy, paste , cut etc) and Some textboxes are not equipped with this feature by default. Can you tell me how can i make all textboxes and richtextboxes take CTRL+C command takeble and right mouse click edit menu enabled by default ?
|
|
|
|
|
What kind of textboxes is it that don't take those command?
Passwords textboxes of course does not support copying.
---
b { font-weight: normal; }
|
|
|
|
|
Hello,
Thanks for replying me.
In my windows form, I am using 5/6 regular textbox and richtextbox.(not password) I did not write code for those boxes to take CTRL + C command (like KeyDown event handler). Some boxes are by default listening and some of them are not listening those command. I had to write code for those boxes to listen CTRL+C command.
Thanks
|
|
|
|
|
The commands are built into windows, so most standard controls respond to them.
Can you see any difference between the textboxes that do respond to the commands, and those that don't?
---
b { font-weight: normal; }
|
|
|
|
|
Hi all !
I've 3 sql table :
table1(maintable):id_car[primarykey],id_service,name_car ,
table 2:id_service[primary key] , kind_service
and table3 :myid[primarykey],id_car,company
Relations :table1 - table2(many to one) ,table1-table3(one to many)
I want to select name_car,kind_service,copany for filling a dataset in a crystal report(to taking a Report)and for this , I added an Item Data Set in my project .According to the relation between tables(table1,table2,table3),
for one table(without considering the relation) I wrote :
myDataset ds=new myDataset();<br />
strConnection.Open();<br />
string strSQL = "SELECT * FROM table1";<br />
dataadapter1 = new SqlDataAdapter(strSQL,strConnection);<br />
SqlCommandBuilder scb = new SqlCommandBuilder(dataadapter1);<br />
dataadapter1.Fill(ds.table1);<br />
CrystalReport1.SetDataSource(ds.table1);<br />
crystalReportViewer1.ReportSource=CrystalReport1;
but I dont't know , how can I fill myDataset when there is 3 table ??.
Thanks for any help.
Regards !
s_mostafa_h
|
|
|
|
|
hi everybody
i have a web site which specifies profile to my users.
my web site registeration policy is for the first step sending mail to anybody who requests to signup in my web site.(just like gmail Invitation)
but recently most of my web application mails to yahoo server will be spam or bulk.
i think the yahoo server make all of my site mails to spam or bulk.
what should i do.
my site is so Famous in my country and i have more than 500 sign up request everyday.
what should i do with this problem.
Thanks
Rastegar
|
|
|
|
|
Please don't cross post.
---
b { font-weight: normal; }
|
|
|
|
|
|
what do you mean?!
please answer me more clear.
Thanks
Rastgar
|
|
|
|
|
|
Hello ...
If i have transactions for the 3 subsequent commands to execute, is database locked for this time to prevent interruption by other threads (automatically) ? Or must I use lock statement for this purpose ?
|
|
|
|
|
|
Hi Colin'
Thanks for your reply.
Actually my question was like this,
Situation,
{
command A
commandA.transaction = transactionA
commandB
commandB.transaction = transactionA
commandC
commandC.transaction = transactionA
// execute all commands
transactionA.commit
}
Now , do I need to lock the mentioned block as I am already using Transaction. You replied me saying that, database will not be locked, I should use transaction. I am confused. Did you mean if I use transaction then SQL will be locked ? if so, then thats what was my question
|
|
|
|
|
emran834 wrote: do I need to lock the mentioned block as I am already using Transaction.
You do not need to use the C# keywork lock in this situation.
emran834 wrote: You replied me saying that, database will not be locked, I should use transaction.
If you use the lock keyword, all you are doing is locking other threads from the same application out. However, other applications can still access and modify the database.
emran834 wrote: Did you mean if I use transaction then SQL will be locked ?
If you use the transaction SQL Server will ensure that no other process can modify the same part of the database that you are modifying.
ColinMackay.net
Scottish Developers are looking for speakers for user group sessions over the next few months. Do you want to know more?
|
|
|
|
|
Thanks Colin for detailed and explained answer.
|
|
|
|
|
I have a code structured like this:
Class A {<br />
...
private void methodA () {<br />
B b = new B();<br />
...
}<br />
<br />
}<br />
<br />
Class B {<br />
...
~B() {...}<br />
}
will the destructor run in class B when the methodA in class A finishes? If not, how can i make it run?
|
|
|
|
|
When the garbage collector finds an object with a destructor, it places it on a special queue, hence the destruction of an object is not deterministic (you cannot predict when it happens).
--------
"I say no to drugs, but they don't listen."
- Marilyn Manson
|
|
|
|