|
It's possible if your code was written in unmanaged C++, but not VB.NET or C#. This is because the .NET Framework doesn't support the exports and static linking required to do something called "DLL injection".
This would be required because your code would have to become part of a foreign process so it can respond to another applications Paint events so the button gets repainted when necessary and respond to the clicks on the button.
|
|
|
|
|
Hi heroes,
I have a windows service(written in VB.Net) that runs a Shell command to execute a batch file, that was working fine on windows 2000 server, after migrating to Windows 2003 server, I get no errors regarding the execution of the shell command but the batch file doesn't do its job at all(as if it was not run).
on the other hand, if I run the bat file manually it works fine.
I tried to use Process class of the .Net but the same applies.
Also, the windows service runs in the context of System account that has all the rights granted.
What would be wrong? Please help
ThaScorpion
|
|
|
|
|
Verify the account that's being used by the Service. Make sure it's running. (I know - duh!, you'd be surprised...)
What apps does this batch file run? Do those apps require rights to certain resources to do their job? No - the Local System account does NOT give your service God rights over the entire system.
Change the batch file to log everything that would normally go to the console to a file:
somecommand param1 param2 > C:\batch.log
someothercommand >> C:\batch.log
The first line creates a new file in the root of C:, overwriting any file with the same name. The second line, with the two > characters appends to an existing file. Check this file for any errors that come up.
|
|
|
|
|
Thank you for replying so quick.
What do you mean by making sure that the System account is running ?
if I understand you mean the Windows service is running?, yes it is, it logs everything it does. Only the batch file doesn't or the EXE doesn't execute.
The batch file runs an EXE with some parameters.
ThaScorpion
|
|
|
|
|
ThaScorpion wrote: What do you mean by making sure that the System account is running ?
if I understand you mean the Windows service is running?,
Not the account, the service. Verify that the service IS running and that it's running under the proper account.
ThaScorpion wrote: Only the batch file doesn't or the EXE doesn't execute.
Change the batch file to log any output to a file, like I showed you.
|
|
|
|
|
I can write vietname unicode , SQL spend nvarchar nung i don't vietnames. I help me
|
|
|
|
|
Uhhh....What?
|
|
|
|
|
hi
Hello,Everyone .That really is have no way,so ask everyone to help me, I want to write a procedure that can carry on speech chat to come out with the vb.net, but a little data has no, i listened to other people say directx sdk can, check to check data also without result, and there is also no vb.net example of the speech in directx, I have already canned cross nat to carry on writing news to send out through an udp currently, the nether problem is to carry on a speech to collect, compress, packing with send out.but I a little data finds out, so i hope that that every superior elder generation a webmaster to help me, thanking a lot.
|
|
|
|
|
|
My guess is that our friend has used a web service or dictionary to translate his question into english.
Could he mean something like this:
Harddream wrote: That really is have no way,so ask everyone to help me
I couldn't find any way myself so now I am asking anyone to help me.
Harddream wrote: I want to write a procedure that can carry on speech chat to come out with the vb.net, but a little data has no
I want to write an application that turns speech (audio) into written text (or the other way around?), with VB.NET, but have not found a lot of information on the subject.
Harddream wrote: i listened to other people say directx sdk can, check to check data also without result, and there is also no vb.net example of the speech in directx
I heard other people talk about using the directX sdk to do it, and checked up on that, but could not find anything. I also did not find any examples of handling speech with directX.
Harddream wrote: I have already canned cross nat to carry on writing news to send out through an udp currently
I have searched the internet for current articles about sending data through a udp.
Harddream wrote: the nether problem is to carry on a speech to collect, compress, packing with send out
The basic problem is to collect continuous data from speech, pack, compress and send it (somewhere?)
Harddream wrote: but I a little data finds out, so i hope that that every superior elder generation a webmaster to help me, thanking a lot.
But I have found very little information, so if any more experienced coder might be able to help me, I would be really grateful.
As you Colin are a "superior elder generation a webmaster" perhaps you can help this guy out? I am pretty good with translating pig-latin, but haven't got the foggiest about speech-to-text and vice versa.
Regards,
Johan
My advice is free, and you may get what you paid for.
|
|
|
|
|
Hi all
I've created a ASP.NET/VB.NET application to maintain a database via a datagrid and was looking to retrieve the Windows username of the current user of the application so that when they click to update any changes they make, a field in the database will update showing that user as the last person to update that record.
I've set the authentication to 'windows' in the webconfig file, could anyone point me to the code I would need to retrieve the windows username?
Many Thanks
Rob
|
|
|
|
|
This is better asked in the ASP.NET Forum. I don't see how you're going to get the username from the client without some kind of authentication on the client side and sending that information to the server, possibly storing it in the session object.
But, that's about as far as my very limited ASP.NET experience will take me on this one.
|
|
|
|
|
Will do, thanks for the reply Dave.
Rob
|
|
|
|
|
HttpContext.Current.User.Identity.Name.ToString() returns the domain and username seperated by a slash. The following will get the username.
Dim UserName as String
Dim UserLoginDomainAndID as string[]
UserLoginDomainAndID = HttpContext.Current.User.Identity.Name.ToString().Split(new char [] {'\\'})
UserName = UserLoginDomainAndID[UserLoginDomainAndID.Length-1]
I converted this from my c# code so appoligies if it's not quite vb.net, but it should be close.
Oh and I used this on an asp.net site that did windows authentication. Unauthenticated this will give you nothing. Not certain what would be returned under other authentication.
topcoderjax - Remember, Google is your friend.
|
|
|
|
|
Hi Everyone:
I still have a nagging problem when it comes to using DataSets.
When I add new records to a dataset that contains nothing but the table’s schema, the dataset starts the auto increment field primary key field off at zero instead of one. I’m using an article titled “How to update a database from a DataSet object using Visual Basic NET”, to help me understand how to use datasets for data manipulation.
The article states, “To access primary key information, call FillSchema, and then set the MissingSchemaAction property of your DataAdapter to AddWithKey, or manually set the primary key in your code.”
I have done this and here is my problem.
When I add new records to an empty dataset, before I update the database the records look like this
0 Record 1
1 Record 2
2 Record 3
3 Record 4
As long as I don’t use the navigation buttons to move back to other records. I can save the DataSet to the database and it will look like this:
1 Record 1
2 Record 2
3 Record 3
4 Record 4
Now I’m going to show you where the monkey wrench comes into play. I load the dataset from the database. The dataset that is returned looks like this:
1 Record 1
2 Record 2
3 Record 3
4 Record 4
If I add a new record to the dataset like:
1 Record 1
2 Record 2
3 Record 3
4 Record 4
0 Record 5
I go back to another record to perform an edit and the dataset looks like this:
1 Record 1
2 Record 2
3 RECORD 3 <edit performed="" on="" this="" record="">
4 <blank>
0 Record 5
If I commit the changes made on the DataSet to the database, both addition and edited record. The database table changes to this:
1 Record 1
2 Record 2
3 RECORD 3
4 <blank>
5 Record 5
I don't understand why this is occuring. The dataset is based on the table schema, so logically it should know the first column is the primary key column and the primary key column is auto incremented. It starts at one and increments by one every time we add a new record.
To me it looks like the DataSet doesn't know that when I add a new record to the dataset to take the ID number of the last record and increment it by one to get the next primary key number. The DataSet also doesn't seem to append the new record at the end of the dataset. In other words advance to the end of the dataset, add the new record with the new ID number and so forth.
Why is this happening and what can I do to fix it?
Thanks,
Quecumber256
|
|
|
|
|
There is nothing to fix. You just have to realise that there is a difference between the key values in the database, and the key values that the dataset uses to identify the records before they have been added to the database.
The dataset could use a method to create key values that is more like the method that the database uses, but that would only mean that the values would end up the same more often, but not always. There is no telling what the key value will be in the database until you have actually added the record to the database.
Also, the key field doesn't always increment by one. It can be set to start at any value and increment by any value, or even pick a random number.
---
single minded; short sighted; long gone;
|
|
|
|
|
I'm binding textbox controls on a form to a dataset.
So what you are telling me is; I can only do one operation at a time using a dataset. If the database table is empty, then the dataset generated for this table can only have records added.
If I genenerate a dataset from a table that contains existing records I can only do one operation; either edit records or add records. I can't add new records and then use the navigation buttons on the BindingNavigator control to go to other records that need to be edited.
If this is the nature of the ADO.NET methodology then I'll have to disable the navigation buttons when the user selects add new records, and the reverse of this is to disable the ability to add records when in edit mode.
Am I right is my assumption?
Thanks
Quecumber256
|
|
|
|
|
Quecumber256 wrote: So what you are telling me is; I can only do one operation at a time using a dataset.
No. That's no what he said. A DataSet, or DataTable, can hanve multiple operations at the same time.
But, when records are added to the DataSet, the PK fields will get temporary values since the dataSet has no way of knowing what the next available key value should be. When the DataSet is finally written back to the database, the database will assign a new PK value, not the DataSet.
|
|
|
|
|
I think I have found the glitch. When a user is moving through the dataset the current position pointer is at the record the user is editing. If the user chooses to add a new record it will add a new record at the current position; underneath the record that was just edited.
Here is a sample of what happened when I edited and added records in one operation and then updated the dataset.
TableName: tblBindings
7 TST2 7 2nd Test Record Added to Existing DS
11 14
12 TST7 12 Record 7
13 TST8 13 Record 8
14 TST9 14 Record 9
15 TST2 7 2nd Test Record Edited to Existing DS
Is there a way to force the record pointer in the dataset to go to the end of the dataset, and after it is at the end of the dataset then append the new record onto the dataset?
Thanks,
Quecumber256
|
|
|
|
|
No. The DataSet, nor any database, doesn't care about the order of records. Sorting is best left up to the UI, not the data layer.
|
|
|
|
|
On the UI form I bound the four textboxes to the four columns in the dataset.
txtID is bound to RecID, txtOrdinal is bound to column Ordinal, txtCode is bound to column Code, and txtName is bound to column Name. This way when I navigate through the dataset I know which record I'm looking at.
I read an artical this morning about setting the DataSet Autoincrement to -1 and 0. This is suppose to insure that the ID#'s differ between records added and records that were retrieve from the database.
If I add new records using a negitive auto increment and records that are read into the dataset from a database will have positive increments it should take care of my overwrite and record disjunction problems.
Thanks,
Quecumber256
|
|
|
|
|
i create a crystal report with a dataset.
dataset depends on selection of fields.
i try to show these selected fields on report
how i do it
as i place fields at design time
i try to bind than i got blank space in between.
how i remove it
plz tell me.
ajeet
|
|
|
|
|
Crystal Reports requires a Typed Dataset which, i believe, means you cannot do what you want.
Steve Jowett
-------------------------
Sometimes a man who deserves to be looked down upon because he is a fool, is only despised only because he is an 'I.T. Consultant'
|
|
|
|
|
Hi Ajeet, Try this one
add a form & place a crystalReportViewer control on this form
Dim ob As CrystalSmallLabel = New CrystalSmallLabel
'CrystalSmallLabel is crystal report
Dim ds As New DataSet
Dim da As New OleDbDataAdapter
Dim str As String
str = "select * from label where id=" & id & ";"
mdGlobal.myconnectionOpen() 'mdglobal is module which contain
'procedure to build connection string
da = New OleDbDataAdapter(str, mdGlobal.conn)
da.Fill(ds)
ob.SetDataSource(ds.Tables(0))
CrystalReportViewer1.ReportSource = ob
'CrystalReportViewer1 is CrystalReportViewer control
Me.Show() ' me is the form which contain CrystalReportViewer control
ob.PrintToPrinter(NoOfCopy, False, 0, 0)
'if want direct printing to printer then use above statement
End If
hope this helps
Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)
|
|
|
|
|
Hi,
Please tell me how to allocate memory using Marshal.AllocHGlobal in VB. I am very new to this VB. I am using the code as follows.
Dim returnValue As Long
returnValue = Marshal.AllocHGlobal(250)
But, it's giving the error at run time saying that "Object required".
Can any body please address this issue? If possible please give me the sample piece of code.
Thanks in advance,
AR Reddy
|
|
|
|
|