|
Pl. Can you send that code for disktop Application
|
|
|
|
|
|
can someone please help me about subreport...
i didnt know if it is possible -- i am thinking of creating a subreport which is accepting parameters from the main report.
ifnot-- can you just guve me a tutorial on using subreports.
another one is how could i use the "record number" that is resetting every page..
this what happens. i have a report contains lot of pages... if the first page has the number 1-8, then the other page will start on 9 and so on... which should start with 1.
thanx!
|
|
|
|
|
i have the Following code, it game an Error when i tried to run it without trapping the Error. now i used an error trap and the message i get from it now is
Line1 Incorect Syntax Near ')'
Please Help me to point the exact line where it occured. Heere is my code i have in my form load thanks.
Dim strErrorMsg As String<br />
Dim strerror As System.Data.SqlClient.SqlError<br />
<br />
Dim strconnection As String = "packet size=4096;user id=#######; Password=#########;data source=#######;persist security info=False;initial catalog=Tshwane_Valuations"<br />
Dim cn As SqlConnection = New SqlConnection(strconnection)<br />
cn.Open()<br />
<br />
'set up the data soruce <br />
Dim strSql As String = _<br />
"select Actual_Extent,Attrib_code,Lis_key,Func_key,Density," _<br />
& "New_Net_Usable_Extent,New_Total_Land_Factor,New_AdJ_Extent_1, New_Points_1, " _<br />
& "New_ADJ_Extent_2, New_Points_2, LS_Prediction, LS_Confidence from Property_Mass "<br />
Dim da As SqlDataAdapter = New SqlDataAdapter(strSql, cn)<br />
<br />
'load a Dataset <br />
Dim ds As DataSet = New DataSet<br />
da.Fill(ds, "Property_mass")<br />
<br />
'set up a new data adapter object <br />
strSql = _<br />
"select Property_Mass.Actual_Extent,Property_Mass.Attrib_code,Property_Mass.Lis_key,Property_Mass.Func_key,Property_Mass.Density," _<br />
& "Property_Mass.New_Net_Usable_Extent,Property_Mass.New_Total_Land_Factor, Property_Mass.New_AdJ_Extent_1, Property_Mass.New_Points_1," _<br />
& "Property_Mass.New_ADJ_Extent_2, Property_Mass.New_Points_2, Property_Mass.LS_Prediction, Property_Mass.LS_Confidence, Property_Mass.LS_TYPE," _<br />
& "Property_Summary.Purchase_Date, Property_Summary.Purchase_Price)" _<br />
& "from(Property_Mass, Property_Summary)" _<br />
& " where Property_Mass.Lis_key = Property_Summary.Lis_key"<br />
da = New SqlDataAdapter(strSql, cn)<br />
<br />
'load the Data set<br />
Try<br />
da.Fill(ds, "Property_Summary")<br />
'Close the Connection<br />
cn.Close()<br />
<br />
'Create relations <br />
ds.Relations.Add("Property_summary_Mass", _<br />
ds.Tables("Property_Mass").Columns("Lis_key"), _<br />
ds.Tables("Property_Summary").Columns("Lis_key"))<br />
<br />
'Bind the data set to the grid.<br />
'Assumes that Grid contains a reference to a <br />
'system.windows.datagrid<br />
DataGrid2.SetDataBinding(ds, "Property_Mass")<br />
Catch ExSQL As System.Data.SqlClient.SqlException<br />
'''All this will trap all data Problems and Network if available<br />
For Each strerror In ExSQL.Errors<br />
Next<br />
Select Case strerror.Number<br />
Case 17<br />
strErrorMsg = "Missing server"<br />
Case 4060<br />
strErrorMsg = "Missing database"<br />
Case 18456<br />
strErrorMsg = "Missing user name or password"<br />
Case Else<br />
strErrorMsg = strerror.Message<br />
End Select<br />
MessageBox.Show(strErrorMsg, "SQL Server Error: " & strerror.Number, MessageBoxButtons.OK, MessageBoxIcon.Error)<br />
<br />
Catch ExcpInvOp As System.InvalidOperationException<br />
<br />
MessageBox.Show("Close the connection first!", "Invalid Operation", MessageBoxButtons.OK, MessageBoxIcon.Error)<br />
<br />
Catch Excp As System.Exception ' generic exception handler<br />
<br />
MessageBox.Show(Excp.Message, "Unexpected Exception", MessageBoxButtons.OK, MessageBoxIcon.Error)<br />
End Try<br />
End Sub<br />
<br />
NOTE: The username, password, and my server are corrrect i have hid them for security purpose. Thanks
Vuyiswa Maseko
|
|
|
|
|
i have seen some few stupid mistakes i have done, and i fixed it to this
<br />
Dim strErrorMsg As String<br />
Dim strerror As System.Data.SqlClient.SqlError<br />
<br />
Dim strconnection As String = "workstation id=5875-049;packet size=4096;user id=sde; Password=#####;data source=#######;persist security info=False;initial catalog=Tshwane_Valuations"<br />
Dim cn As SqlConnection = New SqlConnection(strconnection)<br />
cn.Open()<br />
'set up the data soruce <br />
Dim strSql As String = _<br />
"select Actual_Extent,Attrib_code,Lis_key,Func_key,Density," _<br />
& "New_Net_Usable_Extent,New_Total_Land_Factor,New_AdJ_Extent_1,New_Points_1," _<br />
& "New_ADJ_Extent_2, New_Points_2, LS_Prediction, LS_Confidence from Property_Mass "<br />
Dim da As SqlDataAdapter = New SqlDataAdapter(strSql, cn)<br />
<br />
'load a Dataset <br />
Dim ds As DataSet = New DataSet<br />
da.Fill(ds, "Property_mass")<br />
<br />
'set up a new data adapter object <br />
strSql = _<br />
"select Property_Mass.Actual_Extent,Property_Mass.Attrib_code,Property_Mass.Lis_key,Property_Mass.Func_key,Property_Mass.Density," _<br />
& "Property_Mass.New_Net_Usable_Extent,Property_Mass.New_Total_Land_Factor, Property_Mass.New_AdJ_Extent_1, Property_Mass.New_Points_1," _<br />
& "Property_Mass.New_ADJ_Extent_2, Property_Mass.New_Points_2, Property_Mass.LS_Prediction, Property_Mass.LS_Confidence, Property_Mass.LS_TYPE," _<br />
& "Property_Summary.Purchase_Date, Property_Summary.Purchase_Price" _<br />
& "from Property_Mass, Property_Summary" _<br />
& " where Property_Mass.Lis_key = Property_Summary.Lis_key"<br />
da = New SqlDataAdapter(strSql, cn)<br />
<br />
'load the Data set<br />
Try<br />
da.Fill(ds, "Property_Summary")<br />
'Close the Connection<br />
cn.Close()<br />
<br />
'Create relations <br />
ds.Relations.Add("Property_summary_Mass", _<br />
ds.Tables("Property_Mass").Columns("Lis_key"), _<br />
ds.Tables("Property_Summary").Columns("Lis_key"))<br />
<br />
'Bind the data set to the grid.<br />
'Assumes that Grid contains a reference to a <br />
'system.windows.datagrid<br />
DataGrid2.SetDataBinding(ds, "Property_Mass")<br />
Catch ExSQL As System.Data.SqlClient.SqlException<br />
'''All this will trap all data Problems and Network if available<br />
For Each strerror In ExSQL.Errors<br />
Next<br />
Select Case strerror.Number<br />
Case 17<br />
strErrorMsg = "Missing server"<br />
Case 4060<br />
strErrorMsg = "Missing database"<br />
Case 18456<br />
strErrorMsg = "Missing user name or password"<br />
Case Else<br />
strErrorMsg = strerror.Message<br />
End Select<br />
MessageBox.Show(strErrorMsg, "SQL Server Error: " & strerror.Number, MessageBoxButtons.OK, MessageBoxIcon.Error)<br />
<br />
Catch ExcpInvOp As System.InvalidOperationException<br />
<br />
MessageBox.Show("Close the connection first!", "Invalid Operation", MessageBoxButtons.OK, MessageBoxIcon.Error)<br />
<br />
Catch Excp As System.Exception ' generic exception handler<br />
<br />
MessageBox.Show(Excp.Message, "Unexpected Exception", MessageBoxButtons.OK, MessageBoxIcon.Error)<br />
End Try<br />
End Sub<br />
but i still have one different Error, it says
Column Prefix 'Property_Summary' does not match with a table name or alias name used in this query.
Thanks
Vuyiswa Maseko
|
|
|
|
|
The Problem was so small, it was the Spaces provided in strSQl,
<br />
Dim strErrorMsg As String<br />
Dim strerror As System.Data.SqlClient.SqlError<br />
<br />
Dim strconnection As String = "workstation id=5875-049;packet size=4096;user id=sde;Password=topology;data source=SGIICORNETGS01;persist security info=False;initial catalog=Tshwane_Valuations"<br />
Dim cn As SqlConnection = New SqlConnection(strconnection)<br />
cn.Open()<br />
'set up the data soruce <br />
Dim strSql As String = _<br />
"select Actual_Extent,Attrib_code,Lis_key,Func_key,Density," _<br />
& "New_Net_Usable_Extent,New_Total_Land_Factor,New_AdJ_Extent_1,New_Points_1," _<br />
& "New_ADJ_Extent_2, New_Points_2, LS_Prediction, LS_Confidence from Property_Mass "<br />
Dim da As SqlDataAdapter = New SqlDataAdapter(strSql, cn)<br />
<br />
'load a Dataset <br />
Dim ds As DataSet = New DataSet<br />
da.Fill(ds, "Property_mass")<br />
<br />
'set up a new data adapter object <br />
strSql = _<br />
"select Property_Mass.Actual_Extent,Property_Mass.Attrib_code,Property_Mass.Lis_key,Property_Mass.Func_key,Property_Mass.Density," _<br />
& " Property_Mass.New_Net_Usable_Extent,Property_Mass.New_Total_Land_Factor,Property_Mass.New_AdJ_Extent_1, Property_Mass.New_Points_1," _<br />
& " Property_Mass.New_ADJ_Extent_2, Property_Mass.New_Points_2, Property_Mass.LS_Prediction, Property_Mass.LS_Confidence, Property_Mass.LS_TYPE," _<br />
& " Property_Summary.Purchase_Date, Property_Summary.Purchase_Price" _<br />
& " from Property_Mass, Property_Summary" _<br />
& " where Property_Mass.Lis_key = Property_Summary.Lis_key"<br />
da = New SqlDataAdapter(strSql, cn)<br />
<br />
'load the Data set<br />
Try<br />
da.Fill(ds, "Property_Summary")<br />
'Close the Connection<br />
cn.Close()<br />
<br />
'Create relations <br />
ds.Relations.Add("Property_summary_Mass", _<br />
ds.Tables("Property_Mass").Columns("Lis_key"), _<br />
ds.Tables("Property_Summary").Columns("Lis_key"))<br />
<br />
'Bind the data set to the grid.<br />
'Assumes that Grid contains a reference to a <br />
'system.windows.datagrid<br />
DataGrid2.SetDataBinding(ds, "Property_Mass")<br />
Catch ExSQL As System.Data.SqlClient.SqlException<br />
'''All this will trap all data Problems and Network if available<br />
For Each strerror In ExSQL.Errors<br />
Next<br />
Select Case strerror.Number<br />
Case 17<br />
strErrorMsg = "Missing server"<br />
Case 4060<br />
strErrorMsg = "Missing database"<br />
Case 18456<br />
strErrorMsg = "Missing user name or password"<br />
Case Else<br />
strErrorMsg = strerror.Message<br />
End Select<br />
MessageBox.Show(strErrorMsg, "SQL Server Error: " & strerror.Number, MessageBoxButtons.OK, MessageBoxIcon.Error)<br />
<br />
Catch ExcpInvOp As System.InvalidOperationException<br />
<br />
MessageBox.Show("Close the connection first!", "Invalid Operation", MessageBoxButtons.OK, MessageBoxIcon.Error)<br />
<br />
Catch Excp As System.Exception ' generic exception handler<br />
<br />
MessageBox.Show(Excp.Message, "Unexpected Exception", MessageBoxButtons.OK, MessageBoxIcon.Error)<br />
End Try<br />
Thanks, i think i solved my Problem myself, if you have any suggestion about my code please comment, thanks
Vuyiswa Maseko
|
|
|
|
|
Hi,
it is very nice of you to show an error message in PRE tags. Good.
It would be even better if you would also show your actual code in PRE tags
(instead of CODE tags); that way it would show with indentation and be much more
readable.
Doesnt your compiler give you the line numbers when it reports errors ? If your
IDE (Visual?) does not show line numbers by default in the left margin, you can
easily turn that on (Visual: Tools/Options/TextEditor/AllLanguages/DisplayLineNumbers)
|
|
|
|
|
Hi Luc
Thanks for your comment, i will certainly show my code in a PRE tags.
about the line number i have turn it on thanks man
thank you
-- modified at 9:42 Monday 30th July, 2007
Vuyiswa Maseko
|
|
|
|
|
Hello,
i try to create an application that listen for download Files with a special extension.
When a user click on a Link the program must decide to download the file with default settings (e.g. Standard Firefox) or use it's own.
Can someone help me??
Thank you
Mirko Olsiewicz
|
|
|
|
|
You'd either be writing a web browser extension, in your case FireFox I assume, or a proxy server.
In either case, you're looking for the type and filename of the file being returned by the server.
|
|
|
|
|
Ok,
i saw something on Microsoft Homepage with activX. Will it work when i create an ativeX Control? Otherwise we build a Wrapper Class. The user then must run the exe File after download.
Thank you for help
Mirko Olsiewicz
|
|
|
|
|
I believe it's Microsoft's Download Manager that makes the request to download the file. It doesn't monitor the request/responses to see which ones it should be watching for. The code in the page specifically uses the MS Download Manager to download the files.
|
|
|
|
|
Hi All,
I was wondering if its possible for me to control which object the function GetObject() grabs.
I have multiple copies of the same program running and I would like to be able to get an OLE object from each one. I have search all over the net but can't seem to find anyone that has done this. The only thing I can find is that GetObject only returns the last instance created.
Can I use the Getobject() function to do what I am looking for or is there a different method of doing this.
Thanks
Nathan
|
|
|
|
|
MadmanWoo wrote: I was wondering if its possible for me to control which object the function GetObject() grabs.
No. It'll grab the first instance it finds. You have no control over which one that is.
|
|
|
|
|
Is there anyway for me to do what I need?
Thanks
|
|
|
|
|
I'm speculating that you'd have to enumerate the Running Object Table to find the instance you want. You'd have to P/Invoke the OLE32 library functions to do this, but it's possible. Take a look at this[^] article here on CP you'll find a similar example.
|
|
|
|
|
Thanks Dave I'll have a look into it
|
|
|
|
|
dsn creation code in vb.net
Dim str As String = ""
str = Application.StartupPath
If (str.Contains("\bin\Debug") = True) Then
str = str.Remove(str.LastIndexOf("\bin\Debug"))
End If
Dim Driver As String = "Microsoft Access Driver (*.MDB)"
Dim ireturn As Integer = 0
Dim Attributes As String = "DSN=" & "globizz "
Attributes = Attributes & "Uid=Admin " & "pwd=globizzdatabase"
Attributes = Attributes & " DBQ=" & str & "\data\dbGlobizz.mdb"
Attributes = "DSN=globizz Uid=Admin pwd=globizzdatabase DBQ=" + str & "\data\dbGlobizz.mdb"
ireturn = SQLConfigDataSource(0, 1, Driver, Attributes)
it is not creating the dsn
please help.
Sonia Gupta
Soniagupta1@yahoo.co.in
Yahoo messengerId-soniagupta1
Love is Friendship and Friendship is Love....
|
|
|
|
|
Sonia Gupta wrote: dsn creation code in vb.net
Dim str As String = ""
str = Application.StartupPath
If (str.Contains("\bin\Debug") = True) Then
str = str.Remove(str.LastIndexOf("\bin\Debug"))
End If
Dim Driver As String = "Microsoft Access Driver (*.MDB)"
Dim ireturn As Integer = 0
Dim Attributes As String = "DSN=" & "globizz "
Attributes = Attributes & "Uid=Admin " & "pwd=globizzdatabase"
Attributes = Attributes & " DBQ=" & str & "\data\dbGlobizz.mdb"
Attributes = "DSN=globizz Uid=Admin pwd=globizzdatabase DBQ=" + str & "\data\dbGlobizz.mdb"
ireturn = SQLConfigDataSource(0, 1, Driver, Attributes)
it is not creating the dsn
So far as I can see, this code creates only a connection string. The DSN globizz should already be configured in your system.
|
|
|
|
|
What do you want exactly? Are you trying to create through code or just trying to connect to database using the DSN?
|
|
|
|
|
|
sori i don't anything plz teaching me..i hope everyboy can help me in the vb.net / vb studio ... i want to study this....tq all nice to meet u all
|
|
|
|
|
Ever heard of books ...they are really great for learning...this isn't a classroom or an education centre, learning is your responsobility. If you have a problem with something you are learning then you come here and ask about it.
|
|
|
|
|
First and foremost two things:
1) Typo and Grammar
2) Properly phrased English sentence.
There are actually two totally misguiding words in your query.
freerhyme_2 wrote: sori
In Tamil, it means 'itching' and 'scratching' all over.
freerhyme_2 wrote: everyboy
Why is the help request gender-specific?
|
|
|
|
|
i'm sure sori was because he's lazy and everyboy was because he missed the d...
|
|
|
|
|