|
Hey,
I'd like to know how I can drag and drop controls during runtime.
I am using Visual Studio 2005 --> Visual Basic.
Thanks,
--Zaegra--
|
|
|
|
|
What do you have difficulty with? Be more specific.
You need Mousedown-Event for the control you want to drag to start Drag&Drop, and DragOver- and DragDrop-Event for your control you want to drop that first control in. But I am sure you figured that out yourself.
"I love deadlines. I like the whooshing sound they make as they fly by." (DNA)
|
|
|
|
|
Hi All
I have created a DAL using datasource and added few function and it accept from and to Date. Then added a Report Viewer control to my Windows application. After that I added new item Report1.rdlc. Then I dragged field from Dataset on to Report1 and organized and set the Datasource .rdlc to the Report Viewer control after that I executed my application working fine. Now I decided to added two datetime parameter to my Report1 and added. When I try to run the .SetParameters it thrown error as 'An error occured during local report processing'
Could you please help me how to solve.
<code> Dim rsDataSource As New ReportDataSource("OT Applied Info", OverTimeEntryTable)
Me.Reports.ProcessingMode = Microsoft.Reporting.WinForms.ProcessingMode.Local
Me.Reports.LocalReport.EnableExternalImages = True
Me.Reports.LocalReport.ExecuteReportInCurrentAppDomain(System.Reflection.Assembly.GetExecutingAssembly().Evidence)
Me.Reports.LocalReport.DataSources.Clear()
Me.Reports.LocalReport.ReportEmbeddedResource = "OTApplied.rdlc"
Me.Reports.LocalReport.DataSources.Add(rsDataSource)
Dim params(0) As Microsoft.Reporting.WinForms.ReportParameter
params(0) = New Microsoft.Reporting.WinForms.ReportParameter("SDate", Format(CDate(dtpSDate.Text), "MM-dd-yy"), True)
params(1) = New Microsoft.Reporting.WinForms.ReportParameter("EDate", Format(CDate(dtpEDate.Text), "MM-dd-yy"), True)
Me.Reports.LocalReport.SetParameters(params)
Reports.LocalReport.DataSources.Add(rsDataSource)
Reports.Visible = True
Reports.LocalReport.Refresh()</code>
Thanks
Sonj<big></big><big></big>
|
|
|
|
|
Hi All,
No help from any one of them however I found that ReportEmbeddedResource is follows application name for example Me.Reports.LocalReport.ReportEmbeddedResource = "ReportProject.OTApplied.rdlc"
ReportProject is my Application Name.
- sonj
|
|
|
|
|
Good Morning All
i have the Following SQl Procedure
<br />
USE [ValRollClients]<br />
GO<br />
<br />
SET ANSI_NULLS ON<br />
GO<br />
SET QUOTED_IDENTIFIER ON<br />
GO<br />
ALTER Proc [dbo].[CheckExistance]<br />
(<br />
@username varchar(50),<br />
@OldPassword varchar(50),<br />
@OutRes int Output<br />
)<br />
as <br />
set @OutRes =(select count(*) FROM Login WHERE <br />
Username = @username And UPassword = @OldPassword)<br />
<br />
in my Query analyzer i test it like this
<br />
declare @OutRes varchar(5)<br />
Exec [CheckExistance] 'vuyiswa','5555',@OutRes Output<br />
select @OutRes <br />
<br />
if the User Exists it gives me "1" and if not "0"
and i use this Procedure from Vb like this
<br />
con = New SqlConnection(strcon)<br />
<br />
cmdselect = New SqlCommand<br />
<br />
cmdselect.CommandTimeout = 0<br />
<br />
cmdselect.CommandType = CommandType.StoredProcedure<br />
<br />
cmdselect.CommandText = "CheckExistance"<br />
<br />
cmdselect.Connection = con<br />
<br />
cmdselect.Parameters.Add("@username", "Username")<br />
<br />
cmdselect.Parameters.Add("@OldPassword", "strPassword")<br />
<br />
cmdselect.Parameters.Add("@OutRes", SqlDbType.Int)<br />
<br />
cmdselect.Parameters("@OutRes").Direction = ParameterDirection.Output<br />
<br />
Dim bolres As Boolean<br />
<br />
Dim intRes As Integer<br />
<br />
Try<br />
con.Open()<br />
<br />
<br />
intRes = cmdselect.ExecuteScalar()<br />
<br />
intRes = cmdselect.Parameters("@OutRes").Value<br />
<br />
<br />
Select Case intRes<br />
Case 1<br />
bolres = True<br />
Case 0<br />
bolres = False<br />
<br />
End Select<br />
con.Close()<br />
<br />
Catch ex As SqlClient.SqlException<br />
<br />
MsgBox(ex.Message)<br />
<br />
End Try<br />
<br />
Return bolres<br />
<br />
<br />
but my Boolean value will be false, that means it always brings "0"
what is the Problem
Thanks
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
The way I always do this, is to create the parameter so I have a variable that points to it, then set it's direction and finally add that parameter by passing in the variable. Then I check the value on the variable. not sure how that would make any difference, but my code always works.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi Chris
i did that, ok, i have change this line to be like this
<br />
<br />
cmdselect.ExecuteNonQuery()<br />
<br />
intRes = cmdselect.Parameters("@OutRes").Value<br />
<br />
As for my Stored Procedure will deliver me a value of "1" when a user is Found and
"0" when a user is not Found. and after this i pass the value returned by an OutPut variable to a integer variable and test it like this
<br />
Select Case intRes<br />
<br />
Case 1<br />
<br />
bolres = True<br />
<br />
Case 0<br />
<br />
bolres = False<br />
<br />
End Select<br />
<br />
now this will always give me "False", but My Procedure will give me "1" as its Supposed to be true.
I dont know whats wrong here
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
I guess you didn't understand me.
EIther way, it seems unlikely that what you wrote shouldn't work. Have you stepped through, grabbed the values being passed in, passed them to the stored proc, confirmed your code is connecting to the same database, and still got a different result ? Are you sure your proc sets the value of outres, and just just return 1 or 0 ?
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi Chris
thanks again for your reply, again i have not assign values to my parameters. for me to Fix this i had to do the following
<br />
<br />
<br />
cmdselect.Parameters.Add("@username", "Username").Value = Username<br />
<br />
cmdselect.Parameters.Add("@OldPassword", "strPassword").Value = strPassword<br />
<br />
i was Supprised, how did i not see this
Thanks
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
Vuyiswa wrote: Select Case intRes
Case 1
bolres = True
Case 0
bolres = False
End Select
Your code is always falling through to the latter case. Either add a break statement after bolres = true or use an if...else construct rather than a select case
|
|
|
|
|
I didn't spot that, b/c C# does not allow that and I assumed VB did the same ( but perhaps more sensibly didn't have a break keyword, if it always works that way anyhow )
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
I was already developed crysatal report but i need how query pass to crystal report.now i am using vb.net and oracle
parthiban
|
|
|
|
|
Dear Friends..
I am having login screen form in my VB.Net windows application.I should be able to display that form only once in my PC.i.e i want to restrict multiple opening of the same login form.
I mean that only one instance of that form should be viewed in the screen.
Someone help in this regard as early as possible..
Regards,
Balaguru
|
|
|
|
|
Balagurunathan S wrote: Someone help in this regard as early as possible..
You can set a time limit when you're paying someone.
Do you mean you want your app to show only one login, or that you only want one instance of the app to run ? The former is entirely up to how you write the code, the latter, you can do a number of ways. Interestingly. when I did what all people in a hurry should do (try google), the first two hits were articles on this very site. Did you think to search the site or try google ?
http://www.google.com.au/search?sourceid=navclient&ie=UTF-8&rlz=1T4ADBS_enAU225AU226&q=vb%2enet+%22single+instance%22[^]
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
How can i change the icon of my Visual Basic exe file..
I tried to set the Icon Property of Form... But its
showing the Message Invalid Picture Property..
Can anybody plz help me
Thanx in Advance
|
|
|
|
|
in main menu project choose properties, there you can change the application's icon.
"I love deadlines. I like the whooshing sound they make as they fly by." (DNA)
|
|
|
|
|
hi friendz,
i hv a doubt in VB.Net
i hv a string as "jacab,martin"
i want to split it and assign it
in FirstName = jacab, SecondName = martin
i used "split" method, but for me it doesn't work,
is there anyother way t get my result?
self confidence+hard work=SUCCESS
|
|
|
|
|
Try this
Dim arNames() As String = Split("james,martin", ",")<br />
Dim sName As String = arNames(0)<br />
Dim fName As String = arNames(1)
|
|
|
|
|
THANKS A LOT,
THIS ALSO WORKIONG YAAR,
Dim memberName(2) As String
Dim memberLName As String
Dim memberFName As String
memberName = memberNameTextBox.Text.Split(“,”)
memberLName = memberName(0).Trim
memberFName memberName(1).Trim
self confidence+hard work=SUCCESS
|
|
|
|
|
Just a minor issue, this produces a 3 element array 0,1,2
Dim memberName(2) As String
This is not relevant to your current code but will trip you if you ever use memberName.lenght (which is 3 NOT 2)
|
|
|
|
|
Hi to all,
I am Developing to develop Client/Server Application using VB.NET 1.1
1)I want to see the Client Machines Performance and Networking details like what you get in windows Task manager using vb.net.
2) How to find the passives client. and From server I want to shout down these machines.
3.If any Illegal process started (Virus) the I want sent server to pop up alert Message for client machines.
Thanks
Mohan Balal
--------------
(Sr.Software Engineer)
|
|
|
|
|
Member 1258373 wrote: 1)I want to see the Client Machines Performance and Networking details like what you get in windows Task manager using vb.net.
This can be done using the Process class, Performance Counters, and WMI. If the remote machines are in a domain environment, then the account your code is running under should have the appropriate permissions to the remote machines. If in a workgroup configuration, then you'll have to supply an appropriate username and password for EACH machine you want to connect to to get this data.
Member 1258373 wrote: 2) How to find the passives client. and From server I want to shout down these machines.
What do you mean by "passive client"?? Shutting down machines remotely has it's issues, since you'll need admin rights to the machines. Also, forcing a shutdown without knowing what the machine, and it's users, are doing is a "data loss" concern. You don't know, and can't find out, what the machine is doing or waiting for.
Member 1258373 wrote: 3.If any Illegal process started (Virus) the I want sent server to pop up alert Message for client machines.
There is no way for you to know that any code is virus related. This is better left up to a professional, enterprise virus scanning package that reports back to a central server. You'll have to keep this virus software up-to-date on a daily basis. If you attempt to write this code youreself, you will be greatly disappointed in the amount of work you have to put in to maintain it and keep it updated with the latest techniques for getting bad code to run. This is something that a single person, such as yourself, simply cannot do due to the number of viruses discovered every day.
|
|
|
|
|
In Visual Basic .NET I know how to get the environment params (such as USERPROFILE) that gets assigned to a user when they're logged in on a given system. But how do you get those environment params for those users when another user (or the administrator) is logged in? A code snippet showing that would help out greatly.
As an added bonus, if you know of a way to query all the users who have an account on a local system I could use that. Thanks much.
|
|
|
|
|
Actually the added bonus is the easy one - look in the documents & settings folders and parse the folder names!
I think to get all the environment vars is not going to be possible (maybe one of the OS experts will be able to help). I think you would need to locate all the tags in the registry and every app that starts automatically on startup - impossible!
|
|
|
|
|
Hi everyone.
I'm trying to build a session enumeration for a asp.net site, meaning that i can see all live session and their objects of the session, at start i built a IList of httpsession that i add to it the session every time its created, the problem is that when the session has changed(like adding a new object to the session) the list is not updated with the changes it just stays like the same point when it was added. i need a linked collection that a can add objects to it but when the object change it should be seen in the collection too.
can anyone help please?
thanks.
|
|
|
|