|
hi there,
I'm not sure what you're trying to do here. Do you actually need the relationships created between the tables or are you just trying to query data using joins. I believe that each DB engine will have a slightly different way of creating things like relationships.
this is the code for sql2000
ALTER TABLE Person
ADD CONSTRAINT Person_AddressID
FOREIGN KEY (AddressID)
REFERENCES Address(AddressID)
HTH
Russ
|
|
|
|
|
thanks buddy for the idea.
however i'm encountering another problem.
i'm using the following sql query to display all information of a table.
string table_name1=comboBox1.Text;<br />
string sql_query="DESCRIBE "+table_name1;<br />
<br />
try<br />
{<br />
cmd=new SqlCommand(sql_query,conn);<br />
cmd.ExecuteNonQuery();<br />
}<br />
catch(SqlException ae)<br />
{<br />
MessageBox.Show(ae.Message.ToString());<br />
}
the error i'm gettin is
could not find stored procedure 'DESCRIBE'
could u please guide me about this.
is there any error with the query??
i tried using the keyword DESC also but it still gives an error.
plz help
thanks
|
|
|
|
|
Sql Server doesn't have any defination for Desc or Describe .use following query to get column information of a table
SELECT Column_Name, Data_TYPE FROM Information_Schema.Columns WHERE (TABLE_NAME = 'TableName')
sameer
|
|
|
|
|
hi
i want to get information of all columns of a table at once by only giving the table name in the query.
how can i do this.
one way of doing this is through stored procedures.
can anyone guide me about them, that where do i save the procedure and how do i call it ????
thanks and regards
|
|
|
|
|
above query gives the the same result.
sameer
|
|
|
|
|
which database engine are you using? this kind of code is often very DBMS specific.
if you are using SQL and are never likely to point your code at any other dbms i would recommens using the SQL SMO objects
Russell
|
|
|
|
|
i'm using SqlServer 2000 desktop edition.
and what object were u talking about
|
|
|
|
|
Good Morning,
I have to create object of c# class in aspx.cs class .
I'm not sure whether it is good to create instance of that class globaly or to create its instance in every evnt block in aspx.cs file.Which one would be efficient and good way of programming?Please guide.
yog
hui gfgh kgdgrt njjn hjgkn
|
|
|
|
|
Hello yogita ,
It depands on your working scenerio.
If its just class with some methods to call then I suggest to Create instance in every aspx but please dispose that object too.
If that class contains session or user information then you may use in global class.
Thank You.
|
|
|
|
|
Thank you.
yog
hui gfgh kgdgrt njjn hjgkn
|
|
|
|
|
|
|
|
|
Hello Samira,
Here is a code with you can get the Mac adrress of local machine
i hope this will help full to you.
private static string GetMacAddress()
{
string macAddr = "";
try
{
ManagementClass mc = new ManagementClass("Win32_NetworkAdapter");
foreach (ManagementObject mo in mc.GetInstances())
{
macAddr = mo["MACAddress"] as string;
if (macAddr != null && macAddr.Trim() != "")
return macAddr;
}
}
catch (Exception exp)
{
}
Random ranGenerator = new Random(6);
macAddr = ranGenerator.Next(100000, 999999).ToString();
return macAddr;
}
Regards,
Irfan.
|
|
|
|
|
hello
i have developed a desktop application in C#.net 2.0 where i need to retrieve all installed browser plugins names in the loacal machine.That means the application will retrieve all the installed browser plugin names from the pc where this application run.
Please helpme to find a way to retrive the installed plugin names.
Thanks and regards
Sourav
|
|
|
|
|
:|Hi,
can any one give me a win32 api and also a control or library that can get the NEC MAC address from the Hardware itself not from the registry. it will be good if it can be used in C#.
May god give u good health and knowledge.
|
|
|
|
|
Hi, I'm wondering how I can remove the 'Close' button on a modal dialog. The reason is I don't want the user to accidentally close this partiulcar window, or at least display a confirmation to the user to ask whether if they really want to close it. I can't do that with the Form_Closing event as it stills closes it.
|
|
|
|
|
write your code int Dispose Method.e.g
protected override void Dispose( bool disposing )<br />
{<br />
<br />
if(DialogResult.Yes==MessageBox.Show("Do you Want to quit?","Quit",MessageBoxButtons.YesNo))<br />
{<br />
if( disposing )<br />
{<br />
if(components != null)<br />
{<br />
components.Dispose();<br />
}<br />
}<br />
base.Dispose( disposing );<br />
}<br />
else<br />
return;<br />
}<br />
|
|
|
|
|
|
When the Form is getting disposed it is already closed. So this doesn't work. Dispose is about freeing resources - no more no less.
Robert
|
|
|
|
|
Hi,
why can't you do this with the Closing event? This is exactly what it is meant for. Post some code. You have most probably some mistake in your code.
Robert
|
|
|
|
|
Robert, I don’t want say this but I have to say Check your Premise
|
|
|
|
|
Hi,
even after looking in a dictionary about premise I don't really get what you want to say. May be my mistake because english is not my native language. Could you reformulate?
Robert
|
|
|
|
|
bankai123 wrote: I can't do that with the Form_Closing event as it stills closes it.
You can. If the user doesn't want to close the form, assign true to the Cancel property of the passed CancelEventArgs instance.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|