|
I'm creating a VB.net application ( vb.net 2005) .The application use a Ms access 2003 database with 5 fields ( Primary key is autonumber).I have create dataset using wizard.
I have problems when insert a new record in databse. The code is :
--------------
Dim drw1 As XTDataSet.PassRow
drw1 = Me.XTDataSet.Pass.NewPassRow
drw1("name") = "xxxxx"
drw1("ALG_1") = "ccccc"
drw1("aksnot") = True
drw1("aksfin") = False
Me.XTDataSet.Pass.AddPassRow(drw1)
Me.PassTableAdapter.Update(XTDataset.Pass)
Me.XtDataset.Pass.AcceptChanges()
-------------------------
With these code the new record is added to database , but after if i try to modify the new record ( without closing the form ) i get an error : Concurrency Violation....
If i close the form end reopen i can modify the new record without problems.
And without closing the form , if i fill again the dataset after adding new record everything is ok.
But how to do without closing the form and without filling again the dataset ( this is to slow)
Please help me !
|
|
|
|
|
Hi All
I want to print a wages slip for an employees through one of my project developed in VB6. The printing will happens using DMP i am using the following code: -
Dim Fn As String
Fn = FreeFile
Open Printer.Port For Output As #Fn
Print #Fn, "Some Text"; Tab(35); "Some Text"
Print #Fn, "Some Text"; Tab(35); "Some Text"
Print #Fn, "Some Text"; Tab(35); "Some Text"
Close (Fn)
This code print the slip but i want to reduce the text size, and want to change the font and paper size.
I use the printer.fontsize but its not working
Plz help me how could i do the same.
Thanks in advance
|
|
|
|
|
You're going to have to dig out the manual on the printer and find out what the codes are to tell the printer to change the font and styles. I think you'll find you are quite limited in what you can do.
Using the fontsize and other properties of the Printer object won't do you any good in this case. You're sending data directly to the printer port, not to the Spooler and you're not using any GDI objects to draw your printed image.
|
|
|
|
|
hi..
i selected some rows in a datatable using dataview..like
dim dv as dataview(dttemp) ' dttemp is datatable with 5 columns
dv.rowfilter="name like '" &txt1.text &"%'"
dv.sort="name"
here i got more than 1 rows as result.. my pblm is i just want the first name in the first row of the dataview ie. in dv. how can i..
cheers..
|
|
|
|
|
Well, it's doing wxactly what you're telling it to do. List ALL the rows that have a Name like "something%". You can look at the first row by getting index 0 of the Items collection.
Dim dv As New DataView(dttemp)
dv.RowFilter = "name LIKE 'text%'"
dv.sort = "name"
' Retrieve the first item in the sorted, filtered list:
Dim drv As DataRowView = dv.Item(0)
' Use the retrieved DataRowView as normal...
|
|
|
|
|
Hi there..
I want my application to check whether an input in a textbox is invalid when cmdAddDB is clicked.
It should check if there is a string for DByear value.
****************************************
DByear is declared as private integer
Sub CmdAddDBClick(sender As Object, e As System.EventArgs)
'check whether the textboxes are empty
If txtYear.text = "" OrElse txtMonth.text = "" OrElse txtDay.text = "" Then
'inform user of error
Messagebox.Show("Missing Information")
'clears all textboxes
txtYear.Text = ""
txtMonth.Text = ""
txtDay.Text = ""
Else
'set the textboxes to private variables & convert textboxes to
'integer values
DByear = CInt(txtYear.Text)
DBmonth = CInt(txtMonth.Text)
DBday = CInt(txtDay.Text)
End If
End Sub
****************************
Please can anyone help?
Thanx
|
|
|
|
|
hello
U can use the tryparse function to check if it is not a number.
Signature has been encrypted
|
|
|
|
|
Hi Wachilll..
And how do i use a tryparse? A kinda new to vb.net
I would really appreciate a little more detail....
|
|
|
|
|
x-Taka-x wrote: And how do i use a tryparse? A kinda new to vb.net
Have you read the documentation for it? Have you even attempted to look up the documentation?
Upcoming events:
* Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ...
"I wouldn't say boo to a goose. I'm not a coward, I just realise that it would be largely pointless."
My website
|
|
|
|
|
hi all
i have an image, i have a string and i m trying to merge both of them together to make one image and save it in a folder.
does some one has any kind of idea about the job
thnx.
help everyone
|
|
|
|
|
Create a Graphics object for the image (using Graphics.FromImage), and use that to draw the text on the image.
---
single minded; short sighted; long gone;
|
|
|
|
|
thanx for help
i have that by making a new image using image, string (text) , and other things
and save them as one image at specified path.
help everyone
|
|
|
|
|
He just told you how to do it. Do you always ignore the answers you're given??
|
|
|
|
|
i've made a quick example for you, i think people forget they come on these boards to help people out when they start giving out sharp answers instead of just helping with a code snippet that only takes a moment to make.
Code:
<br />
<font face="Courier New" size="2"><font color="#008000"> '/// load original image from file as a Drawing.Image...</font><br />
<font color="#0000FF"> Dim</font> img <font color="#0000FF">As</font> Image = Image.FromFile("<a href="file:///C:/Image1.png">C:\Image1.png</a>")<br />
<font color="#008000"> ' <font color="#0000FF">Dim</font> g <font color="#0000FF">As</font> Graphics = Graphics.FromImage(img)<br />
<font color="#008000"> '/// draw the String on the image...</font><br />
g.DrawString("some text on an image!", <font color="#0000FF">New</font> Font(<font color="#0000FF">Me</font>.Font.Name, 16, FontStyle.Bold), <font color="#0000FF">New</font> SolidBrush(Color.Red), 10, 10, <font color="#0000FF">New</font> StringFormat(StringFormatFlags.DirectionVertical))<br />
<font color="#008000"> ' img.Save("C:\testing.jpg", Imaging.ImageFormat.Jpeg)<br />
<font color="#008000"> '/// clean up...</font><br />
g.Dispose()<br />
img.Dispose()<br />
<font color="#008000"> ' PictureBox1.SizeMode = PictureBoxSizeMode.StretchImage<br />
PictureBox1.Image = Image.FromFile("C:\testing.jpg")</font><br><br />
hope it helps .
<font color="blue">Csharp</font> me = (<font color="blue">Csharp</font>)Dynamic_Sysop; <font color="#008000">// My Signature.</font><br><font color="#008000">$twins</font> = <font color="#008000">me.twins</font>(<font color="#800080">"Taylor"</font> , <font color="#800080">"Delta"</font>); <font color="#C0C0C0">// My twin daughters.</font><br>echo <font color="#008000">$twins</font>;
|
|
|
|
|
And what do I want with a code sample? I'm not the one looking to mark an image.
You missed the point of my post. He asked a question, got the description of how to do it, and then repeated his question, without saying anything about what he was having a problem with.
All to often, there are people who come here and just want the code written for them without having to lift a finger themselves to write it. That's why he didn't get code sample. He has to show that he at least attempted to solve the problem on his own. Then we'll go through and show him where he went wrong.
|
|
|
|
|
|
Maybe you didn't know this, but the only person who gets an email that you responded to a message is the person you are replying to. Everyone else in the chain does not get a notification that you posted anything. So, I'm the only who got a notification that you responded to my post.
|
|
|
|
|
i m sorry
if anything i said is supposed to be worng. i m not trying hurt anyones imotions.
please don't take my statement the other way round
again sorry
help everyone
|
|
|
|
|
thank u very much
it really works
help everyone
|
|
|
|
|
After deployment of the project I want to take server name dynamically fro SQL Connection.
How to do that???
|
|
|
|
|
its very simple , yaar!
in connection string u palce a string Variable for server name and pass values to the string variable from a Form with single text box before the Login from or spalsh screen(be sure that this form should popped out only when server name is not provided, once server name is provided this Form should not be popped out) i done this
Reply, How it helped
prabumj
prabumj@gmail.com
|
|
|
|
|
do u know how to create splash screen n vb.net..plse hlp
cheers..
|
|
|
|
|
In .Net 2005 splash screen is there, u just go and see in Add New Item. u will see that Login Form Too.
|
|
|
|
|
How to get datetime type of window system ? (ex:dd/MM/yyyy)
|
|
|
|
|
if you want to change the format you display on the screen then use
folloeong function
e.g you want to display te date in the textbox then
textbox.text=format(now.date,"DD/MM/yyyy")
In the same fashion you can use any format of the date.
|
|
|
|