|
Harshi_ wrote: becoz dont have much knowledge about vb.net
Yes, it sounds like you shouldn't be attempting this task at this stage, you should learn some core stuff first.
You create a combo box, and each item has a value property, set that to the Id of the department whose name it shows. Catch the selected index changed event. Grab that Id, stuff it into a proc that returns the data for that department and databind the returned table to your grid.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
hi
I am new in vb.net and i have a problem with writing line number,
I want to write file line number
for ex.
1,abcd
2,abck
3,abcd
4,abcd
some thing like this
so when ever user click btnwrite it's write text and line number it self
this is what i have done but it's not doing any thing
this code is in button click event
FileOpen(1, AppPath() + "INK.CSV", OpenMode.Append)<br />
Dim LN, LineNo As Integer<br />
For LN = 1 To LineNo<br />
WriteLine(1, LN, txtText.text)<br />
Next LN<br />
FileClose(1)
so i dont know what to do
any help
waiting for your kind help
|
|
|
|
|
Well, for starters, don't use the nasty VB shortcuts, use the proper .NET methods which also work in C#. Otherwise, you're making it impossible to ever use C#, for no good reason.
FileOpen = BAD
File.Open = GOOD
bapu2889 wrote: Dim LN, LineNo As Integer
For LN = 1 To LineNo
LineNo does not have a value, and therefore defaults to 0. Counting from 1 to 0, involves no iterations of the loop.
bapu2889 wrote: but it's not doing any thing
That's not really true, I'd expect this code to create an empty file. You should set breakpoints in your code and step through to see why things don't work, and you should give more detailed explanations of issues when you post questions, it helps people to help you.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
hello sir
thank you very much for your help
thanks a lot
|
|
|
|
|
you can try this :
<br />
imports System.IO<br />
imports System.Text<br />
<br />
Dim fr As New StreamReader("C:\\a.txt") 'Create StreamReader object<br />
Dim str As New StringBuilder 'Create StringBuilder object<br />
Dim count As Integer = 0 'Create count for writing line<br />
<br />
While (fr.Peek <> -1) 'Read file<br />
count = count + 1<br />
str = str.AppendLine(count.ToString() + " " + fr.ReadLine()) 'Add string<br />
End While<br />
<br />
fr.Close() 'Close StreamReader<br />
<br />
Dim fw As New StreamWriter("C:\\a.txt") 'Create StreamWrite object<br />
fw.WriteLine(str) 'Write data<br />
fw.Flush() 'Flush data<br />
fw.Close() 'Close stream<br />
|
|
|
|
|
hi
thank you for your help
thanks
|
|
|
|
|
Hi i m a developer working on a project vb.net related to client server application. I need to login / logoff on client PC, through server PC. if any one have sample code regarding to the problem. Please send it. rmsohaila@hotmail.com, rmsohaila@gmail.com
Thank you,
Sohail Arshed
|
|
|
|
|
That's hardly a description of the problem. Noone is just going to hand over code for you to turn in as your own.
What do you mean by "I need to login / logoff on client PC, through server PC". This doesn't mae any sense. What are you doing with this app?
|
|
|
|
|
rmsohaila wrote: I need to login / logoff on client PC, through server PC
You mean like remote desktop does ? Have you tried to google the problem ?
rmsohaila wrote: Please send it. rmsohaila@hotmail.com, rmsohaila@gmail.com
You'll get a lot of spam for posting your email here, you'll get no replies. If you registered this address with the site, you'll get an email when people reply, but no-one is going to write code for you, and then email it off site.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
How do I search for a row in a datagrid using an access db in vb.net. I have a textbox and a search button and I want to display the row that I have found by typing in the textbox on a label for each column of the row using SELECT * FROM WHERE
Francois
|
|
|
|
|
I may have not understood you correctly, but you may use
Label.Text=TheFoundRow.Fields(i)
for each of the fields of the row if you know how many fields it has.
|
|
|
|
|
I know how to display the current row. You see if you have two fields, an ID And a NAme field, then you will use a loop to get to the id, the problem is how to get to the name field as it is not a number you can loop to. Please help!
|
|
|
|
|
You can, in fact, index it by number, or by name.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi ALL
I want to design a program that compile a project when i run this program.i mean that i want to buld 2 program but the first program should give some parameters from user and then it build the second one base of that parameters. is here anyone to help me??
|
|
|
|
|
In case of writing a compiler, I guess it is much more complicated than to be answered here, and you may read a book on that.
If you had described your problem more clearly, we could possibly provide you with other solutions too.
But personally I guess that what you need is one of my problems long time ago, when I found the best and easiest method to use Microsoft Script Control ActiveX (msscript.ocx) which enables you to run scripts in VBS or JS in your program without any more need of writing a new compiler!
Hope it solves your problem too.
|
|
|
|
|
Hi
i think that i should ask my question clearly. i want to code 2 program. one of this programs are the main program that will run and it will be closed 5min after runing without any other thing. but this program need some parameters to be set for first time. and the user should be set this parameters. so i want the second program for setting this parameters. i want to run the second program to get parameters from user and ther buld the first program.
thanks
|
|
|
|
|
Why do you need a second program to set parameters for the first ?
The obvious way to run a program with parameters from another program is to pass them on the command line.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi
because i want the main program for doing a set of jobs automatically everyday(like backing up, coping some files,executing some batchfiles ...) but there are some parameters that shohld set one time for first time or may be change at sometimes. so i want to set them and put the main program in the scaduled tasks to run everey day. ok?
|
|
|
|
|
Still sounds to me like you want a preferences page in your main program, but either way, your app can manipulate settings that the main app accesses, either by being in the same directory, or by using the registry.
Where we've ended up is a long, long way from your original question. You want to have a program which sets up settings which are then read by your main program. You don't want your program to compile anything.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I have an application that pulls customer data from the database and prints a letter using the pulled data. There are times when there can be several thousand letters printed at a time and I am trying to find a way of doing this without sending several thousand single page jobs to the printer. I cannot set up a regular mailmerge as I have to allow the users to upload letter templates with different formatting, content, etc.
I thought that copying each letter into one larger doc, or a series of larger docs, would satisfy. But I am having trouble copying from my original letters into the merged document. I can copy the text using .Selection.SetText(myDoc) but the text seems only to be in plain text format.
This what I have come up with so far. I would really appreciate any advice.
<br />
Dim ofd As New OpenFileDialog<br />
ofd.ShowDialog()<br />
<br />
doc = CommonWordHelper.OpenDocument(wapp, ofd.FileName, False, False, False, False)<br />
newDoc = wapp.Documents.Add()<br />
<br />
<br />
doc.Activate()<br />
CommonWordHelper.InsertTextInBookmark(wapp, "Bookmark", "First insertion")<br />
<br />
doc.Select()<br />
My.Computer.Clipboard.SetText(wapp.Selection.Text)<br />
<br />
newDoc.Activate()<br />
wapp.Selection.PasteAndFormat(Word.WdRecoveryType.wdFormatOriginalFormatting)<br />
wapp.Selection.InsertBreak(Word.WdBreakType.wdPageBreak)<br />
<br />
<br />
doc.Activate()<br />
CommonWordHelper.InsertTextInBookmark(wapp, "Bookmark", "Second insertion")<br />
doc.Select()<br />
My.Computer.Clipboard.SetText(wapp.Selection.Text)<br />
newDoc.Activate()<br />
wapp.Selection.GoTo(Word.WdSectionStart.wdSectionNewPage)<br />
wapp.Selection.Paste()<br />
Thanks
Jim
|
|
|
|
|
How can i get the drive where the process was executed? :
|
|
|
|
|
Application.ExecutablePath contains the drive name.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
i want to know this,through a combo box we select the different departments in a company,when we select the department the employees should be shown those who belong to that department in the datagrid .how can we do that?i need a help plz...
Harshi
|
|
|
|
|
Basically, you store the key for the department in the value of the combo box, and use that to run the SQL you need to get the data in question.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
hi i am doing a tool in which i have to open some ten to twenty telnet sessions in each seperate users will be sigining on and accssing same area and database.using a telnet component i am creating telnet session and giing som inputs and retriving data to gui. for making the process i am using threading.but it takes more time for a single command thats more tha 2 sec which will be taking less tha a second if we open single telnet session could any one tell me the reason pls?
and help me with some advanced threading concepts and sample codes pls
thanks
with regards
Balagurunathan.B
|
|
|
|