|
Sir,
i tried following options.
strConString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\\127.0.0.1\D:\News\News\bin\News.mdb"
strConString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\\computername\D:\News\News\bin\News.mdb".
But these are not working.
Thanks for your reply
Thomas
|
|
|
|
|
You are first trying to connect to an MDB on your local machine right?
If so, the Data Source parameter is malformed for a local path. That's what the error message has told you already.
Try copying the path you specify into the address box of Windows Explorer and see what it tells you. Now modify it until it works and then you should be able to use that in your connect string.
...Steve
1. quod erat demonstrandum
2. "Give a man a fish and you've fed him for a day. Teach him how to fish and you've fed him for life." I read that somewhere once
|
|
|
|
|
Hi,
with windows explorer i found this code will work.
strConString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\\127.0.0.1\D\News\News\bin\News.mdb"
Thanks for your valuable help.
Thomas
|
|
|
|
|
You are very welcome.
Another happy customer
...Steve
1. quod erat demonstrandum
2. "Give a man a fish and you've fed him for a day. Teach him how to fish and you've fed him for life." I read that somewhere once
|
|
|
|
|
Hi I am trying to place placeholder template within a datalist for some reason i am getting this error that says object reference not set to instance of an object the
aspx page is:
<asp:datalist id="dlScHead" runat="server" showfooter="False" showheader="False" cellspacing="0"
="" cellpadding="0" width="100%">
<itemtemplate>
<%# ctype(DataBinder.Eval(Container.DataItem,"ScoreCardID"),string) %>
<%# ctype(DataBinder.Eval(Container.DataItem,"scorecarddesc"),string) %>
<%# ctype(DataBinder.Eval(Container.DataItem,"BusinessGoal"),string) %>
|
<asp:datalist id="dlScChart" width="100%" datasource="<%# (GetRecords(Cstr(DataBinder.Eval(Container.DataItem, "ScoreCardId")))) %>" runat="server">
<itemstyle verticalalign="Top" backcolor="#EEEEEE">
<itemtemplate>
<asp:placeholder id="Placeholder1" runat="server">
|
<%# Server.htmlDecode(DataBinder.Eval(Container.DataItem,"Quarter1").tostring()) %>
<%# Server.htmlDecode(DataBinder.Eval(Container.DataItem,"Quarter2").tostring()) %>
<%# Server.htmlDecode(DataBinder.Eval(Container.DataItem,"Quarter3").tostring()) %>
<%# Server.htmlDecode(DataBinder.Eval(Container.DataItem,"Quarter4").tostring()) %>
|
================================================
and code behind
--------------------
in page load event i am doing
dlScHead.DataSource = GetRecords(Nothing)
dlScHead.DataBind()
and in function getRecords i am doing
Function GetRecords(ByVal scID As String) As SqlDataReader
Dim bizProgName As String = Request.QueryString("bizProgId")
Dim CommandText As String
Try
objConn = New SqlConnection(dbPath)
objConn.Open()
If scID = Nothing Then
Dim da As New SqlDataAdapter
da.SelectCommand = New SqlCommand
da.SelectCommand.Connection = objConn
da.SelectCommand.CommandText = "select scorecardId,bizProgId,scorecarddesc,businessgoal,strategy,quarter1,quarter2,quarter3,quarter4 from textData where bizProgID='" & Request.QueryString("bizProgId") & "'"
dr = da.SelectCommand.ExecuteReader(CommandBehavior.CloseConnection)
If dr.HasRows Then
'lblError.Text = ""
Else
'lblError.Text = "No records returned"
End If
GetRecords = dr
Else
cmd = New SqlCommand("select distinct measure_id from measuredata where scoreCardId = '" & scID & "'", objConn)
Dim da As SqlDataAdapter = New SqlDataAdapter(cmd)
Dim dtid As New DataTable("measureid")
da.fill(dtid)
'select all columns with id
Dim cmd1 As SqlCommand = New SqlCommand("select * from measuredata where scorecardid = '" & scID & "'", objConn)
Dim da1 As SqlDataAdapter = New SqlDataAdapter(cmd1)
Dim dt As New DataTable("measuresource")
da1.Fill(dt)
Dim datarow As DataRow
For Each datarow In dtid.Rows
Dim chart As New DataGrid
Dim myview As New DataView(dt)
' dim chart as new mycos.mycoschartweb
myview.RowFilter = String.Format("measure_id='{0}'", datarow.Item("measure_id"))
chart.DataSource = myview
chart.DataBind()
Dim i As Integer
For i = 0 To dlScChart.Items.Count - 1
dlScChart.Items(i).FindControl("placeholder1").Controls.Add(chart)
Next
Next datarow
' GetRecords = PlaceHolder1.FindControl("placeholder1")
End If
Catch ex As Exception
Response.Write("error on child-- here" + ex.ToString + " ")
Finally
End Try
End Function
i am getting error in
dlScChart.Items(i).FindControl("placeholder1").Controls.Add(chart)
please help thanks
|
|
|
|
|
I don't see the placeholder in your aspx code.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
uglyeyes wrote: For i = 0 To dlScChart.Items.Count - 1
dlScChart.Items(i).FindControl("placeholder1").Controls.Add(chart)
Next
Where is dlScChart defined and created?
You also may get better results if you posted this question in the right forum.
...Steve
1. quod erat demonstrandum
2. "Give a man a fish and you've fed him for a day. Teach him how to fish and you've fed him for life." I read that somewhere once
|
|
|
|
|
Just an Idea as its not letting me post asp scripts as a whole
----------
datalist id="dlScHead"
ItemTemplate
.. ctype(DataBinder.Eval(Container.DataItem,"ScoreCardID"),string).. |
datalist ID="dlScChart" DataSource=..(GetRecords(Cstr(DataBinder.Eval(Container.DataItem, "ScoreCardId")))) ..
ItemTemplate
<asp:placeholder id="Placeholder1" runat="server">
/ItemTemplate
<%# Server.htmlDecode(DataBinder.Eval(Container.DataItem,"Quarter1").tostring()) %>
<%# Server.htmlDecode(DataBinder.Eval(Container.DataItem,"Quarter2").tostring()) %>
<%# Server.htmlDecode(DataBinder.Eval(Container.DataItem,"Quarter3").tostring()) %>
<%# Server.htmlDecode(DataBinder.Eval(Container.DataItem,"Quarter4").tostring()) %>
|
/ItemTemplate
/asp:datalist
|
|
|
|
|
No it means nothing to me.
Like I said - post your question in the right forum (hint: try ASP.NET or Web Development ). You may get an answer there.
This forum is for VB/VB.NET questions.
Also a hint for pasting code..... check the checkbox named Ignore HTML tags in this message (good for code snippets) .
...Steve
1. quod erat demonstrandum
2. "Give a man a fish and you've fed him for a day. Teach him how to fish and you've fed him for life." I read that somewhere once
|
|
|
|
|
Hi all,
im new to vb.net and im trying to lure myself to it.
im trying to create a simple logon program using MS ACCESS as my database.
can somebody help me out on how to validate a log-in transaction.
i'am totally lost on this.
tnx...
-::maximus::-
|
|
|
|
|
Like 95% of people, you're jumping in too deep. If you're new to VB, learn he langue first, then worry about databases.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
How can I create a batch file using vb.net and then execute the batch file by clicking a button on the form. After the batch file has finished executing, it will be deleted.
Thank you for any reply
|
|
|
|
|
A batch file is just text. Just create a text file, called something.bat. Process.Start will run it.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
or
You can simply do it using shell function without creating a batch file.
Shell("CommandLine1 & CommandLine2", AppWinStyle.Hide)
Regards,
Chatura Dilan
|
|
|
|
|
When I run my application, and type letter “a” (letters), I need to type a Unicode character(s) instead of letter “a”(in word pad or any word processing application). I have seen applications like that, but I have no idea how to do that
Do you have any ideas?
Thank You,
&
Regards,
Chatura Dilan
|
|
|
|
|
Wonder if any of you guys could point me in the right direction? Everywhere I've searched on Google always shows me how to do this with a datagrid - but not a form - and it just doesn't seem to want to work how I want it work.
I've created a form which correctly displays all my fields in a recordset. I can scroll through them, add new records, delete records, etc. etc. and everything is fine.
I now want to add a Search field to the form so that when the user enters a search string, it automatically searches through the dataset for EITHER the CompanyName OR the CompanyID - and refreshes the display to display the appropriate search result (ie. populates the currently open form with the appropriate record).
-- modified at 18:21 Wednesday 31st May, 2006
I partly figured it out - but can't get it to work with an OR part of the SQL. Any advice would be appreciated. The CompanyID is an Autonumber field.
Dim strSearch As String = "SELECT * FROM tblCustomersParent WHERE CustomerName Like '%" & txtSearchString.Text & "%'"<br />
<br />
Me.OleDbSelectCommand1.CommandText = strSearch<br />
Me.LoadDataSet()
|
|
|
|
|
Are you trying to do a like on the auto number field?
"SELECT * FROM tblCustomersParent WHERE CustomerName Like '%" & txtSearchString.Text & "%' or CompanyID = " & txtCompanyName
You should really look at using parameterized queries as well.
Mike Lasseter
|
|
|
|
|
Hi - yes, the query was pretty much like you've suggested. I had tried:
"Select * From tblCustomersParent Where CompanyName Like '%" & txtSearchString.Text & "%'" & _<br />
" or CompanyID Like '%" & txtSearchString.Text & "%'"
and then...
"Select * From tblCustomersParent Where CompanyName Like '%" & txtSearchString.Text & "%'" & _<br />
" or CompanyID Like " & txtSearchString.Text
... and ended up just commenting out the OR bit
What do you mean when you say, "parameterized queries"? Could you show me an example?
|
|
|
|
|
hi,
A DATABASE IS RETRIEVED IN A DATAGRID then i want to use "find box" to find the record exactly the same as MS ACCESS USES.
bye.
|
|
|
|
|
I haven't worked with MS Access in a while, so I'm not sure how they do it. The easiest way to do this is to cycle through the rows until you find what you need.
Dim row As DataGridViewRow
For Each row In DataGridView1.Rows
If row.Cells(0).Value.ToString = TextBox1.Text Then
DataGridView1.CurrentCell = row.Cells(0)
Exit For
End If
Next
The 0 in the cells parameters should match whatever column you want it in.
HTH
|
|
|
|
|
Thanks leeland
but datagridviewrow is not defined , so it is showing systex error.
what is datagridviewrow here.please explain.
|
|
|
|
|
DataGridView is the .Net 2005 version of the DataGrid (2003). You should be able to use the same type of logic to find values in the datagrid.
Mike Lasseter
|
|
|
|
|
I need a program which will read the local machine users and group membership and export this information to either a tab delimited file or an xml file.
Any help appreciated, I can get the active directory users and groups easilly, but am stumped on how to get it from the local machine. FYI I got handed this for a security audit and don't want to have to go to each computer to get it.
Thanks in advance.
|
|
|
|
|
hi everybody
how i execute this winzip to a file by using vb.net
and return the new file.zip
thanks
|
|
|
|
|
Well, if you want to do it completely "behind the scenes" you'll need to get the command line add-in.
[^]
Once you have that installed, you can create a string for the additional parameters and pass it to a shell command
str = "c:\path\to\winzipcl.exe file.zip file1 file2 file3"
shell(str)
|
|
|
|