|
Hi,
Actully I'm facing the same problem you've got! I think the domain paramter must take the name of the PC the file is in, not the name of domain or DC. This has nothing to do with Server! it's about connecting to a file in a PC, I thinks this is it!!
If you found the solution for that please send me it:
rami@raypub.com
|
|
|
|
|
Hi,
did you get a solution for this issue?
Jassim Rahma
|
|
|
|
|
No, not yet...
I'm using know a very stupid way: net.exe!!
|
|
|
|
|
I'm use an OleDbDataReader variable for get data from OLAP cube. I want show this data to DataGrid control, but I don't know a way. Can you help me?
Thanks.
|
|
|
|
|
here's an example of adding data from a database to a datagrid ( using an OleDbConnection )
VbCode:
<font color="blue">Private</font> <font color="blue">Sub</font> Button1_Click(<font color="blue">ByVal</font> sender <font color="blue">As</font> System.Object, <font color="blue">ByVal</font> e <font color="blue">As</font> System.EventArgs) <font color="blue">Handles</font> Button1.Click <br> <font color="blue">Dim</font> strConnection <font color="blue">As</font> <font color="blue">String</font> = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & "C:/bin.mdb" <br> <font color="blue">Dim</font> strCommand <font color="blue">As</font> <font color="blue">String</font> = "SELECT * FROM binFrm" <br> OpenAccess(strConnection, strCommand) <br> <font color="blue">End</font> <font color="blue">Sub</font> <br> <br> <font color="blue">Public</font> <font color="blue">Function</font> OpenAccess(<font color="blue">ByVal</font> strConn <font color="blue">As</font> <font color="blue">String</font>, <font color="blue">ByVal</font> strComm <font color="blue">As</font> <font color="blue">String</font>) <br> <font color="blue">Dim</font> DBCon <font color="blue">As</font> <font color="blue">New</font> OleDbConnection(strConn) <br> DBCon.Open() <br> <font color="blue">Dim</font> DBCommand <font color="blue">As</font> <font color="blue">New</font> OleDbCommand(strComm, DBCon) <br> <font color="blue">Dim</font> DBAdapt <font color="blue">As</font> OleDbDataAdapter <font color="DarkGreen"><br></font> DBAdapt = <font color="blue">New</font> OleDbDataAdapter(DBCommand) <br> <font color="blue">Dim</font> DBset <font color="blue">As</font> <font color="blue">New</font> DataSet() <br> DBAdapt.Fill(DBset, "binFrm") <br> DataGrid1.DataSource = DBset.Tables("binFrm") <font color="DarkGreen">'///add the tabel "binfrm" to the datagrid <br></font> DBCon.Close() <br> DBCommand.Dispose() <br> DBAdapt.Dispose() <br> DBset.Dispose() <br> <font color="blue">End</font> <font color="blue">Function</font> <br>
not sure if that's what your after , but hope it helps
Vb:
<font color="blue">Public Function</font> TwinsOnWay(<font color="blue">ByVal</font> twins <font color="blue">As String</font>) <font color="blue">As String <br> Select Case</font> twins<br> <font color="blue">Case</font> "Gender" <br> <font color="blue">Return</font> "Two Girls" <br> <font color="blue">End Select <br> End Function</font> <br>
|
|
|
|
|
oops that the vb.net version lol , i'll try to bung a C# version together
Vb:
<font color="blue">Public Function</font> TwinsOnWay(<font color="blue">ByVal</font> twins <font color="blue">As String</font>) <font color="blue">As String <br> Select Case</font> twins<br> <font color="blue">Case</font> "Gender" <br> <font color="blue">Return</font> "Two Girls" <br> <font color="blue">End Select <br> End Function</font> <br>
|
|
|
|
|
here ya go , this time in C# lol , hope it helps
VbCode:
<font color="#0000FF">private</font> <font color="blue">void</font> button1_Click(<font color="blue">object</font> sender, System.EventArgs e) <br> { <br> <font color="#0000FF">string</font> strConnection="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + "C:/bin.mdb"; <br> <font color="#0000FF">string</font> strCommand = "SELECT * FROM binFrm"; <br> OpenAccess(strConnection, strCommand); <br> } <br> <br> <font color="#0000FF">public</font> <font color="blue">void</font> OpenAccess(<font color="#0000FF">string</font> Connection, <font color="#0000FF">string</font> Command) <br> { <br> OleDbConnection DBCon=<font color="#0000FF">new </font>OleDbConnection(Connection); <br> DBCon.Open(); <br> OleDbCommand DBCommand=<font color="#0000FF">new</font> OleDbCommand(Command, DBCon); <br> OleDbDataAdapter DBAdapt=<font color="#0000FF">new</font> OleDbDataAdapter(DBCommand); <br> DataSet DBset=<font color="#0000FF">new</font> DataSet(); <br> DBAdapt.Fill(DBset, "binFrm"); <br> dataGrid1.DataSource=DBset.Tables["binFrm"]; <br> DBCon.Close(); <br> DBCommand.Dispose(); <br> DBAdapt.Dispose(); <br> DBset.Dispose(); <br> <br> } <br>
Vb:
<font color="blue">Public Function</font> TwinsOnWay(<font color="blue">ByVal</font> twins <font color="blue">As String</font>) <font color="blue">As String <br> Select Case</font> twins<br> <font color="blue">Case</font> "Gender" <br> <font color="blue">Return</font> "Two Girls" <br> <font color="blue">End Select <br> End Function</font> <br>
|
|
|
|
|
Hoang Dung, the following is not the best code on the globe but hope it gives you some ideas.
// construct table for Tasks grid and define columns
m_dtTasks = new DataTable("Tasks");
m_dtTasks.Columns.Add("Task Name", typeof(string));
m_dtTasks.Columns.Add("Frame Maker Location", typeof(string));
m_dtTasks.Columns.Add("Approved", typeof(string));
m_dtTasks.Columns.Add("Approval Cycle", typeof(string));
OleDbCommand cmd = new OleDbCommand(sSelectQuery, conn); // have yr query & connection ready
OleDbDataReader reader = cmd.ExecuteReader(); // DataReader is now loaded with data
while(reader.Read())
{
nNumRowsAffected++;
Console.WriteLine("TaskName = " + reader.GetString(0));
sTaskName = reader.GetString(0); // TaskName
sFrameMakerLoc = reader.GetString(3); // FrameMakerLocation
sApproved = (reader.GetBoolean(11) ? "Y" : "N"); // Status
sApprovalCycle = reader.GetString(12); // Approval_Cycle
// construct a new data row
drTask = dtTasks.NewRow();
drTask["Task Name"] = sTaskName;
drTask["Frame Maker Location"] = sFrameMakerLoc;
drTask["Approved"] = sApproved;
drTask["Approval Cycle"] = sApprovalCycle;
// add new row to table
dtTasks.Rows.Add(drTask);
}
dgdTask.DataSource = dtTasks; // attach data source to grid
Hope it helps
Khang Nguyen
|
|
|
|
|
Class A
{
public event MyEventHandler DataChanged(A myClassA);
....
}
Class B:A
{
...
//Raising the DataChanged event in this child class leads to error saying
//DataChanged can only be on lefthand side of += or -=
DataChanged(this);
}
The problem I am encountering right now is my inability to raise the
DataChanged event within the child class (leads me to believe event
inheritance is not present in c# yet?). I remember reading VB.NET is
capable of event inheritance though.
Is there a nice work around to problem?
Thanks .
|
|
|
|
|
Normally how things are done is:
<font color="#008800">
public delegate void MyEventHandler(object sender, EventArgs e);
<font color="#008800">
Class A
{
<font color="#008800">
public event MyEventHandler DataChanged;
<font color="#008800">
protected void OnDataChanged(EventArgs e)
{
if(ElementMouseUp !=null)
ElementMouseUp(this, e);
}
....
}
"Blessed are the peacemakers, for they shall be called sons of God." - Jesus
"You must be the change you wish to see in the world." - Mahatma Gandhi
|
|
|
|
|
Hello,
I want to add Items (string-Variables) to a Combobox.
But running the application, a NullReferenceException is thrown.
"The Object is not set to an instance of an object" (something like this, I've the german SDK, sorry)
I fill the Combobox in the constructor of an selfmade Dialog:
public dlg_clickedOrtAuswahl(string[] liste, int anzahl)
{
for (int i = 0; i < anzahl; i++)
{
//filling the Combobox cb_Auswahl
this.cb_Auswahl.Items.add (liste[i]);
}
InitializeComponent();
}
What could be wrong?
I've tried it with a HashTable, but the same error accours, binding the hashtable to the combobox with cb_Auswahl.DataSource = myHashtable.
Thanks a lot, for your help.
Greetings
Torsch
|
|
|
|
|
The combobox is created in the InitializeComponent method, so you can't use it until after that method has been called.
Also, I assume anzahl is the length of the array; you could also use liste.Length .
James
"I despise the city and much prefer being where a traffic jam means a line-up at McDonald's"
Me when telling a friend why I wouldn't want to live with him
|
|
|
|
|
That there is no such thing as a "BitmapButton" class in .NET? Something that displays a bitmap but acts like a button--up, down, mouse over, has focus, ALT-[x] functionality?
Please, someone tell me I'm wrong.
(And don't point me to Button's Image member, because it doesn't work when using a manifest--no bitmap appears--and it the ImageAlign property does work right--bottom is top, and vice versa, left is right, and center doesn't).
Marc
Help! I'm an AI running around in someone's f*cked up universe simulator. Sensitivity and ethnic diversity means celebrating difference, not hiding from it. - Christian Graus Every line of code is a liability - Taka Muraoka Microsoft deliberately adds arbitrary layers of complexity to make it difficult to deliver Windows features on non-Windows platforms--Microsoft's "Halloween files"
|
|
|
|
|
|
And MouseDown, MouseUp, GotFocus, LostFocus, and I'm working on MouseEnter/MouseLeave, which doesn't seem to be working. I smell a short article. I can't believe there isn't a BitmapButton control on CP (I've looked, only thing I found was something using code valid only in one of the beta's).
leppie wrote:
PS: what is the point of this manifest thingamagik? I have never got it working properly (maybe I did, but didnt see the point).
It makes your GUI's look pretty. Like Microsoft's. Rounded buttons, etc. I guess if you have different skins, it adjusts your GUI to whatever skin the user has configured. Look at the first screenshot in http://www.codeproject.com/csharp/AAL-5A.asp[^]. Notice the radio button too. However, also notive that the tab pages have white tabs and grey backgrounds for their body. They can't even get that right.
Marc
Help! I'm an AI running around in someone's f*cked up universe simulator. Sensitivity and ethnic diversity means celebrating difference, not hiding from it. - Christian Graus Every line of code is a liability - Taka Muraoka Microsoft deliberately adds arbitrary layers of complexity to make it difficult to deliver Windows features on non-Windows platforms--Microsoft's "Halloween files"
|
|
|
|
|
Marc Clifton wrote:
I smell a short article
I think your right.
-Nick Parker
|
|
|
|
|
|
Marc Clifton wrote:
I smell a short article.
Good idea. There will also be a BitmapButton in the GUI Library.
"Blessed are the peacemakers, for they shall be called sons of God." - Jesus
"You must be the change you wish to see in the world." - Mahatma Gandhi
|
|
|
|
|
Marc Clifton wrote:
It makes your GUI's look pretty.
To make it more precise, it enables version 6.0 of the common controls library. This version is themes aware so it will make use any XP themes enabled on the end system.
Marc Clifton wrote:
However, also notive that the tab pages have white tabs and grey backgrounds for their body.
That is a bug in .NET WinForms, I can't remember if it was fixed in 1.1 or not though. This article, http://www.codeproject.com/cs/miscctrl/themedtabpage.asp[^]
describes the fix for it.
James
"I despise the city and much prefer being where a traffic jam means a line-up at McDonald's"
Me when telling a friend why I wouldn't want to live with him
|
|
|
|
|
Marc Clifton wrote:
I can't believe there isn't a BitmapButton control on CP
The CP UGLY Project should look at current controls(MFC) available in CP and convert them to .NET controls.
Few weeks back I was looking for same control and I was surprised by no BitmapButton control at CP. Thought of developing my own but I own VS.NET 2002 standard version.(which is missing lot of wizards) So I gave up the idea.
After googling for sometime I found this company which has some good controls and they are inexpensive too. But no BitmapButton control yet.
http://www.binarymission.co.uk/[^]
"...if you don't want to hear things that piss you off don't piss off other people. SIMPLE." - Steven Hicks This signature was created by "Code Project Quoter".
|
|
|
|
|
I'll have the article submitted in about 30 minutes.
Marc
Help! I'm an AI running around in someone's f*cked up universe simulator. Sensitivity and ethnic diversity means celebrating difference, not hiding from it. - Christian Graus Every line of code is a liability - Taka Muraoka Microsoft deliberately adds arbitrary layers of complexity to make it difficult to deliver Windows features on non-Windows platforms--Microsoft's "Halloween files"
|
|
|
|
|
Got it..
Man...that's quick...
"...if you don't want to hear things that piss you off don't piss off other people. SIMPLE." - Steven Hicks This signature was created by "Code Project Quoter".
|
|
|
|
|
I am trying to build a web service that downloads a file to my local directory.
I have the basics here but I just cannot get it to work, anybody know of any examples on this. Here is my code so far.
<code>
Dim l_oWR As WebRequest
Dim l_oWebResp As WebResponse
Dim l_oBR As BinaryReader
Dim l_oBW As BinaryWriter
Dim l_oStream As Stream
Dim bFile() As Byte
Dim l_iCnt As Long
Dim l_dtNow As DateTime = DateTime.Now
Dim l_sDir As String = l_dtNow.ToString("MMddyyyy")
Dim l_oDir As Directory
Dim l_sFile As String
Dim l_sCnnStr As String
Try
'download file
l_oWR = HttpWebRequest.Create("http://www.abc.com/abc.exe")
l_oWebResp = l_oWR.GetResponse()
l_oBR = New BinaryReader(l_oWebResp.GetResponseStream(), Encoding.ASCII)
l_iCnt = l_oWebResp.ContentLength
bFile = l_oBR.ReadBytes(CType(l_iCnt, Integer))
If Not System.IO.Directory.Exists("C:\ofac") Then
System.IO.Directory.CreateDirectory("C:\ofac")
End If
l_oStream = New FileStream("C:\ofac\t11sdall.exe", FileMode.Create, FileAccess.Write)
l_oBW = New BinaryWriter(l_oStream)
l_oBW.Write(bFile)
</code>
Thanks for any help here!
Jordan
|
|
|
|
|
|
VB. Wrong forum.
If you have help in C# that works too.
Thanks,
Jordan
|
|
|
|