|
How can I write With cluse with Linq?
bah10z
|
|
|
|
|
Could you perhaps explain what you mean - you want to use LINQ to write a SQL clause that includes the with keyword ?
Here's a question - why do you have to use LINQ ?
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
This is a simple yet strange (to me) problem.In one project I can add rows to a dataset by:
Dataset created dsWaterReadings and datatable inside it dtWater.
dsWaterReadings.dtWater.Rows.Add("value1", "value2")
In the other project
I have created the same dsWaterReadings and dtWater
Now if I type:
dsWaterReadings.dtWater it forces me to chose dtWaterDataTable and that does not have a rows property.
Using dtWaterRow yeilds even less properties. What could the difference be. All references are idential apart from System.Configuration (which I dont think is the problem)
Many thanks
Andrew
|
|
|
|
|
ensure that you have the datatable adapter define in your program so it can bring forward the table you want to add rows on
for example
dim da as new da.DBdataadapter.table
dim dt as new dt.datasettable
this will ensure you can call anytable on your database
|
|
|
|
|
|
Hi. I'm making a treeview and the items on it are dynamically assigned a context menu and info about the node is used in an operation from the menu. My code works fine except if you left click item 1, then right click item 2, it opens the menu as if item 1 was selected. It only works correctly if you left click item 2 before right clicking it. Any way to fix this?
Have you tried the Krypton Toolkit? http://www.componentfactory.com/free-windows-forms-controls.php
|
|
|
|
|
Set the right clicked node as selected node in NodeMouseClick event.
|
|
|
|
|
use the context menu property of the treeview.
bah10z
|
|
|
|
|
Hi,
i would like to know which font is best in dotmatrix printer.
now i took printout using times new roamn font. but its take long time to print page.
i think this font is not good for dot matrix printout.
plz give suggestion.
Please help. Thanks.
Yours,
KaNNaN
-----------------------------------------------------------------
"Success is When Ur Signature Becomes An Autograph"
Mail To : foreverkans@gmail.com
|
|
|
|
|
I don't see how the selection of font makes any difference.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
ya i took one print out using timesnewroman font.
its look bold of fonts.
Yours,
KaNNaN
-----------------------------------------------------------------
"Success is When Ur Signature Becomes An Autograph"
Mail To : foreverkans@gmail.com
|
|
|
|
|
First, This is not a right Place to Post your Question.
There is no Different if using different fonts for printing ,
it's all depends on your printer Speed.
Rajesh B --> A Poor Workman Blames His Tools <--
|
|
|
|
|
then where i post?
this is forum.
we can share our doubts and knowledge...
Yours,
KaNNaN
-----------------------------------------------------------------
"Success is When Ur Signature Becomes An Autograph"
Mail To : foreverkans@gmail.com
|
|
|
|
|
A printer is hardware. There is a Hardware and Devices forum on CodeProject. That would sound like a good place to me. This is the Visual Basic Forum, it is where people normally post questions about VB, NOT about printers.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
TO : m2kannan
There is Forum "GENERAL IT ISSUES" in the Code Project. I Think that is the right place for u r Q.
Rajesh B --> A Poor Workman Blames His Tools <--
|
|
|
|
|
Hi, i have a form with text boxes for username, initials, and password on.
Also on this form are a few checkboxes which at the minute i simply want to save their state to SQL as true or false depending if ticked or not. The checkboxes or text boxes are not bound to anything, and are used only for creating a new record in the table.
There is a gridview below these boxes showing already created records.
The code im using to insert to SQL with is:
If String.IsNullOrEmpty(UsernameTb.Text) Then
MsgBox("You must enter a Username!")
Else
If String.IsNullOrEmpty(InitialsTb.Text) Then
MsgBox("You must enter users Initials!")
Else
If String.IsNullOrEmpty(PasswordTb.Text) Then
MsgBox("You must enter a Password!")
Else
Try
Me.UsersTableAdapter.AddUserQry(UsernameTb.Text, InitialsTb.Text, PasswordTb.Text, ApplicationsChkbx.Checked, AdministrationChkBx.Checked, CustomerSearchChkBx.Checked, CustomerFormChkbx.Checked, UnderWrittingChkBx.Checked)
'Update the Gridview and notify account created
Me.UsersTableAdapter.Fill(Me.WDA_SQLDataSet.Users)
MsgBox("Created user " & UsernameTb.Text)
'Empty all the text boxes and set check boxes back to unticked state
UsernameTb.Text = Nothing
InitialsTb.Text = Nothing
PasswordTb.Text = Nothing
AdministrationChkBx.CheckState = 0
ApplicationsChkbx.CheckState = 0
CustomerFormChkbx.CheckState = 0
CustomerSearchChkBx.CheckState = 0
UnderWrittingChkBx.CheckState = 0
Catch ex As Exception
MsgBox("Error will robinson, error")
End Try
End If
End If
End If
"AddUserQry" is a Query on the dataset for that table:
INSERT INTO [Users] ([Username], [Initials], [Password], [Applications_Access], [Administration_Access], [CustomerSearch_Access], [CustomerForm_Access], [Underwritting_Access]) VALUES (@Username, @Initials, @Password, @Applications_Access, @Administration_Access, @CustomerSearch_Access, @CustomerForm_Access, @Underwritting_Access);
SELECT ID, Username, Initials, Password, Applications_Access, Administration_Access, CustomerSearch_Access, CustomerForm_Access, Underwritting_Access FROM Users WHERE (ID = SCOPE_IDENTITY())
For some reason when i create a new record, it saves the check state as -1 for checked, and 0 for unchecked. the table columns are varchar(5) for the check boxes.
Using checkboxname.checkstate doesent work either - that saves the state as 1 or 0 (as opposed to -1 and 0)
On another form i made for editing existing entries, i have the same text boxes and check boxes, which are bound so they show the record details. when using that form to EDIT an entry, it saves the check box states as "True" or "False" as it should do.
Im completely stumped here, because if i create a new user it then breaks the gridview showing users, because it throws up error messages about "-1 not being valid boolean" when it attempts to render each check box in a grid view.
Has anyone got any ideas why this is happening? and how i can make the insert save the check box state as boolean? im losing sleep over this one, litteraly!
any help/suggestions much appreciated
|
|
|
|
|
FthrJACK wrote: Using checkboxname.checkstate doesent work either
Have you tried checkboxname.Checked ?
It sounds silly but it at least has the virtue of returning a boolean value.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
hi, yes im using checkboxname.checked if you look at the code snippet above. however it saves as -1 and 0
.checkstate saves as 1 and 0
.checked gives minus 1? strange isnt it?
hence why im so perplexed by it!
|
|
|
|
|
SOLVED: setting the column to bit fixes it, that way SQL converts the numeric value on insert.
Also Mycheckbox.checked.ToString() will work too, though thats having vb do the conversion not SQL server.
|
|
|
|
|
To fully understand this you'd have to go to the site and look at this documentation.
http://www.sheltonblog.com/archive/2007/10/05/free-sharepoint-document-workflow-workshop---part-2-asp.net-workflow.aspx[^]
I have to convert this to VB. in C# it runs fine.
He deletes the default.aspx
Adds a folder.
Inside he creates his PageName.aspx as normal.
He then creates a Design_Page.aspx with NO code behind.
He copies out the Page Header from PageName and post it in Design_Page.aspx and now it will use the PageName.vb as its code behind as defined.
Fine with C#.
In C# he clicks on the buttons and it creates a click event.
In VB I do the same and it creates a click event. The problem is it says I need a WithEvents associated with it.
I didn't think it would work, but I would follow the error message and create WithEvents for them. Underlined errors disappear. Now Build error occur saying the handlers already have WithEvents defined for them.
What is going on????????
#2)
SPControl.GetContextWeb(Context).Web("Whatever") has a nullreference error pointing at Context.
In C# it just seems to ignore it because it continues to work despite Context not being assigned.
I can't contact the blog owner, because the forms won't let me. There is a login button, but there is no JOIN that I can see. I'd just like to ask him how to convert this because it is taking a lot longer than I anticipated.
I know the associations are right because again it works in C# and all I'm doing is converting. So the WithEvents issue is really confusing.
The nullreference might require me to go about it a different way in some degree because of the differences the two languages interpret null, nothing or not assigned.
|
|
|
|
|
I'll start by telling you what I have now...
My web page (using a Persits AspPDF.NET component - trial now expired) accepts PDF uploads and then processes those individual documents by stitching them together - forming a single PDF file. This works flawlessly and, in fact, is precisely what I was looking for - almost. You can view the page at: http://www.mulehide.com/downloads/data_sheets.aspx although the trial component that merges the PDF files is expired.
Now, what I want to do is, rather than the PDF's coming through as uploads, I want them to come through from a previous page and be posted to this page, then perform the stitch operation. Basically, I want to do the same thing but instead, select PDF's that are already on my web server, rather than off the clients machine. I tried a couple of different methods and failed miserably due to knowing absolutely nothing about VB code. And I mean nothing!
Ideally the previous page would have say, checkboxes, allowing the visitor to select the PDF files they would like to combine. These would then submit the page and create the stitched PDF. Even cooler would be to have everything on one page.
I'm not locked in to this Persits product. He refused to help at all with this issue even though it meant a multi-server sale for him and if another method of stitching PDF files is available, I'm open to it.
Any ideas out there? Code is below. Thanks!
Steve
<%@ Page Language="VB" ContentType="text/html" ResponseEncoding="utf-8" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ Import Namespace="System.Web" %>
<%@ Import Namespace="Persits.PDF" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Mule-Hide Data Sheets</title>
<script runat="server" language="vb">
Sub Page_Load(Source As Object, E As EventArgs)
txtResult.Text = ""
If Not IsPostBack Then Exit Sub
Dim objFile1 As HttpPostedFile = MyFile1.PostedFile
Dim objFile2 As HttpPostedFile = MyFile2.PostedFile
Dim objFile3 As HttpPostedFile = MyFile3.PostedFile
Dim objFile4 As HttpPostedFile = MyFile4.PostedFile
Dim objPdf As PdfManager = New PdfManager()
Dim FileBytes1 As Byte() = New Byte(objFile1.InputStream.Length){}
objFile1.InputStream.Read(FileBytes1, 0, FileBytes1.Length )
Dim FileBytes2 As Byte() = New Byte(objFile2.InputStream.Length){}
objFile2.InputStream.Read(FileBytes2, 0, FileBytes2.Length)
Dim FileBytes3 As Byte() = New Byte(objFile3.InputStream.Length){}
objFile3.InputStream.Read(FileBytes3, 0, FileBytes3.Length)
Dim FileBytes4 As Byte() = New Byte(objFile4.InputStream.Length){}
objFile4.InputStream.Read(FileBytes4, 0, FileBytes4.Length)
Try
Dim objMasterDoc As PdfDocument = objPdf.CreateDocument()
Dim objDoc1 As PdfDocument = objPdf.OpenDocument(FileBytes1)
Dim objDoc2 As PdfDocument = objPdf.OpenDocument(FileBytes2)
Dim objDoc3 As PdfDocument = objPdf.OpenDocument(FileBytes3)
Dim objDoc4 As PdfDocument = objPdf.OpenDocument(FileBytes4)
objMasterDoc.AppendDocument(objDoc1)
objMasterDoc.AppendDocument(objDoc2)
objMasterDoc.AppendDocument(objDoc3)
objMasterDoc.AppendDocument(objDoc4)
Dim strPath As String = Server.MapPath("datafiles") + "\\" + "MH_CustomPDF" + ".pdf"
Dim strFileName As String = objMasterDoc.Save(strPath, False)
txtResult.Text = "Success. Your PDF file " + strFileName + "can be downloaded <a TARGET=""_new"" href=""datafiles/" + strFileName + """>here</a>."
Catch es As Exception
txtResult.Text = es.Message
Exit Sub
End Try
End Sub
</script>
</head>
<body>
<table width="720" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#EEEEEE">
<tr>
<td>
<form runat="server" enctype="multipart/form-data" method="POST"><p>
<input type="file" id="MyFile1" runat="server" /><br />
<input type="file" id="MyFile2" runat="server" /><br />
<input type="file" id="MyFile3" runat="server" /><br />
<input type="file" id="MyFile4" runat="server" />
<br />
<br />
<input type="submit" name="button" id="button" value="Create Merged PDF" />
<br />
<asp:Label id="txtResult" Font-Bold= "true" runat="server"/></p>
</form></td>
</tr>
</table>
<p> </p>
</body>
</html>
|
|
|
|
|
If you're looking for a free PDF merger, I'd suggest PDFSharp[^].
|
|
|
|
|
smdevivo wrote: I'm not locked in to this Persits product. He refused to help at all with this issue even though it meant a multi-server sale for him and if another method of stitching PDF files is available, I'm open to it.
Considering your question has absolutely nothing to do with the product or stiching files together, I'm not surprised you're not getting support. Your question has to do with getting data from one page to another. You should be asking in the ASP.NET forum.
The previous page would have to be rewritten to put up a list of files available on the server, let the user select those files with a checkbox and clic a button. That button click would then send the list of files to another class that would do the combining and return the completed file.
If you want the details on this process, ask in the ASP.NET forum...
|
|
|
|
|
hello every one
I am having one project to be developed in vb 6.0 and i am new to it. I want to use Menu strip item & toolstrip menuitem in it i known in .net it is drag and drop method but how is it done in VB 6.0.I made one MDI form in that i want to use these both.
Please suggest.
Thank You.
|
|
|
|
|
Tools > Menu Editor when you are on MDI form.
For toolbar add reference to microsoft windows common controls.
Good to still see VB6 programmers
|
|
|
|