|
i tried to write this code insted of the other one
s = s & "(" & f1 & f2 & f3 & f4 & f5 & f6 & f7 & ")"<br />
but it didn't work
|
|
|
|
|
You still have a comma after
f7 = "'" & TextBox4.Text & "',"
as I mentioned earlier, and in your command you do not have a parameter after that which is a syntax error.
In the code above you also still have a single quote ' after the last parameter as well. The reason I suggested the breakpoint was so that you could validate the syntax of the SQL statement.
If you are still having problems after looking at that please copy the contents of s at the breakpoint into a message here
|
|
|
|
|
here the code is it write ??
Dim f1, f2, f3, f4, f5, f6, f7, f8 As String<br />
<br />
f1 = "#" & DateTimePicker1.Value & "#,"<br />
<br />
f2 = "'" & ComboBox1.Text & "',"<br />
<br />
f3 = "'" & ComboBox2.Text & "',"<br />
<br />
f4 = "'" & TextBox1.Text & "',"<br />
<br />
f5 = "'" & TextBox2.Text & "',"<br />
<br />
f6 = "'" & TextBox3.Text & "',"<br />
<br />
f7 = "'" & TextBox4.Text & ""<br />
<br />
' f8 = "'" & Label10.Text & "'"<br />
<br />
s = "insert into sale"<br />
s = s & " (dte,op,nos,cost,coms,nii,npp)values "<br />
<br />
' s = s & "(" & f1 & "," & f2 & "," & f3 & "," & f4 & "," & "," & f5 & "," & "," & f6 & "," & f7 & "')"<br />
<br />
s = s & "(" & f1 & f2 & f3 & f4 & f5 & f6 & f7 & ")"<br />
<br />
the error msg is :Syntax error in string in query expression ''12.75)'.
and here the breakpoint :
"insert into sale (dte,op,nos,cost,coms,nii,npp)values (#7/2/2007#,'Mobinil','10','1','13','0.25','12.75)"
|
|
|
|
|
Change
f7 = "'" & TextBox4.Text & ""
to
f7 = "'" & TextBox4.Text & "'"
and it should work fine then, you only needed to remove the comma
|
|
|
|
|
Thanks very very very much it works well
u r helpful
|
|
|
|
|
magedhv wrote: GC.Collect()
Why are you doing this ?
magedhv wrote: f2 = "'" & ComboBox1.Text & "',"
magedhv wrote: s = s & "(" & f1 & "," & f2 & "," & f3 & "," & f4 & "," & "," & f5 & "," & "," & f6 & "," & "," & f7 & "')"
This is kind of ridiculous. You're just creating far more strings than you need to, and making the code hard to debug. No wonder there's a syntax error in your insert statement. Try using a string builder, or at least build the query all in one line.
Also check your final string in the debugger if you get an error like this, to see if it's legal SQL ( it plainly isn't )
Christian Graus - Microsoft MVP - C++
"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 frnds,
i want to add the check box to gridview header to implement the select all facility
how can i do this.....plzzz help
any idea ?????
any helpful link ????
regards,
koolprasad2003
Be a good listener...Because Opprtunity knoughts softly...N-Joy
|
|
|
|
|
You will need to create a custom header style:
http://msdn2.microsoft.com/en-us/library/ms748988.aspx
Have a read through that and if you get stuck give me a shout.
Dan
|
|
|
|
|
Hi! this is an emergency.
I have made a software that uses many fonts, transparency options in the skin and many more settings that works well on my computer as it has all the necessary fonts and .net framework 3 but when running on other machines
1)They don't have the fonts I've used.
2)They only have .net framework 2.(in my class)
3)I have used a background image and made yellow as the transparent key this works well on my machine but on other machines the yellow edges of the background are visible.
I heard you can embed all the necessary system files with application on compiling, but I searched everywhere and couldn't find a single detailed explanation anywhere so I came here as a last resort.
So, Pls someone help me.
|
|
|
|
|
Hi,
I have created a windows application using VB.NET its working fine there is no issue on that applicaiton. My problem is i want to restrict multiple times of running the same application. for example if i click and run the exe file it will open the application again click on the same exe file it will open the same application second time. I want to restrict that if u click on the exe n time it should open one not many. is it possible if so can u plz guide me how to do that.
Thanks
Warm Regards
Prakash-B
|
|
|
|
|
Hi
You can iterate though the processes running on the machine to see if one is running with the same name as the current application. Code would look like
Dim currentProcess as Process = Process.GetCurrentProcess
Dim allProcesses as process() = process.getprocessesbyname(currentProcess.ProcessName)
For each process as Process in allProcesses
If process.Id = current.Id then continue for
If [Assembly].GetExecutingAssembly().Location.Replace("/", "\") = currentProcess.MainModule.FileName Then
'There is another version running
Throw new exception("Application already open")
end if
next
Thats just entered but should give you a good idae of how to code this...
|
|
|
|
|
run this on Form1_Load
If (UBound(Diagnostics.Process.GetProcessesByName(Diagnostics.Process.GetCurrentProcess.ProcessName)) > 0) = True Then<br />
End<br />
End If
|
|
|
|
|
Thanks for your flying reply its working for me
Thanks
Warm Regards
Prakash-B
|
|
|
|
|
hi,
go to Properties of Project & click on application tab
now click on checkBox related to "Make single instance application"
hope this helps
Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)
|
|
|
|
|
Thanks for your flying reply its working for me
Thanks
Warm Regards
Prakash-B
|
|
|
|
|
can anyone tell me where the SaveSettings function store the data in registry.
thanks
|
|
|
|
|
|
hi
i have extracted backend code of the webpage which looks some thing like this.
<title>orkut - Login
is an online community that connects people through a network of
trusted friends. We are committed to providing an online
meeting place for people to socialize, make new acquaintances
and find others who share their interests.
Join orkut now to create and connect with your own social circle.
Learn more about keeping orkut beautiful
|
| |
|
now i want to take only the the data which is in the table format and display it in tables in asp and vb.net.
i did this program. but am extracting the whole file(above code) into the tables but want to take only the data which is present in the table tags.
and also how to display a textfile data which does not have any table tags.
there is no such thing as good or bad.
|
|
|
|
|
Hey
Well you could parse the file for the tag you are looking for in this case , then get the tag and each tag then you know you are on the next row, repeat this until the tag and repeat the whole process.
You could do this by getting the whole file then loading it into memory and parsing it or using the StreamReader class.
Then display the information in the way you choose.
You can use msdn for any help but most of this problem is just working out the logic of what you need (which is explained above)
Hope this helps
Dan
|
|
|
|
|
Hi All,
Please anyone in brief define the Environment Class and when to take advantage of it.
Thanks & Wishes
Navneet Hegde
Nashik(City Of Pilgrimage)
-- modified at 0:48 Thursday 5th July, 2007
Develop2Program & Program2Develop
|
|
|
|
|
|
Hi D,
Thanks very much.
Respect & Regards
Navneet Hegde
Nashk(City Of Pilgrimage)
Develop2Program & Program2Develop
|
|
|
|
|
How can I convert a binary data from SQL to a byte array in vb.net? If any one knows how,
please kindly let me know. I appreciate your help. Thank you very
much.
|
|
|
|
|
What form does the data take, before you convert it ?
Christian Graus - Microsoft MVP - C++
"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 )
|
|
|
|
|
Kind of new to crystal reports, so forgive me if this is simple.
Basically, all the information from a DB is displayed in rows, however when I click an ID of a row on the crystal report viewer, I get a blank page, and I really want the data to appear on this new page + mabe some headings etc
Help appreciated.
|
|
|
|