|
It's those little (read: HUGE) tidbits that make all the difference in the world when you ask a question in a forum environment.
|
|
|
|
|
i am working on vb.net windows forms.inthat i used outlook by adding reference.when i tried to run the application i am getting eror as "can not create activex object".any one pls help me in this isuue.
thanks
Madhusudhan.
|
|
|
|
|
What's the rest of the error message? Is this problem comming up on your development machine, or is it on a machine that you deployed your app to?
|
|
|
|
|
Hello,
VS 2005
I want to create a user control for the compact framework.
I have developed user controls before, however I need to create a control based on the CF tab control. Currently the tabs always display at the button of the control. The customer wants them to be at the top of the control.
Would I have to create a user control that inherits the CF tab control? And maybe override something that would enable the tabs to be at the top
I have experience in creating user control, but nothing as complex as this.
Can any one provide any suggestions or sample code to get started.
Many thanks in advance,
Steve
|
|
|
|
|
I would generally try deriving from the control in question and see if it's a simple fix, or if the control is going to fight your change. Often, it's easier to start from scratch.
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 all,
Am creating employees master data using vb.net and sql server. in my screen i have lot of radio button for male /female selection and some yes/no selection. my problem is how to insert this radiobutton values to the database.according to the user selection(yes/no). Here i have Attached My coding Please help me...........
INSERT OPTION CODE
Private Sub btnins_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnins.Click
con.Open()
str = "Insert into EmployeeMaster values('" & txtname.Text & "','" & txtfname.Text & "','" & dtdob.Text & "','" & gencom.Text & "','" & txtqual.Text & " ','" & txtbg.Text & " ','" & martcom.Text & "','" & txtadd.Text & "',' " & txtcadd.Text & " ','" & txtpho.Text & "','" & txtmob.Text & "',' " & txtemail.Text & " ','" & txtpp.Text & " ','" & txtpv.Text & " ',' " & txteno.Text & " ',' " & depcom.Text & " ', ' " & descom.Text & " ',' " & dtdoj.Text & " ','" & catcom.Text & "','" & mopcom.Text & "','" & txtac.Text & "','" & byes.Text & "',' " & txtbv.Text & "',' " & txtcdue.Text & "','" & txtcdate.Text & "','" & txtesino.Text & "','" & txtpfno.Text & "','" & expyes.Text & "',' " & detcom.Text & "','" & txtpc.Text & "','" & txtnc.Text & "' )"
cmd = New OdbcCommand(str, con)
cmd.ExecuteNonQuery()
'check()
MsgBox("Inserted")
clear()
con.Close()
End Sub
VIEW OPTION CODE
con.Open()
str = "select * from EmployeeMaster where Name='" & namecom.Text & "'"
cmd = New OdbcCommand(str, con)
dr = cmd.ExecuteReader
If dr.Read Then
txtname.Text = dr.GetValue(0)
txtfname.Text = dr.GetValue(1)
dtdob.Text = dr.GetValue(2)
gencom.Text = dr.GetValue(3)
txtqual.Text = dr.GetValue(4)
txtbg.Text = dr.GetValue(5)
martcom.Text = dr.GetValue(6)
txtadd.Text = dr.GetValue(7)
txtcadd.Text = dr.GetValue(8)
txtpho.Text = dr.GetValue(9)
txtmob.Text = dr.GetValue(10)
txtemail.Text = dr.GetValue(11)
txtpp.Text = dr.GetValue(12)
txtpv.Text = dr.GetValue(13)
enocom.Text = dr.GetValue(14)
depcom.Text = dr.GetValue(15)
descom.Text = dr.GetValue(16)
dtdoj.Text = dr.GetValue(17)
catcom.Text = dr.GetValue(18)
mopcom.Text = dr.GetValue(19)
txtac.Text = dr.GetValue(20)
byes.Text = dr.GetValue(21)
txtbv.Text = dr.GetValue(22)
txtcdue.Text = dr.GetValue(23)
txtcdate.Text = dr.GetValue(24)
txtesino.Text = dr.GetValue(25)
txtpfno.Text = dr.GetValue(26)
expyes.Text = dr.GetValue(27)
detcom.Text = dr.GetValue(28)
txtpc.Text = dr.GetValue(29)
txtnc.Text = dr.GetValue(30)
dr.Close()
End If
con.Close()
|
|
|
|
|
rrrriiizz wrote: str = "Insert into EmployeeMaster values('" & txtname.Text & "','" & txtfname.Text & "','" & dtdob.Text & "','" & gencom.Text & "','" & txtqual.Text & " ','" & txtbg.Text & " ','" & martcom.Text & "','" & txtadd.Text & "',' " & txtcadd.Text & " ','" & txtpho.Text & "','" & txtmob.Text & "',' " & txtemail.Text & " ','" & txtpp.Text & " ','" & txtpv.Text & " ',' " & txteno.Text & " ',' " & depcom.Text & " ', ' " & descom.Text & " ',' " & dtdoj.Text & " ','" & catcom.Text & "','" & mopcom.Text & "','" & txtac.Text & "','" & byes.Text & "',' " & txtbv.Text & "',' " & txtcdue.Text & "','" & txtcdate.Text & "','" & txtesino.Text & "','" & txtpfno.Text & "','" & expyes.Text & "',' " & detcom.Text & "','" & txtpc.Text & "','" & txtnc.Text & "' )"
This is begging for a SQL attack, you should use parameterised queries, or, better yet, stored procs.
Colin has an excellent article on SQL injection, you should read it.
In C#, you can do this:
string sex = (rdoMale.Checked) ? "Male" : "Female";
Does VB do something like that ? Basically, it depends on how your data is stored, if it's a bool use the check result of the appropriate button. Otherwise, you need to build your paramater based on radio button state.
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 have implemented virtual mode alright, but i guess that makes the automatic sorting of DataGridView disable. Does anyone know how to implement sorting with Virtual mode?
Thanks
Mubashir
Software Architect
Storan Technologies Inc, USA
Every job is a self portrait of the person who did it.
|
|
|
|
|
I haven't tried it, but I don't think you can do this without requerying the database for the sorted record set. Virtual mode doesn't load the entire dataset all at once so I don't think it can sort what it doesn't know about.
|
|
|
|
|
error I got is "no value given for one or more required parameters"
in cmd.CommandText, I tried <"SELECT Res FROM WordList WHERE Src='" & mtxt & "'">, and tried <"SELECT Res FROM WordList WHERE Src='test'">, both doesn't work
but it runs fine if I use <"SELECT * FROM WordList"> but this is not what I wanted.
Here's my code
Dim conn As New OleDb.OleDbConnection
Dim cmd As New OleDb.OleDbCommand
conn.ConnectionString = "Jet OLEDB:Global Partial Bulk Ops=2;Jet OLEDB:Registry Path=;Jet OLEDB:Database L" & _
"ocking Mode=1;Data Source=""dictdb.mdb"";Jet OLEDB:Engine Type=5;Provider=""Micr" & _
"osoft.Jet.OLEDB.4.0"";Jet OLEDB:System database=;Jet OLEDB:SFP=False;persist secu" & _
"rity info=False;Extended Properties=;Mode=Share Deny None;Jet OLEDB:Encrypt Data" & _
"base=False;Jet OLEDB:Create System Database=False;Jet OLEDB:Don't Copy Locale on" & _
" Compact=False;Jet OLEDB:Compact Without Replica Repair=False;User ID=Admin;Jet " & _
"OLEDB:Global Bulk Transactions=1"
' ^ Connection string copied from wizard, so this line is fine
conn.Open()
cmd.Connection = conn
cmd.CommandText = "SELECT Res FROM WordList WHERE Src = ?" 'I think error must be from this line
cmd.Parameters.Add(New OleDb.OleDbParameter("", mtxt)) 'or from this line
Dim rdr As OleDb.OleDbDataReader = cmd.ExecuteReader(CommandBehavior.CloseConnection) 'error was thrown in this line at ExecuteReader
rdr.Read()
txtRes.Text = rdr.GetString(0)
rdr.Close()
Anybody know what's wrong?
Thanks in advance
-- modified at 7:07 Saturday 12th May, 2007
|
|
|
|
|
Have you two columns named Res and Src in your table?
If the answer is Yes then try to surround, in you query, those column names with square brackets, i.e. [Res] , [Src] .
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
hi friends,
please can anyway one help me if i can modify a file.
i mean delete some sentences from it and save it
without writing its content to another file and then overwrite it?
emma
|
|
|
|
|
Well u can use..
<br />
System.IO.File.ReadAllLines OR<br />
System.IO.File.ReadAllText <br />
then Modify string
and then write using
<br />
System.IO.File.WriteAllLines OR<br />
System.IO.File.WriteAllText <br />
Bt keep in mind this will overwrite the file.
"If our Mind can, the Program can !!" ≡ ░Ŗǿђầŋ٭ ≡
|
|
|
|
|
thanks
u know what i've tried it but it works just fine for small files as for big ones it's not very helpfull anyother way?
emma
|
|
|
|
|
imanos wrote: helloooooooooooooooooo its urgent
That sort of subject is not helpful, it doesn't describe your problem at all.
imanos wrote: i mean delete some sentences from it and save it
without writing its content to another file and then overwrite it?
To do this, use System.IO.File.ReadAllText to read the file, modify it in memory, then use File.WriteAllText to save it again.
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 )
|
|
|
|
|
Christian Graus wrote: imanos wrote:
helloooooooooooooooooo its urgent
That sort of subject is not helpful, it doesn't describe your problem at all.
No it doesn't. Even if he says it outside a Port-a-Potty with a guy taking a long time inside
|
|
|
|
|
well thanks,
ill clear it, i have 2 files and i want to delete the words in the first one from the second one
knowing that i don't want to create new file and write the old one again without the unwanted words
i.e. i want to modify the file and save it
emma
|
|
|
|
|
imanos wrote: i don't want to create new file and write the old one again
Why not? Just create a temporary file with the new list of wanted words, rename the original first file, and rename the temporary file to the original name of the first file...
|
|
|
|
|
what is vb.net code for search the value in datagrid by select the value in combo box in vb.net windows application
|
|
|
|
|
Google broken where you live ? Please don't post heaps of questions, consolidate them to one. They all seem related, anyhow.
Try this[^]
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 )
|
|
|
|
|
what is vb.net code for delete a record in datagrid using vb.net windows application
|
|
|
|
|
you should use events of datagrid
|
|
|
|
|
what is vb.net code for changing the values in datagrid and save the changed values in datagrid in vb.net windows application
|
|
|
|
|
hi
I dont know that,this is the right forum to ask this question
i am developing a sample aplication in EXcel, i just placed button i got the click event how can i retrive values from the cell to VB
My small attempt...
|
|
|
|
|
sujithkumarsl wrote: hi
I dont know that,this is the right forum to ask this question
i am developing a sample aplication in EXcel, i just placed button i got the click event how can i retrive values from the cell to VB
My small attempt...
in excel right click on button , select assign macro...
create new macro->edit or view code (as per your office version)
and write vb code
|
|
|
|
|