|
Hi to all,
I have a question for anyone who can help me on the subject custom controls in design time.
What i want to achieve is following:
how can you create a method/function in the propertypage in the visual studio IDE just klike the ones you have with like for example the SQLDataAdapter (in the help/description field some links appear with behind that some wizard functionality). Anyone any ide how to do that? I don't seem to find any good example anywhere.
Another thing i wanna do (i know i ask a lot, but it aren't common things in my eyes so that why i post everything here ) is to add custom section in the app.config during design time ( so not to the compiled app.exe.config !!!!!) What is the easiest way to do such a thing, i mena can i just use the executing aasembly name? or is there a catch.
For thos who can help me, many thanks in advance.
Mike Martin
mike martin
|
|
|
|
|
My system is built in VB,
the problem is some of the DLL and OCX files r not working properly, although i've tried to copy them from VB setup file but its still not working properly, i think its a dll hell problem, how can i make my system to refer to the dll of my choice.
pls help.
|
|
|
|
|
What version of VB ? What do you mean by 'not working properly' ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
OCX files and ActiveX dlls need to be registered.
Use the regsrv32.exe command line, or use the package and deployment tool to build a release for your setup that automatically registers all the dependencies.
'--8<------------------------
Ex Datis:
Duncan Jones
Merrion Computing Ltd
|
|
|
|
|
Dear All,
I always encounter syntax error on INSERT TO.
I am sure my code is correct but I do not know where go wrong.
Below is my code.
Private Sub btnsave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnsave.Click
Me.Cursor = Cursors.WaitCursor
Dim row As DataRow = dataTable.Rows(currRec)
txtdatefrom.Text = datestart.Value.Date.ToString
txtdateto.Text = DateEnd.Value.Date.ToString
row.BeginEdit()
row("Ship_Name") = ComboBox1.SelectedItem
row("Container") = Container_SizeTextBox.Text
row("datefrom") = txtdatefrom.Text
row("dateto") = txtdateto.Text
row("DateCreate") = Date.Today
row.EndEdit()
dataAdapter.Update(ds, "shipment")
ds.AcceptChanges()
ToggleControls(True)
btnnew.Enabled = True
insertSelected = False
Me.Cursor = Cursors.Default
MsgBox("Record Created")
End Sub
Private Sub InitializeCommands()
' Preparing Insert SQL Command
dataAdapter.InsertCommand = conn.CreateCommand()
dataAdapter.InsertCommand.CommandText = "INSERT INTO shipment " + _
"( Ship_Name, Container, datefrom, dateto, DateCreate)" + _
"VALUES( @Ship_Name, @Container, @datefrom, @dateto, @DateCreate)"
AddParams(dataAdapter.InsertCommand, "Ship_Name", "Container", "datefrom", "dateto", "DateCreate")
end sub
Private Sub AddParams(ByVal cmd As OleDbCommand, ByVal ParamArray cols() As String)
' Adding Hectice parameters in SQL Commands
Dim col As String
For Each col In cols
cmd.Parameters.Add("@" + col, OleDbType.WChar, 0, col)
Next
End Sub
Can anyone please advise.
Thank in advance....
Jack Wong
|
|
|
|
|
Hi,
I have created a proxy socket with a TCPListener which receives client connections and sends request to the backend webserver and sends the response back from the backend server to the clients.
In this excercise, the HTML part is getting transferred correctly but the Images are not getting transferred. I am able to transfer only BMP images.
After receiving the response from the backend server, I check if the mime type returned is text or not. If it is text then I convert the bytes into string and pass on to the client socket. If it is not text(i.e. image) then send it in the same byte form as sent by the backend server. This works only for BMP images and not GIF or JPG images.
please help
|
|
|
|
|
Visual Basic 2005 Express Edition:
My application creates a one page report and prints it out. The page includes an image.
Now, I would like to save that page to a file, so, that it could later be retrieved and viewed on the screen and also have the ability to reprint it.
|
|
|
|
|
You could print it to a pdf printer driver,
or print it to an EMF spool file and use the EMF Spoolfile Viewer in my articles on this site to print/preview it thereafter
'--8<------------------------
Ex Datis:
Duncan Jones
Merrion Computing Ltd
|
|
|
|
|
OK, but, which one should I go with (I am planning to market this program)?
|
|
|
|
|
I recomend the pdf way - it is a defacto industry standard imo
'--8<------------------------
Ex Datis:
Duncan Jones
Merrion Computing Ltd
|
|
|
|
|
How do I implement a pdf printer driver?
I already created the printed page using:
.DrawString
.Graphics.DrawRectangle
.DrawImage
system.Drawing.Printing.
PrintPreviewDialog()
|
|
|
|
|
The code below got PDFcreator to create a PDF file, but, it didn't use my .PrintFileName or my .PrintToFile = True.
I want it to create the PDF file without the user having to enter the filename or to have to check the "Print to File" box. In fact, I don't even want a print dialog, I just want PDFCreator to write out the PDF file without the user knowing anything about it. Then, I will do a PrintPreviewDialog() that will ask him if he wants a hard copy.
Dim dlg As New PrintDialog()
dlg.Document = mDoc
With mDoc.PrinterSettings
.PrinterName = ("PDFCreator")
.PrintFileName = (PrintFileName)
.PrintToFile = True
If dlg.ShowDialog = Windows.Forms.DialogResult.OK Then
mDoc.Print()
End If
End With
|
|
|
|
|
hi,
how can i split a string of word into one word using vb6?
for example :
i want to split a word of "download"
to be one word
like this "d","o","w","n","l","o","a","d"
thank you for your kindness...
Ihsan
|
|
|
|
|
I'm not 100% sure what you mean, but I think this might be what youre after:
<br />
dim sWord as string<br />
dim sSplit() as string<br />
sWord = "download"<br />
redim sSplit(len(sWord)-1)<br />
dim iPos as long<br />
for iPos = 1 to len(sWord)<br />
sSplit(iPos - 1) = mid(sWord, iPos, 1)<br />
next iPos<br />
This will give you an array of single character strings; sSplit(0) = "d", sSplit(1) = "o", etc.
|
|
|
|
|
VS 2003, sql server
I get the following error:
DataBinder.Eval: 'System.Data.DataRowView' does not contain a property with the name LastDate.
Description: An unhandled exception occurred during the execution of the current web request.
Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Web.HttpException: DataBinder.Eval: 'System.Data.DataRowView'
does not contain a property with the name LastDate.
Source Error:
Line 73: <%# DataBinder.Eval(Container.DataItem,"LastDate","{0:MM/dd/yyyy}") %>
My view is as follows:
CREATE VIEW dbo.vFieldReport
AS
SELECT dbo.Borrower.BName, dbo.FieldReports.CIF, dbo.FieldReports.FRID, dbo.FieldReports.LastDate,
dbo.FieldReports.DueDate, dbo.FieldReports.Overide,
dbo.FieldReports.NewDueDate, dbo.FieldReports.Freq,
dbo.FieldReports.DepthLevel, dbo.FieldReports.OrderDate, dbo.FieldReports.comments,
dbo.FieldReports.RiskRating, dbo.FieldReports.UCSClass, dbo.Loans.LoanNo
FROM dbo.Borrower INNER JOIN
dbo.FieldReports ON dbo.Borrower.CIF = dbo.FieldReports.CIF CROSS JOIN
dbo.Loans
My FieldReports Table is as follows:
Column Name Data Type Length Allow Nulls
LastDate dateTime 8 Yes
Here is the whole error code:
Server Error in '/COMS' Application.
--------------------------------------------------------------------------------
DataBinder.Eval: 'System.Data.DataRowView' does not contain a property with the name LastDate.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Web.HttpException: DataBinder.Eval: 'System.Data.DataRowView' does not contain a property with the name LastDate.
Source Error:
Line 71: <itemstyle wrap="False" horizontalalign="Center">
Line 72: <itemtemplate>
Line 73: <%# DataBinder.Eval(Container.DataItem,"LastDate","{0:MM/dd/yyyy}") %>
Line 74:
Line 75: <edititemtemplate>
Source File: c:\inetpub\wwwroot\COMS\FieldReport.aspx Line: 73
Stack Trace:
[HttpException (0x80004005): DataBinder.Eval: 'System.Data.DataRowView' does not contain a property with the name LastDate.]
System.Web.UI.DataBinder.GetPropertyValue(Object container, String propName) +146
System.Web.UI.DataBinder.Eval(Object container, String[] expressionParts) +71
System.Web.UI.DataBinder.Eval(Object container, String expression) +82
System.Web.UI.DataBinder.Eval(Object container, String expression, String format) +12
ASP.FieldReport_aspx.__DataBind__control29(Object sender, EventArgs e) in c:\inetpub\wwwroot\COMS\FieldReport.aspx:73
System.Web.UI.Control.OnDataBinding(EventArgs e) +66
System.Web.UI.Control.DataBind() +26
System.Web.UI.Control.DataBind() +86
System.Web.UI.Control.DataBind() +86
System.Web.UI.WebControls.DataGrid.CreateItem(Int32 itemIndex, Int32 dataSourceIndex, ListItemType itemType, Boolean dataBind, Object dataItem, DataGridColumn[] columns, TableRowCollection rows, PagedDataSource pagedDataSource) +169
System.Web.UI.WebControls.DataGrid.CreateControlHierarchy(Boolean useDataSource) +1408
System.Web.UI.WebControls.BaseDataList.OnDataBinding(EventArgs e) +49
System.Web.UI.WebControls.BaseDataList.DataBind() +23
COMS.FieldReports.BindData(Int32 intPageIndex, String strSortExp, String strSortOrder, String strBranch, String strBranchJ, String strBranch1, String strBranch9, String strType) +450
COMS.FieldReports.Page_Load(Object sender, EventArgs e) +185
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +750
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.2032; ASP.NET Version:1.1.4322.2032
|
|
|
|
|
hi, i would like to change the coding..but hten when when i change, the error turn out like this..
the loginADMINID, loginADMINNAME, loginADMINSTAFFNO, is nor declared..
what should i do to solve this error..the coding i slike this..
loginADMINID = txtUser.Text
loginADMINNAME = DsAdminLogin.Tables(0).Rows(0).Item("ADMINNAME")
loginADMINSTAFFNO = DsAdminLogin.Tables(0).Rows(0).Item("ADMINSTAFFNO")
loginPwd = txtPwd.Text
|
|
|
|
|
You need to declare the variables.
Dim loginAdminID as String
For example.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
i still cannot login,i dont know where shoul di check for it..
Private Function str_admin1() As String
Dim temp As frmAdminmenu
Dim loginAdminID As String
Dim loginADMINNAME As String
Dim loginADMINSTAFFNO As Integer
'Build connection to database
Dim myConnect As OleDbConnection = New OleDbConnection("Provider=MSDAORA.1;User ID=etuser;Password=etuser;Data Source=etlog.petronas.com.my")
'Clarify the database conn datatypes
Dim strsql As String
Dim strcount As String
'Dim userdata As OleDb.OleDbDataAdapter
Dim DsAdminLogin As New DataSet
Dim strcon As String
'Query SELECT stmt and assign into String
strsql = "Select ADMINID,ADMINPASSWORD,ADMINNAME,ADMINSTAFFNO from ADMIN1 where ADMINID='" & Me.txtUser.Text & "' and ADMINPASSWORD = '" & Me.txtPwd.Text & "'"
OleDbDataAdapter1 = New OleDb.OleDbDataAdapter(strsql, myConnect)
OleDbDataAdapter1.Fill(DsAdminLogin, "ADMIN1")
'Count and retrieve data from DB
intResponse1 = DsAdminLogin.Tables(0).Rows.Count
If intResponse1 > 0 Then
loginADMINID = txtUser.Text
loginADMINNAME = DsAdminLogin.Tables(0).Rows(0).Item("ADMINNAME")
loginADMINSTAFFNO = DsAdminLogin.Tables(0).Rows(0).Item("ADMINSTAFFNO")
loginPwd = txtPwd.Text
temp = New frmAdminmenu
Me.Hide()
temp.Show()
'strcount = "Select USERCOUNT from COUNT "
Else
MsgBox("Cannot login. Make sure your username and password are correct. Otherwise, you are not an authorized user to access this system.", MsgBoxStyle.Critical, "User Login Validation")
txtPwd.Text = ""
End If
End Function
sir..pls..help me..tq..
|
|
|
|
|
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemdataoledboledbdataadapterclassfilltopic1.asp[^]
OleDbDataAdapter1.Fill(DsAdminLogin, "ADMIN1")
Your second parameter is a recordset, you're passing a string. Why ?
loginADMINID = txtUser.Text
loginADMINNAME = DsAdminLogin.Tables(0).Rows(0).Item("ADMINNAME")
loginADMINSTAFFNO = DsAdminLogin.Tables(0).Rows(0).Item("ADMINSTAFFNO")
loginPwd = txtPwd.Text
What's the use of all this ? You don't use these values anywhere, they will just be lost.
Me.Hide()
temp.Show()
If you're going to hide your main form, you'd do better to define your other form and your main form UI as user controls, and switch between them on the one form. As it stands, you have no mechanism in place for the form you're showing to close and your main form to reappear.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I have attempted to use some of the new security classes in .NET 2.0. Question. How can I check the writes of the currently logged in user for a given resource suce as a file/directory. I want to know before taking an action if a user can write to a directory, can the user create a sub directory in a given directory on the network.
Here is what I have tried:
PUBLIC FUNCTION ReturnCheckMyRightsOnDirectory(XRightsToCheck AS DirectoryPermissions , XPath AS STRING) AS BOOLEAN
IF MY.Computer.FileSystem.DirectoryExists(XPath) = FALSE THEN
RETURN FALSE
END IF
TRY
DIM DirectoryName AS STRING = XPath
Dim dInfo AS NEW DirectoryInfo(DirectoryName)
Dim dSecurity As DirectorySecurity = dInfo.GetAccessControl()
DIM DirectoryRightToCheck AS FileSystemRights
SELECT CASE XRightsToCheck
CASE DirectoryPermissions.Create
DirectoryRightToCheck = FileSystemRights.CreateDirectories
CASE DirectoryPermissions.Read
DirectoryRightToCheck = FileSystemRights.Read
CASE DirectoryPermissions.Update
DirectoryRightToCheck = FileSystemRights.Modify
CASE DirectoryPermissions.Delete
DirectoryRightToCheck = FileSystemRights.Delete
CASE DirectoryPermissions.Write
DirectoryRightToCheck = FileSystemRights.Write
CASE DirectoryPermissions.Execute
DirectoryRightToCheck = FileSystemRights.ExecuteFile
CASE DirectoryPermissions.Admin
DirectoryRightToCheck = FileSystemRights.FullControl
END SELECT
dSecurity.AddAccessRule(New FileSystemAccessRule(SystemUserName, DirectoryRightToCheck, AccessControlType.Allow))
dInfo.SetAccessControl(dSecurity)
RETURN TRUE
CATCH ex As Exception
RETURN FALSE
END TRY
END FUNCTION
|
|
|
|
|
Hallo,
Can anyone help me with a guideline on how to add a record (line) in an Excel heet? All i could find in the help files is how to import data from excel into a dataset object, but nothing on how to do the opposite.
From the help files i gather that it's as if working with a database table. The question is should I add parameters (and how), and what is the syntax for inserting the data?
Thank you in advance.
|
|
|
|
|
how ComboBoxCell in DatagridView Can be Autocomplete and use Item dictionary like other comboBoxes
|
|
|
|
|
How can I create a sudoku solver
Passion
|
|
|
|
|
You could have search CodeProject for Sudoku[^] and would have found some articles already implementing what you want.
|
|
|
|
|
If you really want to see what goes into creating one, check this[^] out.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|