|
Hmm... Well, ours is all on one domain. I wouldn't think it would require much different because of the domain controller communication. As long as it was an authenticated client on the domain (duh.. ..), I would think that it wouldn't matter which domain it was trying to communicate with. I myself am a bit flaky also, and as I said, it worked for us. You might try a little google grease with the extra knowledge you've presented to me, such as "DirectoryEntry use across domains" or something. I wish I could help more (and wish I knew more myself) so I could be of better help. Best of luck.
-Chris Potter
|
|
|
|
|
what kind of small projects that take priority in companies
in C# or ASP.NET
to show it in job interview
|
|
|
|
|
kifahhk wrote: what kind of small projects that take priority in companies
in C# or ASP.NET
to show it in job interview
CK-37.872
led mike
|
|
|
|
|
kifahhk wrote: what kind of small projects that take priority in companies in C# or ASP.NET
The kind of project that gets the business moving forward. Projects are not prioritised highly unless the business needs it (or rather the business "thinks" it needs it). In my experience companies often mis-prioritise projects then wonder what the brown stuff that's just got sprayed all over the walls is when the s**t hit the fan. (But you probably don't want to say that in an interview)
|
|
|
|
|
Hi, can anybody write steps to build an undo and redo functionality in C#. I checked couple of articles but they are all confusing.
I have a panel class that holds different items on panel. I want to store each panel in an arraylist/stack. So if user click on undo then just display that panel
Thanks
|
|
|
|
|
You basically have to implement the Memento design pattern.
Here is a helpful article:
http://www.codeproject.com/csharp/undoredobuffer.asp
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
I wanted to bind a collect to a DataGridView, but the objects in the collection are collections themselves. Ideally, I'd like the objects in the later collection to be displayed as rows in the table and I thought I might be able to do that using the ITypedList interface and a custom PropertyDescriptor class. I came up with something like this for my GetItemProperties implementation:
public PropertyDescriptorCollection GetItemProperties(PropertyDescriptor[] listAccessors)
{
PropertyDescriptor[] properties = new PropertyDescriptor[myCollection.Count];
for (int i = 0; i < myCollection.Count; i++)
{
properties[i] = new MyPropertyDescriptor(i.ToString(), i);
}
return new PropertyDescriptorCollection(properties);
}
MyPropertyDescriptor uses the index in the collection as a name for the property and also stores the index so I can recall the value.
Now to add a column to the collection in the DataGridView I do this:
design.Channels[0].Add(0);
DataGridViewTextBoxColumn dgvtbc = new DataGridViewTextBoxColumn();
dgvtbc.DataPropertyName = "0";
dgvtbc.HeaderText = "0";
dgvtbc.Name = "0";
dgvLevels.Columns.Add(dgvtbc);
This adds the column, but it doesn't appear to actually be bound to the data source because if I can the value in column 0, the corresponding item in the collection isn't changing. Does anybody have any idea if this can be made to work? Am I barking up the wrong tree?
Thanks
|
|
|
|
|
Hello,
I have an HtmlFile that is read into a string. I make some modificatons to the string, and now I want to convert a string to an HtmlDocument object.
Is there a way to go about it?
Thank you very much.
|
|
|
|
|
Hi Zaboboa,
This should do the trick:
Dim text as string = "any html"
Dim newDoc As New HtmlDocument
newDoc.LoadHtml(text)
Kind Regards
Julian Mummery
|
|
|
|
|
.Net framework doesn't provide a way to get an AppDomain based on its friendly name. One can get the current thread's AppDomain, but I would like to get an AppDomain based on just its friendly name. Has somebody tried it?
Any help is welcome.
|
|
|
|
|
i have a button and label in my webform and i want in OnClientClick event,change a label1.Text (in client Side by javaScript),I wrote this code :
<script language="javascript"><br />
function SetClientLabel()<br />
{<br />
document.getElementById("label1").value = "Value Chaned!";<br />
}<br />
</script>
but at runTime, when i Click on button, Nothing event Occured,Where is the Problem and how to solve it ?
Note : i want only change label.Text and don't need ajax or atlas or ...etc. i need java Code(if necessary) and Know how to do this.
Thanks.
|
|
|
|
|
Please try something like:
function SetClientLabel(str)
{
document.getElementById("label1").innerText = str;
}
|
|
|
|
|
Very Very thanks ..My Problem Has beed Solved.
but does any way for execute javaScript method for OnClick property of my button?
thanks.
|
|
|
|
|
Currently, I can easily drag items between DGV's. If I select multiple items by holding the CTRL button while I click, and on the last item, I initiate the drag without letting up the mouse, I am able to drag multiple items.
However, if I select the last item, let up the mouse button, and then put it back down again to grab the items and drag them, the DGV selects the item that was under the mouse click. I realize this is the expected behavior; does anyone know a way to override it so that my items remain selected?
Now, I have a workaround that involves keeping track of the selected items myself, and if the mouse goes up and backdown and a drag begins, to re-select those items. But it's a little bit messy and I would really like another way to do it.
Any thoughts?
|
|
|
|
|
This is a 2005 project under 2.0
I am using Enterprise Library 2006
I am making a Select Call which returns an IDataReader.
I have checked the object after being populated and it seems to contain the information I need.
I go to convert it to a DataSet and it only shows the last item.
here is my Convert to DataSet code, I've tried numerous of examples found on the web, each one only returns the last record:
<br />
public static DataSet ConvertDataReadertoDataSet(IDataReader reader)<br />
{<br />
DataSet ds = new DataSet();<br />
DataTable schema;<br />
DataTable data;<br />
int i = 0;<br />
DataRow dr;<br />
DataColumn dc;<br />
string columnName;<br />
bool dun = false;<br />
data = new DataTable();<br />
schema = reader.GetSchemaTable();<br />
<br />
do<br />
{<br />
if (schema != null)<br />
{<br />
for (i = 0; i <= schema.Rows.Count - 1; i++)<br />
{<br />
dr = schema.Rows[i];<br />
columnName = dr["ColumnName"].ToString();<br />
if (data.Columns.Contains(columnName))<br />
{<br />
columnName = columnName + "_" + i.ToString();<br />
}<br />
if (columnName == "ID")<br />
{<br />
System.Type typeInt32 = System.Type.GetType("System.Int32");<br />
<br />
dc = new DataColumn(columnName, typeInt32);<br />
}<br />
else<br />
{<br />
System.Type typeString = System.Type.GetType("System.String");<br />
<br />
dc = new DataColumn(columnName, typeString);<br />
}<br />
<br />
<br />
data.Columns.Add(dc);<br />
}<br />
<br />
<br />
ds.Tables.Add(data);<br />
<br />
while (reader.Read())<br />
{<br />
dr = data.NewRow();<br />
for (i = 0; i <= reader.FieldCount - 1; i++)<br />
{<br />
dr[i] = reader.GetValue(i);<br />
}<br />
data.Rows.Add(dr);<br />
}<br />
}<br />
else<br />
{<br />
dc = new DataColumn("RowsAffected");<br />
data.Columns.Add(dc);<br />
ds.Tables.Add(data);<br />
dr = data.NewRow();<br />
dr[0] = reader.RecordsAffected;<br />
data.Rows.Add(dr);<br />
}<br />
<br />
}while (reader.NextResult());<br />
<br />
reader.Close();<br />
<br />
return ds;<br />
}
I f10'd through it and it seems to only be doing the 'do/while' once, the NextResult() is not going to the last record because it seems like its already at the last record.
Any suggestions or examples of another way of doing it would be great.
it needs to return a DataSet with multiple records.
Thanks
Steve Welborn
Software Engineer
BitWise Solutions
|
|
|
|
|
NextResult moves the data reader on to the next result set, not the next row. Read moves the reader to the next row until it gets to the last row in the current result set.
|
|
|
|
|
Thank you for the reply. I found a way to work with the IDataReader that I am getting back so there is no need to convert it.
Appreciate the time on this though, enjoy your day.
Steve Welborn
Software Engineer
BitWise Solutions
|
|
|
|
|
I would like to create different versions of a program, but I'm not sure how to achieve that in VS2005. I've looked at configurations and conditional compilation, but I haven't found anything that works yet.
Here's what I would like to do:
I need three versions of a program:
Version 1
=========
* Contains a user interface for analysing data
* Contains code and a user control for talking
to an electric motor, also contains a dll
that does the low level communication with
the electric motor.
This version would be installed on computers that have the electric motor attached.
Version 2
=========
* Contains only the user interface for analysing
data
This version would be installed on computers that don't have the electric motor installed. They would therefore also not have the dll and not need the user control for talking to the motor.
Version 3
=========
* Contains a simplified user interface for displaying results of the analysis.
What's the best way to achieve having these separate versions?
Thanks for your help.
|
|
|
|
|
Why not have several project in the same solution. Each sharing the source code for the items each version needs.
|
|
|
|
|
Thanks for your answer.
The reason, why I would like to avoid it is this: When I add a new source file to one of the projects, I have to add it to all projects, in case it is needed there. That is fine with a small project, but this one will over time get rather large and I want to keep maintenance of different versions to a minimum.
|
|
|
|
|
Conditional compilation is for small changes between different versions of the same assembly - e.g. DEBUG vs. RELEASE or excluding some features in a compact framework build.
You should create separate libraries for each module of your program and create three .exe files that use the libraries required for that version.
|
|
|
|
|
i want code for authentication's to connect remote computer and accessing the files in remote computer. Code in C# with windows app if possible
this is haneef
|
|
|
|
|
What have you done so far?
|
|
|
|
|
the following code for backup a database stadard form of zip file.
it is working properly for c# with windows app but not C# with asp. why i don't know.
in c# with windows also one problem it is not connecting to remote server database.
using System.Data.SqlClient;
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using SQLDMO;
using System.IO;
using System.Diagnostics;
using Shell32;
using System.Xml;
using System.Security.Permissions;
using System.Configuration;
namespace backup1
{
///
/// Summary description for WebForm1.
///
public class WebForm1 : System.Web.UI.Page
{
protected System.Web.UI.WebControls.TextBox TextBox1;
protected System.Web.UI.WebControls.TextBox TextBox2;
protected System.Web.UI.WebControls.Label Label1;
protected System.Web.UI.WebControls.Label Label2;
protected System.Web.UI.WebControls.Label Label3;
protected System.Web.UI.WebControls.Label Label4;
protected System.Web.UI.WebControls.Button Button2;
protected System.Web.UI.WebControls.TextBox t1;
protected System.Web.UI.WebControls.TextBox t2;
protected System.Web.UI.WebControls.ListBox ListBox1;
protected System.Web.UI.WebControls.ListBox lb;
protected System.Web.UI.WebControls.Button Button1;
private void Page_Load(object sender, System.EventArgs e)
{
/*SQLDMO.Application oSQLServerDMOApp = new SQLDMO.Application();
SQLDMO.NameList oNameList;
oNameList = oSQLServerDMOApp.ListAvailableSQLServers();
for (int intIndex = 0; intIndex <= oNameList.Count - 1; intIndex++)
{
if (oNameList.Item(intIndex as object) != null)
{
lb.Items.Add(oNameList.Item(intIndex).ToString());
}
}
if (lb.Items.Count > 0)
lb.SelectedIndex = 0;
else
lb.Items.Add("(local)");*/
}
#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
}
///
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
///
private void InitializeComponent()
{
this.Button2.Click += new System.EventHandler(this.Button2_Click);
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
private void Button2_Click(object sender, System.EventArgs e)
{
string s="";
string con="";
string del2="";
string s1="";
string del1="";
int len1=0;
string k="";
string temp="";
string database1="";
string temp1="";
try
{
Login2Class s12=new Login2Class();
SQLServer2Class server = new SQLServer2Class();
Databases databases;
Database2 database;
Backup2Class backup = new Backup2Class();
//SqlConnection con11=new SqlConnection("user id=sa ; password=sa123; data source=192.168.1.6; database=pubs");
//con11.Open();
server.LoginSecure = true;
server.Connect("192.168.1.6" ,"administrator" ,"");
databases = server.Databases;
database1=t1.Text;
database = (Database2) databases.Item(database1, null);
backup.PercentCompleteNotification = 1;
backup.Database = database.Name;
int len=0;
s=TextBox2.Text;
if(s.ToUpper().EndsWith(".BAK") == true)
{
len1=s.Length;
s=s.Substring(0,len);
}
System.IO.Directory.CreateDirectory(s);
temp= System.IO.Directory.CreateDirectory(s).ToString();
s=s+"\\"+temp;
try
{
if(s.ToUpper().EndsWith(".BAK") == false)
{
s += ".bak";
}
del2=s;
backup.Files = s;
temp1=s;
backup.SQLBackup(server);
server.DisConnect();
backup = null;
server = null;
}//try
catch(Exception ex)
{
Response.Write(ex.ToString());
}
s1=s;
con="\\"+temp+".bak";
if(s1.EndsWith(con)==true)
{
len1=s1.IndexOf(con);
k=s1.Substring(0,len1);
}
con=temp+".bak";
if(s1.EndsWith(con)==true)
{
len1=s1.IndexOf(con);
s1=s1.Substring(0,len1-1);
}
del1=s1;
if(s.ToUpper().EndsWith(".ZIP") == false)
{
s1 += ".zip";
}
byte[] emptyzip = new byte[] {80,75,5,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
FileStream fs= File.Create(s1);
fs.Write(emptyzip, 0, emptyzip.Length);
fs.Flush();
fs.Close();
fs = null;
//Copy a folder and its contents into the newly created zip file
Shell32.ShellClass sc = new Shell32.ShellClass();
Shell32.Folder SrcFlder = sc.NameSpace(k);
Shell32.Folder DestFlder = sc.NameSpace(s1);
Shell32.FolderItems items = SrcFlder.Items();
DestFlder.CopyHere(items, 0);
int i=DestFlder.Items().Count;
while(items.Count >= i)
{
System.Threading.Thread.Sleep(1000);
}
System.Threading.Thread.Sleep(1000);
System.Threading.Thread.Sleep(1000);
System.Threading.Thread.Sleep(1000);
System.IO.File.Delete(del2);
System.IO.Directory.Delete(del1);
Response.Write("zip file created in location ::" + s1);
}//try
catch(System.Runtime.InteropServices.COMException ex)
{
Response.Write(ex.ToString());
}
catch(System.Exception ex)
{
Response.Write(ex.ToString());
}
}
}
}
this is haneef
|
|
|
|
|
I am having a tabcontrol.Tab pages are added to it dynamically.Tab pages are type of "Form". On that form i am dragging a control.On the drag over event i get the e.X & e.Y position (screen coordinates).When i convert to Client coordinates i dont get the exact dropped location for control.
Like 1 big rectangle(tab page) with embedded small rectangle(Form).When control is dragged in small rectangle(Form) i dont get exact location.When i drag control to 0,0 position of small rectangle(Form) i get some other value(42,136).
Can anyone help me.Thanks in advance.
|
|
|
|