|
hello,
done it!
when debugging i could see all the entries in IPGrant, the problem was converting the object array into a string array, i managed this with:
ExIpSecurity ipsec = new ExIpSecurity();
ipsec.BindToSmtpVsi(someSMTPserver, 1, "someDC");
ipsec.GetRelayIpList();
object[] o = (object[])ipsec.IPGrant;
string[] s = new string[o.Length];
Array arr = s;
o.CopyTo(arr, 0);
s = (string[])arr;
foreach (string i in s)
{
sw.WriteLine(i);
}
thanks for your help mate,
have a good weekend.
Phil
|
|
|
|
|
Hi all, can someone help with the following issue I'm having.
I am returning a dataset with a list of names of screen objects for a form.
I am trying to loop round the dataset, pick up the name then get the type of the control.
As follows...
foreach (DataRow row in dataSet_Groups.sp091_load_user_screen_components_layout.Rows)
{
strObjectName = Convert.ToString(row["ScreenObjectName"]);
strXMLText = Convert.ToString(row["XMLText"]);
intX = Convert.ToInt32(row["X"]);
intY = Convert.ToInt32(row["Y"]);
intWidth = Convert.ToInt32(row["Width"]);
intHeight = Convert.ToInt32(row["Weight"]);
intPosition = Convert.ToInt32(row["Position"]);
ctrlOnForm = frmToProcess.strObjectName;
switch (ctrlOnForm.GetType().FullName)
{
case "textEdit":
break;
}
}
frmToProcess is the form in question. How do I get the the value out of strObjectName and link it onto the the form name so I can check it's properties (see bold part in code). It's almost as if I need to perform Macro substitution (from my old FoxPro days)!
Sorry if my description is confusing.
Thanks.
|
|
|
|
|
this.Controls.Find(strObjectName, true);
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
|
Hi all, I need help
I have a IE toolbar menu button: Generate
My flow is
After i click the Generate button, the link on my current website will appear in a:
Form1 > textBoxWebPageURL
Form the Form1.Designer.cs
this.textBoxWebPageURL.Location = new System.Drawing.Point(238, 13);
this.textBoxWebPageURL.Name = "textBoxWebPageURL";
this.textBoxWebPageURL.Size = new System.Drawing.Size(328, 20);
this.textBoxWebPageURL.TabIndex = 5;
this.textBoxWebPageURL.Text = "http://www.codeproject.com"; <-- Whereby i have to hardcode it
How do i make it auto capture the current website that i am browsing and the textbox will display the current website ?
Thank You
|
|
|
|
|
Hi, Here is below code as i am trying to populate two combobox for different values but getting OledbException while running:
I have two tables called
Packing and Products
Packing=id,name
Products:id,prodname,price,packing [defined by number]
I have setup relation between them in MSAccess which is done..
Product.Packing=Number
Packing.PackingName=Text
Code:
private void Form1_Load(object sender, EventArgs e)
{
string sql ="SELECT distinct ProductName FROM Products";
string sql2 = "SELECT pac.PackingName FROM Products prod,Packing pac where prod.Packing=pac.PackingName ";
DataSet ds=new DataSet();
try
{
database = new OleDbConnection(connectionString);
database.Open();
}
catch (Exception x)
{
MessageBox.Show(x.Message);
}
OleDbDataAdapter adp=new OleDbDataAdapter(sql,database);
adp = new OleDbDataAdapter(sql2,database);
adp.Fill(ds,"ProductName");
adp.Fill(ds,"PackingName");
foreach (DataRow dr in ds.Tables[0].Rows)
{
comboBox3.Items.Add(dr[0].ToString()) ;
comboBox1.Items.Add(dr[1].ToString());
}
}
Any help please...Thanks,
|
|
|
|
|
shah123 wrote: OleDbDataAdapter adp=new OleDbDataAdapter(sql,database); adp = new OleDbDataAdapter(sql2,database);
you are using the same data adapter for box queries. Is this what you want to do?
You need to process the first data adapter before reusing it or use different data adapter, even better, refactor your code and call it as many times as you want, for example
FillComboBox(comboBox, sql)
{
DataSet ds = new DataSet();
try
{
database = new OleDbConnection(connectionString);
database.Open();
OleDbDataAdapter adp = new OleDbDataAdapter(sql, database);
adp.Fill(ds, "tableName");
foreach (DataRow dr in ds.Tables[0].Rows)
{
comboBox.Items.Add(dr[0].ToString());
}
}
catch (Exception x)
{
MessageBox.Show(x.Message);
}
}
Yusuf
|
|
|
|
|
Thanks Yusuf, But i have one different issue then just oledb exception...
I have two tables
Products=ProdId,ProdName,Price,Packing(Number as datatype)
Packing=packingId,PackingName (Text as datatype)
Now below code is in C# ..first check pls if "sql2" is correct query and then
when i execute an application i get an error "Expression Mismatch" on line:
adp.Fill(ds,"PackingName");
Thanks,
regards,
|
|
|
|
|
I got the solution of how to tackle and did it by doing SQL query again to be bit corrected..and now no exception...
private void Form1_Load(object sender, EventArgs e)
{
string sql ="SELECT distinct ProductName FROM Products";
string sql2 = "SELECT DISTINCT Packing.PackingName FROM Packing INNER JOIN Products ON Packing.PackingID=Products.Packing";
DataSet ds=new DataSet();
try
{
database = new OleDbConnection(connectionString);
database.Open();
}
catch (Exception x)
{
MessageBox.Show(x.Message);
}
OleDbDataAdapter adp = new OleDbDataAdapter(sql, database);
adp.Fill(ds, "ProductName");
adp = new OleDbDataAdapter(sql2, database);
adp.Fill(ds,"PackingName");
foreach (DataRow dr in ds.Tables[0].Rows)
{
comboBox3.Items.Add(dr[0].ToString()) ;
comboBox1.Items.Add(dr[1].ToString());
}
But now in combobox1 i get the same values as in combobox3?
I think so pb in foreach loop?
Any advise please...
|
|
|
|
|
Hi,
I have a problem with connecting Lotus Notes via OLE. The connector itself is working and I can generate an E-Mail. But I cannot access the property ConvertMIME.
I have played around a little bit and found out:
Type NotesSessionType = Type.GetTypeFromProgID("Notes.NotesSession");
object NotesSession = Activator.CreateInstance(NotesSessionType);
bool obj = (bool)NotesSessionType.InvokeMember("ConvertMIME", BindingFlags.DeclaredOnly | BindingFlags.Public | BindingFlags.NonPublic |
BindingFlags.Instance | BindingFlags.GetProperty, null, NotesSession, null);
Works fine. But:
NotesSessionType.InvokeMember("ConvertMIME", BindingFlags.DeclaredOnly | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.SetProperty, null, NotesSession, new object[] {false});
Crashes with „TargetInvocationException“. HRESULT: 0x8000FFFF (E_UNEXPECTED). What I’m doing wrong?
|
|
|
|
|
Hi folks,
it seems to be a serious problem. I would like to thank all peoples who read the thread and thinking about it. I have solved this issue with a VB.DLL I wrote and call in C#. If you have another suggestion please post.
Regards
gremgiz
|
|
|
|
|
Hi
i'm looking for some tips and tricks about how to insert into relational data (Master/Detail) at the same time.
for example, user want to create new Customer, open Customer form to set it's values and insert some Orders for that Customer (which did not inserted into database yet) in Orders section, then save all together at the same time to database.
can anybody help me and has experience for this issue ?
thanks
|
|
|
|
|
A transaction could be used to wrap both insert statements into an atomic operation that would "behave" like a single statement.
I are troll
|
|
|
|
|
Thanks Eddy
I know this which run these operations under a single transaction, but my problem is that how to insert foreign key (from Customers) in to order record (because new customer has not been inserted yet, hence it does not a valid Primary key). i'm looking for some tips and tricks about this operation.
|
|
|
|
|
I think I don't understand exactly what you want/need. Would this help, or am I missing something in your question?
BEGIN TRANSACTION
INSERT INTO Customers (CustName) VALUES ('John') -- Id field is identity, and therefore not named in the fieldlist.
DECLARE @custId AS BIGINT
SELECT @custId = @@IDENTITY -- put new custId key into "@custId" var
INSERT INTO ORDER (OrderId, CustomerId) VALUES (1, @custId)
COMMIT TRANSACTION
I are troll
|
|
|
|
|
Thanks Eddy
I want almost this, but it's good for a one Order. how to do that for multiple Order at the same time ?
Note(Guide) : i want to iterate in Orders dataTable and insert each order into database.
|
|
|
|
|
It's good for an employee and an order. You can put as many SQL-statements in there as you want, SQL Server will keep treating them like an atomic operation
Put the start-transaction and the identity-retrieve statements in a string, and concatenate insert-statements for each order. When done, add the commit-transaction statement (or a rollback in case of error) and execute the string.
I are troll
|
|
|
|
|
Thanks again Eddy
It's good, but i have problem to pass dataTable to stored procedure withing a single transaction.
|
|
|
|
|
What you need to do is that after installing the customer. Fetch the customer id..
And then you can make an overloaded method to save an order where you provide the customerid..
And in that method code it in such a way that the customer id given differently is used and not on the table of orders. .
|
|
|
|
|
i am adding one custom property to textbox.when i click on this item i need to show one form (like popup window).and this form having one textbox and one button..after entering the text in textbox and click on ok button.i need to display the text in this custom property item..
please any one help me.
|
|
|
|
|
set ReadOnly(true) and Browsable(true)
|
|
|
|
|
Oh, man, please do not post duplicated question here. Nobody like this!
I Love KongFu~
|
|
|
|
|
Hi ,
i have a strange requirement...ie
i have an EXE in the website folder under IIS in server...and
i can access that exe from client thru url...
but i need to run that exe(which is in server) in client thru a dialog based application ie on buttonclick i need to run the exe in client...
what i did is on buttonclick event im trying to run cmd in the background in which im sending the parameters--> iexplore http://machinename/websitename/my.exe" when i run this im able to run the exe in client but IE browser is opening ....i do"nt want to display IE browser but the exe should run...(if this is not a better way pls let me know how can i run exe from server in client or i need to copy exe from server and paste in client and i run the exe without using server login credentials...)...
|
|
|
|
|
Using the following code you can download the exe in a local folder and then execute it:
System.Net.WebRequest request = System.Net.WebRequest.Create(remoteExe);
using (System.Net.WebResponse response = request.GetResponse())
{
using (System.IO.Stream stream = response.GetResponseStream())
{
byte[] content = new byte[response.ContentLength];
stream.Read(content, 0, content.Length);
System.IO.File.WriteAllBytes(localExe, content);
}
}
System.Diagnostics.Process.Start(localExe);
modified on Thursday, March 5, 2009 10:45 AM
|
|
|
|
|
thanks for this sample, it works.
But I have a problem. When I try to execute the copied .exe it doens't work.
File has same size..
What migth be wrong?
|
|
|
|