|
There is no code. No code that's relevant anyhow. The core issue is the values of the buttons, which are set in the designer.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Just a wild guess, but do your OK and Cancel buttons have their DialogResult property set to DialogResult.OK and DialogResult.Cancel?
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
S. Senthil Kumar wrote:
Just a wild guess, but do your OK and Cancel buttons have their DialogResult property set to DialogResult.OK and DialogResult.Cancel?
No, sorry, I thought I said that. They are all set to (none).
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
hi could u please tell me how i can check my sql database to look for a stored procedure if exist or not, and if not exist how i can create it, please help me by code, i have to finish my project as soon as possible
Thanks alot
Hamody
|
|
|
|
|
Surely this should have gone in the SQL / ADO.NET forum.
The SQL code is:
IF NOT EXISTS (SELECT * FROM dbo.sysobjects
WHERE id = OBJECT_ID(N'[dbo].[StoredProcedureName]')
AND OBJECTPROPERTY(id, N'IsProcedure') = 1)
CREATE PROCEDURE ....
If you need to run this through a C# application just ExecuteNonQuery() on the SqlCommand like this:
SqlCommand cmd = new SqlCommand(sqlStatement, myConnection);
cmd.ExecuteNonQuery(); The above assumes that you already have a connection and it is open. The sqlStatement is a string that contains the completed contents of the SQL code above.
Does this help?
My: Blog | Photos
WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and More
|
|
|
|
|
ok thnaks, i found another way to check the existance of the procedure thw procedure id:
proc dbo.Showhierarchy
(
@index int
)
As
Begin
declare @FolderIndex int, @FolderName varchar(30)
set @FolderName = (select Name from pdbfolder where FolderIndex= @Index)
print replicate ('_', @@nestlevel *4) + @FolderName
set @FolderIndex = (select min(FolderIndex) from pdbfolder where parentfolderindex = @index)
while @FolderIndex is not null
begin
exec Showhierarchy @FolderIndex
set @FolderIndex = (select min (FolderIndex) from pdbfolder
where parentfolderindex =@index and FolderIndex > @FolderIndex)
End
End
....
so in the create satement that u emailed i write the above proc as it, and i need to get the two values which is printed @FolderIndex, @FolderName
note that it is a recurcive proc
could u send me the correctes code
Thanks alot
Hamody
|
|
|
|
|
Really, you should be creating stored procedures in advance of running your application - unless it is some sort of installation applicataion.
You are not going to get any data out of this in a C# application because there are no SELECT statements that return data out of the stored procedure. The only time you get print statements back is if an error occurs and the contents of any print statements is captured in the SqlException.
Anyway, to run a stored procedure this is the code you need in C#
SqlCommand cmd = new SqlCommand("Showhierarchy", myConnection);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add("@index", indexValue);
cmd.ExecuteReader();
My: Blog | Photos
WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and More
|
|
|
|
|
ok, when u execute it in the query analyzer u get a printed results i need them to be used in my code.
i don't know i think about inserting them in a table but the insert statement didn't execute in the proc that i sent to u ...
i don't know how to get these printed data ...
have u any idea
Thanks alot
Hamody
|
|
|
|
|
Hi
I have two projects and one of the project have internal methods which should be used in another project.. so i used friend assemly concept and was able to solve the problem partially... my problem is one of my projects have other refernced assemblies (third party also..) for which i dont have the code, which are not signed with a strong name. Now inorder to complete the process i have to sign the referenced assemblies as well.. How do i do that? Plz Help...
Regards
Deepak.S
|
|
|
|
|
If the assemblies have been delay signed then you can do it using the Strong Name Tool.
e.g.
sn.exe -R thirdparty.dll myKey.snk
|
|
|
|
|
|
I'm having a VERY hard time finding material I can read to understand this stuff. So far I got a program to evaluate mathematical equations and a basic Lexer that splits a string simply into a stack like so...
Example string - FunctionName ( "Param1" );
Stack[5]SEMICOLON
Stack[4]CLOSE_PAREN
Stack[3]"Param1"
Stack[2]OPEN_PAREN
Stack[1]FunctionName
Basically it tells me when it hits a special character, and after that it tells me what's inside it. I'm having a really hard time explaining this, a bunch of source is available here:
www.insolence9.com/downloads/SBN.zip
Thanks
|
|
|
|
|
Hi all
i need a bit help in saving images into mysql database through my C#.net application.I had converted the image into byte array but when i insert it or update the feild by an insert or update statement exception is thrown.
can anyone guide me pls
Thanks
Monica
|
|
|
|
|
First step in getting help in this situation is telling us WHAT exception is throw and what your code/database schema looks like.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Can u give me any article regrading saving images in mysql database .
The problem is when i try to insert this byte array through insert command to mysql table where the feild is a long blob to save that image this exception comes Out of scope. I donot know whether the way i am doing is right or not. but it saves the image in SQL server database not in mysql
What I am doing is converting the image from a picturebox in to a byte array and then trying to insert in the blob feild. I donot know it is write or wrong.if there is any other method pls tell me
thanks
Monica
|
|
|
|
|
|
hi I did the same thing which u suggested in that link but i am getting this exception
An unhandled exception of type 'System.Data.DBConcurrencyException' occurred in system.data.dll
Additional information: Concurrency violation: the UpdateCommand affected 0 records.
my code is like this
The table is tblPatientMaster with feilds one PatPhoto thats is long Blob and one patientId that is a bigint.
public static void UpdatePatientPhoto( long PatID,ref byte[] content )
{
DataRow PatRow;
String ConnectionString =
System.Configuration.ConfigurationSettings.AppSettings["DSN"];
String query= "Select* from tblpatientmaster where patientId = " +
PatID ;
OdbcConnection myConnection = new OdbcConnection(ConnectionString);
myConnection.Open();
OdbcDataAdapter myAdapter=new OdbcDataAdapter(query,myConnection);
DataSet ds= new DataSet("tblpatientmaster");
myAdapter.UpdateCommand = new OdbcCommand
("UPDATE tblpatientmaster SET " +
"PatPhoto = @iPHOTO " +
"WHERE patientId = @iPatNo", myConnection);
myAdapter.UpdateCommand.Parameters.Add("@iPHOTO", OdbcType.Binary,
content.Length, "patphoto");
myAdapter.UpdateCommand.Parameters.Add("@iPatNo", OdbcType.BigInt,
0, "patientId");
myAdapter.MissingSchemaAction = MissingSchemaAction.AddWithKey;
myAdapter.FillSchema(ds, SchemaType.Source, "tblpatientmaster");
myAdapter.Fill(ds,"tblpatientmaster");
DataTable PatTable = ds.Tables["tblpatientmaster"];
PatRow = PatTable.Rows.Find(PatID);
PatRow.BeginEdit();
if (content.Length != 0)
{
PatRow["PatPhoto"] = content;
}
PatRow.EndEdit();
myAdapter.Update(ds,"tblpatientmaster");
}
Pls anybody can help me with this problem.
Thanks
Monica
|
|
|
|
|
Relatively new to Web Apps (I've used them before, but was just reusing code, not creating). What I need is to display data read from a database in the following manner:
Header Header2 Header3
Item1 Item4 Item7
Item2 Item5 Item8
Item3 Item6
So basically 8 items will be read from a database, and it will group the items based on the common Header property. When it has displayed 3 I want it to go to the next line. Any advice?
|
|
|
|
|
Yeah, a repeater will give you the control you need here. Although, if it were me, I'd make things easier by writing a stored procedure that created three columns so that the presentation tier didn't need to worry about anything but displaying it.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I just realize it too out the spacing I put in, so it may be a bit deceiving. What I am getting is 8 items from a DB with a Category attribute. So say the result would be something like:
Name1 | Category1
Name2 | Category1
Name3 | Category2
Name4 | Category3
Name5 | Category3
And so on. Can I still do this with the repeater?
|
|
|
|
|
Oh, I see. You can still do it with a repeater, you could do it by creating three tables, one for each category, and then binding the dataset to the repeater and accessing the three tables in the data items for the three rows.
I still lean towards a stored procedure that returns one table with three rows, based on category. Then the presentation layer is easy, as it should be.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I am writing a tool in .Net to display all group policy available in a domain and all application added to each policy. I am able to display all policy available in the domain but I cannot display the application assigned in the domain through the policy.
Can you please help me to display software names and other properties using vb.net or c#.net
Thanks,
Ram
|
|
|
|
|
How do you start another application from a C# program
|
|
|
|
|
Process.Start, from memory.
Yep[^], that's the one.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I want my Internet cafe solution has a firewall embedded within, how can I do that? is there any dll that I can use?
Thank you
|
|
|
|